How to copy files off a VM

In my case I wanted to copy a sqlite database from my local to the volume mounted on the app.

This is what worked for me:

  • fly wireguard create, suffix the profile name with .conf, import into wireguard and connect to it, now you can reach to your appname.internal
  • flyctl ssh issue --agent to add the proper ssh key there, otherwise you get permission denied
  • ssh root@appname.internal and install openssh-client apt-get install openssh-client, otherwise you get “scp command not in $PATH”.
  • scp foo.db root@appname.internal:/data/foo.db, for some reason it hang
  • redeploy the app so it loads the latest file
3 Likes