Veeam-Backup your VPS to a FTP-Server

Veeam-Backup your VPS to a FTP-Server
Photo by benjamin lehman / Unsplash

Due to the fact that I have a VPS with a hoster, I want to back it up properly since there is data I don't want to lose and also configurations made I would have to redo. Preferably I don't want to do the backups with the same hoster, on the one hand for cost reasons and on the other hand in case the hoster goes offline for whatever reason. Therefore a backup should always be decentralized just in case.

For an revision-proof backup I have chosen veeam as a software. In its free version, however, can be backed up only to a local storage. For this reason I describe in the following briefly how to add an FTP connection as a local mount to do so.

First of all you have install Veeam to your VPS. I don't explain how this works since there are enough tutorials and offical documentations out there. Then set up the local mount as follows:

1. Open fstab

sudo nano /etc/fstab

2. Add following line and edit the CAPS of the connection string. Check out the offical documentation to understand what you are doing here.

sshfs#FTP-USER@FTP-SERVER:FTP/TARGET/FOLDER /home/root/LOCAL-MOUNT fuse defaults,allow_other,nonempty,_netdev 0 0

3. You might have to install sshfs to get it work:

sudo apt-get install sshfs

4. The folder you've put in above as local mount point should be made, depending on where it is, like this:

sudo mkdir /home/root/local-mount

5. Manually mount fstab, you have to insert your FTP-user password here:

sudo mount -a

6. Check the mount, it should show you the connection on the bottom:

sudo df -h

7. Run the veeam agent and add a new backup-job as you wish.

sudo veeam
Keep in mind, if you run a full-backup of your system you might get stuck in a loop because veeam will try to backup the mount aswell which results in that loop. I would recommend to add a file-level-backup-job (in my case this works best because any service on my VPS is running on Docker) and exclude (uncheck) your local mount path from point 2 and you are good to go.

Troubleshooting

If you are running in failed backups with veeam saying your "Transport endpoint is not connected" you need to "re-mount" the directory:

fusermount -uz /path-to-mount
sudo mount -a