This article gives an introduction to Bacula. We’ll cover how to install and configure Bacula, an open source, distributed and highly customizable backup solution. We start with installing and the configuring the server, before we install and configure the client. Then we’ll cover how to perform a very basic backup and restore of some files on the client.
A little background and why Bacula
I generally work using Virtual machines hosted on my workstation, as this allows me to quickly spin up different environments that I need for development and testing. However, I needed a robust backup solution that would allow me to backup the information on my VMs but also on my other machines that run different operating systems. VMs comes with the ability to take snapshots of the current state and I experimented with this feature as well as exporting an image of the current state of the virtual machine as a backup solution. However, this proved time consuming and didn’t provide a solution for my Windows and Mac hosts. This lead me searching for a robust backup solution I could use, ultimately landing on Bacula.
This article is broken into four sections, the first section hows the inner components of Bacula, how these components interact and lays out the network configuration for our test setup.
Then we’ll install Bacula server on a VM running Ubuntu Server 18.04, and on our client which runs a clean version of Ubuntu Desktop 18.04, we’ll install the Bacula client software.
The third section looks at how to configure the server to perform a manual backup via the Bacula console and in the last section we’ll configure and perform a restore of a sample file that we have backed up.
Bacula, inner components and a layout of our network
Bacula is a completely modularized backup solution, allowing us to scale quickly by moving the individual components onto their own computers, or even hosting multiple computers each running their own file, storage or database server. Even with multiple database servers, or multiple file servers, we can still manage everything from one director instance. For example, we can add new File, Database and Storage servers to the director’s configuration file, thus expanding the capabilities of the backup solution. However, the capabilities of Bacula is far too many to list here, however this section aims to provide the minimum amount of information to get started.
The setup for this article is very simplistic, consisting of one client and one server. In this example, the server will hosts all the components, the File, Storage, Database and Director. Though simplistic, the setup serves the purpose of getting up and running with minimum effort, and we will use this example to build out a more robust solution in future articles.
Before we start, please remember to test any settings or changes in a development environment and ensure that you always have a backup of any files that you use.
Starting the Bacula-Server installation process
I have already installed and configured a VM with a clean installation of Ubuntu Server 18.04. Let’s run apt update and apt upgrade to ensure that it has the latest updates.
Once all repositories have updated, start the upgrade process.
Lets first see if we have the correct repositories to configured so that we can install Bacula from apt.
apt search bacula
If you see the packages shown in the screenshot above, then skip to the next section
Adding the necessary apt repositories
Upon attempting to install Bacula, apt did not find any of the required packages. I searched the online Ubuntu repositories and verified that the Bacula packages where there. Therefore, I determined that the repositories containing the Bacula packages were missing from my source list. So, I needed to add the missing repositories back into my source.list file.
First, take a backup of source.list in /etc/apt
sudo cp /etc/apt/source.list /etc/apt/source.list.backup
Now add the following lines to /etc/apt/source.list
deb http://archive.ubuntu.com/ubuntu bionic main deb http://archive.ubuntu.com/ubuntu bionic-security main deb http://archive.ubuntu.com/ubuntu bionic-updates main
Then save the file and run the apt update process.
sudo apt update
Finally, run the apt search again to verify that we can find the Bacula packages.
sudo apt search bacula
You should now see a list of the Bacula packages.