Wednesday, July 3, 2024
HomeOperating SystemsUbuntuInstall Bareos backup Tool on Ubuntu 20.04|18.04

Install Bareos backup Tool on Ubuntu 20.04|18.04

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.

Update and upgrade your system before you begin Bareos installation on Ubuntu 20.04|18.04:

sudo apt update
sudo apt upgrade -y

After a successful upgrade, it is good to reboot the system:

sudo reboot

Install Bareos Backup Solution on Ubuntu 20.04|18.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.

Ubuntu 20.04:

DIST=xUbuntu_20.04
RELEASE=experimental/nightly
#RELEASE=release/21
URL=https://download.bareos.org/bareos/$RELEASE/$DIST
sudo wget -O /etc/apt/sources.list.d/bareos.list $URL/bareos.list

Ubuntu 18.04:

DIST=xUbuntu_18.04
RELEASE=experimental/nightly
#RELEASE=release/21
URL=https://download.bareos.org/bareos/$RELEASE/$DIST
sudo wget -O /etc/apt/sources.list.d/bareos.list $URL/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 bareos postgresql bareos-database-postgresql

Accept to begin installation by pressing y key in your keyboard:

....
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  bareos-bconsole bareos-client bareos-common bareos-database-common bareos-database-tools bareos-director bareos-filedaemon bareos-storage bareos-tools bsd-mailx dbconfig-common dbconfig-pgsql
  libjansson4 libllvm10 liblockfile-bin liblockfile1 libpq5 libsensors-config libsensors5 postfix postgresql-12 postgresql-client-12 postgresql-client-common postgresql-common ssl-cert sysstat
Suggested packages:
  bareos-traymonitor lm-sensors procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre postfix-lmdb postfix-sqlite sasl2-bin | dovecot-common resolvconf postfix-cdb postfix-doc
  postgresql-doc postgresql-doc-12 libjson-perl openssl-blacklist isag
The following NEW packages will be installed:
  bareos bareos-bconsole bareos-client bareos-common bareos-database-common bareos-database-postgresql bareos-database-tools bareos-director bareos-filedaemon bareos-storage bareos-tools bsd-mailx
  dbconfig-common dbconfig-pgsql libjansson4 libllvm10 liblockfile-bin liblockfile1 libpq5 libsensors-config libsensors5 postfix postgresql postgresql-12 postgresql-client-12
  postgresql-client-common postgresql-common ssl-cert sysstat
0 upgraded, 29 newly installed, 0 to remove and 0 not upgraded.
Need to get 34.2 MB of archives.
After this operation, 134 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

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

install bareos ubuntu 01

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

install bareos on ubuntu postgresql 01

Select database hostname – in this setup it is internal (localhost)

install bareos on ubuntu postgresql 02

Set bareos database password.

install bareos on ubuntu postgresql 03

Confirm the password to finish installation.

install bareos on ubuntu postgresql 04

Optionally set application password or use autogenerated.

install bareos on ubuntu postgresql 05

A successful installation should look like below.

....
dbc_postinst_cleanup() .
dbc_forget_dbadmin_password() .
dbconfig-common: flushing administrative password
dbc_forget_app_password() .
Warning: failed to find config for component "bareos-dir".
Warning: failed to find config for component "bareos-dir".
Warning: failed to find config for component "bareos-dir".
Setting up bareos-database-tools (22.0.0~pre27.402cd1616-1240) ...
Setting up bareos-director (22.0.0~pre27.402cd1616-1240) ...
  Address = XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX                # N.B. Use a fully qualified name here (do not use "localhost" here).
replacing 'XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX' with 'ubuntu-20-04-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
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.
Setting up bareos (22.0.0~pre27.402cd1616-1240) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for rsyslog (8.2001.0-1ubuntu1.1) ...
Processing triggers for ufw (0.36-6ubuntu1) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...

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

Install Bareos Web UI on Ubuntu 20.04|18.04

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 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

Checking the status of 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 Mon 2022-01-17 13:24:33 UTC; 35s ago
       Docs: man:bareos-dir(8)
   Main PID: 15481 (bareos-dir)
      Tasks: 4 (limit: 4677)
     Memory: 2.1M
     CGroup: /system.slice/bareos-director.service
             └─15481 /usr/sbin/bareos-dir -f

Jan 17 13:24:33 ubuntu-20-04-01 systemd[1]: Started Bareos Director Daemon service.

 bareos-storage.service - Bareos Storage Daemon service
     Loaded: loaded (/lib/systemd/system/bareos-storage.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-01-17 13:24:33 UTC; 35s ago
       Docs: man:bareos-sd(8)
   Main PID: 15482 (bareos-sd)
      Tasks: 2 (limit: 4677)
     Memory: 1.3M
     CGroup: /system.slice/bareos-storage.service
             └─15482 /usr/sbin/bareos-sd -f

Jan 17 13:24:33 ubuntu-20-04-01 systemd[1]: Started Bareos Storage Daemon service.

 bareos-filedaemon.service - Bareos File Daemon service
     Loaded: loaded (/lib/systemd/system/bareos-filedaemon.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-01-17 13:24:33 UTC; 35s ago
       Docs: man:bareos-fd(8)
   Main PID: 15495 (bareos-fd)
      Tasks: 2 (limit: 4677)
     Memory: 984.0K
     CGroup: /system.slice/bareos-filedaemon.service
             └─15495 /usr/sbin/bareos-fd -f

Jan 17 13:24:33 ubuntu-20-04-01 systemd[1]: Started Bareos File Daemon service.

Create console user

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

$ sudo bconsole
Connecting to Director localhost:9101
 Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
1000 OK: bareos-dir Version: 22.0.0~pre27.402cd1616 (13 January 2022)
pre-release version binary
pre-release versions are UNSUPPORTED.
Get a released version 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 tlsenable=false

Replace admin with your desired username and StrongPassword with its password. Then reload and exit

*reload
reloaded
*exit

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.

install bareos ubuntu 05

Login with user created earlier and password.

Username: admin
Password: StrongPassword

See below screenshot

install bareos on ubuntu postgresql 06

Once you’re logged in, you should see a page similar to one shown here.

install bareos on ubuntu postgresql 07

For configuration and usage, refer to official Documentation.

Similar guides:

Nicole Veronica Rubhabha
Nicole Veronica Rubhabha
A highly competent and organized individual DotNet developer with a track record of architecting and developing web client-server applications. Recognized as a personable, dedicated performer who demonstrates innovation, communication, and teamwork to ensure quality and timely project completion. Expertise in C#, ASP.Net, MVC, LINQ, EF 6, Web Services, SQL Server, MySql, Web development,
RELATED ARTICLES

Most Popular

Recent Comments