How to setup Linux Server Backups with Bareos

Routine offsite backup of data is very important for mission critical servers.  This article will show you how to setup Bareos for linux server backups.

What you’ll need:

  • A primary Linux server: This article will describe the steps for CentOS based servers, but Bacula can automate linux server backups on Debian, SuSe, and Redhat based distributions.
  • A secondary Linux server: This server will store the server backup data.

Installing Bareos

We will start by switching into our root user:

sudo su

Install wget:

yum install -y wget

Download the Bareos repository:

wget -O /etc/yum.repos.d/bareos.repo $URL/bareos.repo

Install the Bareos packages

yum install bareos bareos-database-$DATABASE
yum install postgresql-server postgresql-contrib

Initialize Postgres:

postgresql-setup initdb

Start Postgres and enable it on boot:

systemctl start postgresql
systemctl enable postgresql

Setup the Bareos database:

su postgres -c /usr/lib/bareos/scripts/create_bareos_database
su postgres -c /usr/lib/bareos/scripts/make_bareos_tables
su postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges

Start the Bareos daemons:

service bareos-dir start
service bareos-sd start
service bareos-fd start

Install the webUI:

yum install bareos-webui

Configure SELinux to allow connections:

setsebool -P httpd_can_network_connect on

Restart apache and the Bareos director:

systemctl restart httpd
systemctl restart bareos-dir

Start the Bareos console:


Add an admin username, replace the word secret with a secure password:

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

You can now navigate to http://your-server-ip//bareos-webui/ and login with your admin credentials.

Next Steps

Your server is now setup with Bareos for server backup and restoration. You can now review the Bareos documentation in order to setup automated server backup operations.

About The Author