Install Bareos on CentOS 7

0
132

Data backup is essential for a sysadmin and any real user of a system. Doing so will bring many advantages to our company because, in case of failures, you will have your data well protected. Recently, I was talking about preventing the accidental deletion of certain files in Linux, but today I’ll show you how to install Bareos a tool to back up CentOS 7.

Bareos is a fairly reliable, robust and secure tool for backing up and protecting data on our operating system. In addition, it is a 100% open source fork of the backup project from Bacula. The code is released under the aGPL license which guarantees flexibility for working with the code. Code that is available in GitHub.

So, let us start.

1. Upgrade the system

First, you need to upgrade the whole system. Just run these commands on the terminal:

:~$ su
:~# yum update
1.- Upgrade the system
1.- Upgrade the system

After that, you will have a more secure system thanks to the new security patches newly installed.

2. Install MariaDB

Bareos for its operation requires a database manager like MariaDB. So the next step is to install MariaDB.

:~# yum install mariadb-server
2.- install MariaDB
2.- install MariaDB

After that, enable and start the MariaDB service.

:~# systemctl enable mariadb
:~# systemctl start mariadb
3.- Enable the mariadb service
3.- Enable the mariadb service

So, that’s it for now.

3. Install Bareos on CentOS 7

Now it is your turn to install Bareos. For this, we will use the dedicated Bareos repository for CentOS. This is the safest and easiest way to install Bareos. Since we can always count on the latest stable version of the program. It also simplifies installation times.

:~# yum install wget
:~# wget -O /etc/yum.repos.d/bareos.repo http://download.bareos.org/bareos/release/latest/CentOS_7/bareos.repo
5.- Adding the repository
5.- Adding the repository

After that, install it. You also need to install the MariaDB / MySQL connector. On the other hand, you can choose between MariaDB or PostgreSQL.

:~# yum install bareos bareos-database-mysql
6.- Install Bareos
6.- Install Bareos

4. Prepare Bareos database

The next step is to set up the Bareos database. In the installation files, Bareos has a series of databases ready for use. Let’s go for it.

:~# /usr/lib/bareos/scripts/create_bareos_database
:~# /usr/lib/bareos/scripts/make_bareos_tables
:~# /usr/lib/bareos/scripts/grant_bareos_privileges
7.- Preparing the dataases
7.- Preparing the dataases

Bareos uses the ports 9101 and 9103. So, you have to open the ports.

:~# firewall-cmd --add-port=9101/tcp --permanent
:~# firewall-cmd --add-port=9103/tcp --permanent
:~# firewall-cmd --reload
9.- Creating the firewall rules
9.- Creating the firewall rules

Next, start Bareos services.

:~# systemctl start bareos-dir
:~# systemctl start bareos-sd
:~# systemctl start bareos-fd
8.- start the bareos services
8.- start the bareos services

Next, start it with bconsole:

:~# bconsole
9.- bconsole
9.- bconsole

5. Install Bareos WebUI

In order to make the use of Bareos simpler, you need to install your web interface. To do this you need to install apache web server and PHP. So, let’s do it.

:~# yum install httpd php php-cli php-common
10.- Install apache and php
10.- Install apache and php

Remember to create a rule for apache in the firewall.

:~# firewall-cmd --add-service=http --permanent
:~# firewall-cmd --reload

Finally, enable the services:

:~# systemctl enable httpd
:~# systemctl start httpd
11.- Starting httpd service
11.- Starting httpd service

After that, install bareos web ui.

:~# yum install bareos-webui
12.- Install bareos web ui
12.- Install bareos web ui

Then, create a new file to access web UI.

:~# nano /etc/bareos/bareos-dir.d/console/admin.conf

And add the following:

 

# Restricted console used by bareos-webui
Console {
Name = admin
Password = “admin”
Profile = “webui-admin”
}
13.- Creating the user
13.- Creating the user

You can set the name and password you want.

Next, restart the service.

:~# systemctl restart bareos-dir
:~# systemctl restart bareos-sd
:~# systemctl restart bareos-fd

Finally, open the web browser and go to http://SERVER_IP/bareos-webui.

Bareos log in
Bareos log in

Log in and start to use it.

Conclusion

Bareos is a great application to backup data on a CentOS 7 server. For this, only a little time and some application commands are required.

Please share this article with your friends.

LEAVE A REPLY

Please enter your comment!
Please enter your name here