Do you have a few virtual machines with some precious configuration files stored somewhere that you would like to back up? Here i will show you just that, using a nifty program called Duplicati.
Duplicati is just one open source program, but there are many others available. I like Duplicati for its simplicity, user-friendliness and built-in encryption. You can use Duplicati with almost any web service: OneDrive, Google Drive, Amazon AWS, Backblaze B2, Dropbox and more! However you can also use it to backup to a local storage server, such as a NAS which is what i will be using in my case.
At this stage i am going to assume that you already have Ubuntu Server set up and you are comfortable with the CLI, since you are reading this post.
Download and Install Duplicati
At the time of writing, the current version is 188.8.131.52, but you can get the latest version here. It might be best to be in the root directory to download this, but it is your choosing.
wget https://updates.duplicati.com/beta/duplicati_184.108.40.206-1_all.deb sudo dpkg -i duplicati_220.127.116.11-1_all.deb
If you get an error that you are missing dependencies, then run this command and then try again:
sudo apt-get -f install -y
sudo dpkg -i duplicati_18.104.22.168-1_all.deb
Remember to change your filenames to the right version if it is newer than 22.214.171.124.
Configure webservice and systemd
Congratulations, Duplicati is now installed on your Linux machine however it will not be running just yet. We need to make some changes. First, we need to change the IP address that the web interface will listen on. If you want to access the Duplicati remotely, then you can specify it to listen on the IP address the machine has:
sudo nano /etc/default/duplicati
There may already be something here, but in that case, you can remove it or edit it to include this, but ONLY this:
This will be listening on all network interfaces, if you want to specify the interface for the webservice to listen on, you need to remove the any at the end and replace it with the IP address, for example if the machines IP address was 192.168.20.5 then it would look like this:
Now time to create a Duplicati service so that the system runs when the machine is booted. This will ensure that your backups will always be ran even if the machine is rebooted.
sudo nano /etc/systemd/system/duplicati.service
*This code will also attempt to restart Duplicati if it crashed for any reason.
Now we just need to enable the service we just created and also start it.
sudo systemctl enable duplicati sudo systemctl start duplicati
And well done, Duplicati is now installed in Linux and configured to run as a service. You can access it by going to port 8200 of the machine, so if the IP address of the machine was 192.168.20.5 then you would go to http://192.168.20.5:8200
The User interface is pretty nice, and easy to use. It is also very self-explanatory if you know what you are playing with; so i wont get into that since there is plenty of great documentation already written up here. But if you get stuck with anything you can always click the White Envelope in the top right of all my pages.