We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install and Use Bareos Backup Solution on Debian 11|Debian 10

Learn how to – Install and Use Bareos Backup Solution on Debian 11|Debian 10.

The term Bareos is an acronym for “Backup Archiving Recovery Open Sourced“. This is a free and open-source fork of the open-source project Bacula version 5.2. It allows system administrators to manage backup, recovery as well as verify the system’s data across the network. Bareos is simple and efficient in that it offers more advanced data management features and makes it easy to trace and recover damaged files.

The Bareos Backup Solution is made up of the following components:

  • Bareos Director – This is the central program which manages and supervises all the backup, restore e.t.c. It also schedules data backups and recoveries.
  • Bareos Console – It allows the interaction between the user and the Bareos Director through a sheel window such as TTY.
  • Bareos File Daemon – This is installed on each client for backups to happen. It finds data to be backed up and send it to the Bareos storage upon request by the Bareos Director.
  • Bareos Storage Daemon – It stores data send from the Bareos File Daemon to a physical backup media/volume. There can be several of them on a single environment, all controlled by a single Bareos Director.
  • Catalog – This consists of a number of programs with the duty of storing file indexes and volume databases for all the backed up files

The diagram below shows the interaction between the Bareos components:

Among the amazing features associated with Bareos are:

  • Supports hardware encryption with LTO.
  • Supports client-quota.
  • Supports native NDMP.
  • Bareos has a built-in Job scheduler.
  • Multi-Operating System Support
  • Advanced Support for most Storage Devices
  • Supports VMware plugin to backup VMware disk image.
  • Fileset shadowing deduplication.
  • Bandwidth limitation.
  • It has several GUI administrative interfaces as well as a comprehensive shell administrative interface, which allows the administrator to use tools such as ssh to administrate any part of Bareos from anywhere.
  • Advanced Volume and Pool Management
  • Gluster and Ceph plugins to backup cloud storages
  • Supports LDAP Plugin to backup LDAP directories
  • Advanced security with CRAM-MD5 password authentication, Configurable TLS (SSL), Computation of MD5 or SHA1 signatures e.t.c
  • Automatic pruning of the database (removal of old records) thus simplifying database administration.
  • The modular but integrated design makes Bareos very scalable.

With the above feature set, Bareos Backup Solution qualifies to be the best and most simple method to manage your backups. This guide aims at demonstrating how to install and use Bareos Backup Solution on Debian 11 / Debian 10.

Prepare your Server

Before we plunge in, it is recommended that all your system packages are updated to their latest stable versions using the APT command below.

sudo apt-get update && sudo apt upgrade

Once the process is complete, proceed as below.

Step 1 – Add the Bareos Repository on Debian 11 / Debian 10

Normally, the Bareos Backup Solution is not available in the default Debian 11 / Debian 10 repositories. To be able to install it, we need to add the repository to our system as below.

Export the distribution.

##On Debian 11##
DIST=Debian_11
RELEASE=experimental/nightly
#RELEASE=release/21
URL=https://download.bareos.org/bareos/$RELEASE/$DIST

##On Debian 10##
DIST=Debian_10
RELEASE=experimental/nightly
#RELEASE=release/21
URL=https://download.bareos.org/bareos/$RELEASE/$DIST

Now add the below repository to the /etc/apt/sources.list.d/

sudo wget -O /etc/apt/sources.list.d/bareos.list $URL/bareos.list

Once added, import the GPG signing key.

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

Update your APT package index.

sudo apt update

Step 2 – Install Bareos Backup Solution on Debian 11 / Debian 10

Once the repository is added successfully, we can easily install Bareos Backup Solution on Debian 11 / Debian 10.

We will use the below APT command to install Bareos packages.

sudo apt install postgresql postgresql-contrib bareos bareos-database-postgresql

On the following screen, use the database-config-common to configure the Bareos database.

Proceed and select the PostgreSQL database server.

Set the PostgreSQL Bareos database password.

Confirm the set password.

Once the installation is complete, Bareos configurations are stored in the /etc/bareos/ and can be viewed as below.

$ ls /etc/bareos/
bareos-dir.d  bareos-dir-export  bareos-fd.d  bareos-sd.d  bconsole.conf

Step 3 – Install the Bareos Web Interface on Debian

The Bareos web interface makes it easy to manage Bareos operations. This interface is written in PHP based on the Zend Framework. From its dashboard, all backups and restores can be done.

The Bareos web interface can be installed on Debian 11 / Debian 10 using the command:

sudo apt install bareos-webui

Dependency tree:

The following additional packages will be installed:
  apache2 apache2-data apache2-utils libapache2-mod-php libapache2-mod-php7.4
  php-common php-curl php-date php-intl php7.4-cli php7.4-common php7.4-curl
  php7.4-intl php7.4-json php7.4-opcache php7.4-readline
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear
The following NEW packages will be installed:
  apache2 apache2-data apache2-utils bareos-webui libapache2-mod-php
  libapache2-mod-php7.4 php-common php-curl php-date php-intl php7.4-cli
  php7.4-common php7.4-curl php7.4-intl php7.4-json php7.4-opcache
  php7.4-readline
0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,065 kB of archives.
After this operation, 38.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

The above command installs the Apache web server, PHP, and its extensions. Once complete, reload the Apache daemon.

sudo systemctl reload apache2

Now start the Bareos services as below.

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

Confirm the status of the services:

$ systemctl status bareos-dir bareos-sd bareos-fd
 bareos-director.service - Bareos Director Daemon service
     Loaded: loaded (/lib/systemd/system/bareos-director.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-01-22 04:16:40 EST; 14s ago
       Docs: man:bareos-dir(8)
   Main PID: 14947 (bareos-dir)
      Tasks: 4 (limit: 7075)
     Memory: 2.1M
        CPU: 17ms
     CGroup: /system.slice/bareos-director.service
             └─14947 /usr/sbin/bareos-dir -f

 bareos-storage.service - Bareos Storage Daemon service
     Loaded: loaded (/lib/systemd/system/bareos-storage.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-01-22 04:16:44 EST; 11s ago
       Docs: man:bareos-sd(8)
   Main PID: 14956 (bareos-sd)
      Tasks: 2 (limit: 7075)
     Memory: 1.1M
        CPU: 7ms
     CGroup: /system.slice/bareos-storage.service
             └─14956 /usr/sbin/bareos-sd -f

 bareos-filedaemon.service - Bareos File Daemon service
     Loaded: loaded (/lib/systemd/system/bareos-filedaemon.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-01-22 04:16:47 EST; 8s ago
       Docs: man:bareos-fd(8)
   Main PID: 14963 (bareos-fd)
      Tasks: 2 (limit: 7075)
     Memory: 932.0K
        CPU: 5ms
     CGroup: /system.slice/bareos-filedaemon.service
             └─14963 /usr/sbin/bareos-fd -f

Step 4 – Create the Bareos Admin User

To be able to access the web UI, you need to create a Bareos admin user. We will do so from the Bareos console, accessed as below:

$ sudo bconsole
Connecting to Director localhost:9101
 Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
1000 OK: bareos-dir Version: 21.0.0 (21 December 2021)
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.
*

Now run the command below to create an admin user. Remember to change the name and password for the user if need to.

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

Sample Output:

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

Exit the Bareos console.

exit

Now the next step requires us to disable TLS by editing the created file.

sudo vim /etc/bareos/bareos-dir.d/console/admin.conf

In the file, set TLS Enable = No.

Console {
  Name = "admin"
  Password = "Passw0rd"
  Profile = webui-admin
TLS Enable = No
}

Save the file and restart Bareos services.

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

Step 5 – Access the Bareos Web Interface

Once everything has been configured as above, we can proceed and access the Bareos web UI using the URL http://IP_address/bareos-webui or http://domain_name/bareos-webui

You should see the Bareos login window below.

Provide the set admin user credentials to login. On successful authentication, you will see the below dashboard.

Now here, you can easily make backups and restores. For example, to take a backup, navigate to Jobs ->Run as below and set the client to take a backup on.

Once the required settings are made, submit your job, and it will start with a job ID assigned. You can view the status of this job as below.

You can also perform a data restore using the backup made as below. Remember to select the file location, client, and backup file.

The restore will be assigned a job ID as well.

View the status of the job.

All these tasks can also be done on the Bareos console.

## Access the console
sudo bconsole

## reload console
* reload

## show filesets
* show filesets

## show dir status
* status dir

## show client status
* status client

## show storage
* status storage

## run a backup job
* run

## show messages (show only one time per job)
* message

## show job per ID and wait to be finished
* wait jobid=1

## restore all > all files are market to restore
 * restore all

## restore > manually mark/unmark files to restore
* restore

## if a restore fails you can re-try
* rerun jobid=1

The end!

We have successfully installed Bareos Backup Solution on Debian 11 | Debian 10. Furthermore, we have also gone through how to make a simple data backup and restore using Bareos. I hope you managed too.

Related posts:

Cart

Your Cart is Empty

Back To Shop