(Last Updated On: February 13, 2019)

Data backup is a “must do” frequent task for any System Administrator. There are various open source tools available for performing system backups. In this guide, we will look at how you can install and use Bareos. Bareos is an open source backup tool which works for Linux, Windows, and macOS operating systems.

Its VMware Backup Plugin enables you to also backup Virtual Machines running in VMware Infrastructure. Created virtual disk images can be restored into the same virtual machine or to a VMDK file.

Install Bareos on Ubuntu 18.04/ Ubuntu 16.04

The packages for Bareos are available on Bareos Apt repositories. Add them to your system by running the commands below as root user or user with sudo privileges.

RELEASE=release/latest/
DIST=xUbuntu_$(lsb_release -sr)
URL=http://download.bareos.org/bareos/$RELEASE/$DIST 
printf "deb $URL /\n" | sudo tee  /etc/apt/sources.list.d/bareos.list 

After adding the repository, import the repository GPG key:

wget -q $URL/Release.key -O- | sudo apt-key add - 

Update your package list index and install Bareos with MariaDB database server.

sudo apt update
sudo apt install mariadb-server bareos bareos-database-mysql

When prompted to configure Postfix, you can choose the “Internet site

If you had not installed a database server, you can use dbconfig to configure Bareos database.

Set bareos database password.

Confirm the password to finish installation.

A successful installation should look like below.

Setting up bareos-database-tools (18.2.5-139.1) …############################################################################################….] 
Setting up bareos-director (18.2.5-139.1) …
replacing 'XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX' with 'ubuntu-01' in /etc/bareos/bareos-dir.d/storage/File.conf##################################…]
replacing 'XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX' in /etc/bareos/bareos-dir.d/director/bareos-dir.conf
replacing 'XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX' in /etc/bareos/bareos-dir.d/client/bareos-fd.conf
replacing 'XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX' in /etc/bareos/bareos-dir.d/storage/File.conf
replacing 'XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX' in /etc/bareos/bareos-dir.d/console/bareos-mon.conf
Info: unable to get "dbdriver" from config, this is usually not an error. Check /tmp/bareos-config.17867.log
replacing 'XXX_REPLACE_WITH_DATABASE_DRIVER_XXX' with 'mysql' in /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf
Created symlink /etc/systemd/system/bareos-dir.service -> /lib/systemd/system/bareos-director.service.
Created symlink /etc/systemd/system/multi-user.target.wants/bareos-director.service -> /lib/systemd/system/bareos-director.service.
Processing triggers for libc-bin (2.27-3ubuntu1) …#############################################################################################..]
Processing triggers for systemd (237-3ubuntu10.9) …
Processing triggers for ureadahead (0.100.0-20) …
Processing triggers for rsyslog (8.32.0-1ubuntu4) …

All bareos configurations are located under the /etc/bareos/ directory.

Install Bareos Web UI

Bareos WebUI is a PHP-Frontend to monitor and manage Bareos. It allows you to perform backup operations from a web dashboard. Install Bareos Web UI by running the command below.

sudo apt-get install bareos-webui

The dependencies installed include Apache web server, PHP and a number of extensions.

Restart the Apache web server to activate the new configuration.

sudo systemctl restart apache2

Start all Bareos services.

sudo systemctl start bareos-dir bareos-sd bareos-fd

Create console user

Access the bconsole to create a user account used to access the webui.

# bconsole
Connecting to Director localhost:9101
Encryption: ECDHE-PSK-CHACHA20-POLY1305
1000 OK: bareos-dir Version: 18.2.5 (30 January 2019)
bareos.org build binary
bareos.org binaries are UNSUPPORTED by bareos.com.
Get official binaries and vendor support on https://www.bareos.com
You are connected using the default console
Enter a period to cancel a command.
*

Add UI admin user like below.

configure add console name=admin password=StrongPassword profile=webui-admin

Replace admin with your desired username and [email protected] with its password.

You should get below output.

Created resource config file "/etc/bareos/bareos-dir.d/console/admin.conf":
Console {
Name = admin
Password = StrongPassword
Profile = webui-admin
}

You can edit the file /etc/bareos/bareos-dir.d/console/admin.conf to change or add a username and password. Use the exitcommand to quit bconsole when done.

Restart services

sudo systemctl restart apache2 bareos-dir bareos-sd bareos-fd

Accessing Bareos the Web-UI

The Bareos Web UI can be accessed on http://serverip/bareos-webui.

Login with user created earlier and password. For configuration and usage, refer to official Documentation.