RU | EN | DE

Below are working instructions for Bareos Server on Ubuntu 24.04 in the “everything on one server” option: Bareos Director + Bareos Storage Daemon + локальный File Daemon + PostgreSQL. This is the official script for Debian/Ubuntu: add Bareos repository, install packages, prepare PostgreSQL catalog and start services. For a new deployment, Bareos recommends PostgreSQL as the main backend; the bareos package is a metapackage, and the PostgreSQL server itself must be installed separately.

1. Preparing the system

sudo apt update  
sudo apt full-upgrade -y  
sudo apt install -y wget curl gnupg ca-certificates lsb-release postgresql  
sudo systemctl enable --now postgresql

2. Adding the official Bareos repository

For Ubuntu 24.04, Bareos has a ready-made helper script add_bareos_repositories.sh in the current/xUbuntu_24.04/ repository. The script creates a key in /etc/apt/keyrings/ and a repository file in /etc/apt/sources.list.d/bareos.sources.

cd /tmp  
wget https://download.bareos.org/current/xUbuntu_24.04/add_bareos_repositories.sh  
chmod +x add_bareos_repositories.sh  
sudo ./add_bareos_repositories.sh  
sudo apt update

3. Installing Bareos

sudo apt install -y bareos bareos-database-postgresql

On Debian/Ubuntu, Bareos packages support dbconfig-common, meaning the PostgreSQL directory can be created directly during installation through the package dialogs. The official documentation specifically recommends following these steps in the installer on Ubuntu/Debian.

In practice, I advise this:

  • if the installer asks whether to configure the database via dbconfig-common - agree;
  • database type - PostgreSQL;
  • if the automatic setup did not work or you chose No, then do the manual initialization as the next step.

4. Manual initialization of catalog if autotuning did not work

The official Bareos scripts for PostgreSQL are located in /usr/lib/bareos/scripts/. For Linux, the documentation gives exactly these three steps: create a database, create tables and grant privileges.

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

5. Launching and enabling services

On Ubuntu/Debian, the service names are: bareos-director, bareos-storage, bareos-filedaemon. Official Bareos ports are 9101, 9102, 9103.

sudo systemctl enable --now bareos-director.service  
sudo systemctl enable --now bareos-storage.service  
sudo systemctl enable --now bareos-filedaemon.service

Examination:

sudo systemctl status bareos-director bareos-storage bareos-filedaemon --no-pager

6. Checking the configuration

After installation, it is convenient to immediately check the configuration using the -t key. This is the official way to see configuration errors and warnings.

sudo su - bareos -s /bin/sh -c "bareos-dir -t"  
sudo su - bareos -s /bin/sh -c "bareos-sd -t"  
sudo bareos-fd -t

If everything here is without fatal errors, the database and configs are generally fine.

7. First check via bconsole

sudo bconsole

In the console:

status dir

The status dir command displays Director status, schedule, and recent jobs. This is the standard method for the first check after installation.

To run the first backup:

run

Most likely, Bareos will offer jobs like backup-bareos-fd, BackupCatalog, RestoreFiles. For the first test, we usually run backup-bareos-fd. In the standard configuration, backups are written to disk in /var/lib/bareos/storage/.

8. Where are the main files located?

The base configuration path for Bareos packages on Linux is /etc/bareos/. Bareos scripts are located in /usr/lib/bareos/scripts/, and the default file storage is /var/lib/bareos/storage/.

The most useful places after installation:

/etc/bareos/  
/etc/bareos/bareos-dir.d/  
/etc/bareos/bareos-sd.d/  
/etc/bareos/bareos-fd.d/  
/usr/lib/bareos/scripts/  
/var/lib/bareos/storage/  
/var/log/bareos/bareos.log

9. Firewall and security

Bareos is a network product, and the documentation recommends blocking external users from accessing the 9101–9103 ports, as well as limiting access to configs, because they contain sensitive parameters. Daemon passwords are not transmitted in clear text, CRAM-MD5 is used, but the configs themselves still need to be protected with access rights.

If you use ufw and plan to connect clients only from the local network:

sudo ufw allow from 192.168.0.0/16 to any port 9101 proto tcp  
sudo ufw allow from 192.168.0.0/16 to any port 9102 proto tcp  
sudo ufw allow from 192.168.0.0/16 to any port 9103 proto tcp  
sudo ufw reload

10. Optional: installing Bareos WebUI

WebUI is installed as a separate package. It is important that the WebUI version matches the Director version. For Ubuntu/Debian the package is called bareos-webui. After installation, you need to restart Apache and create a Console user to log into WebUI.

sudo apt install -y bareos-webui apache2  
sudo systemctl restart apache2  
sudo bconsole

In bconsole:

reload  
configure add console name=admin password=StrongWebUiPass_2026! profile=webui-admin tlsenable=false

After that, open the server address with the path /bareos-webui and log in as the user admin.

11. What is important not to forget after installation

Do not disable job BackupCatalog: in the Bareos documentation it is considered mandatory protection against loss of the directory and configuration itself. It is this that helps to quickly restore the backup server itself after a disaster.

12. Short checklist of results

If everything was installed correctly, then you should have something like this:

sudo systemctl is-active postgresql  
sudo systemctl is-active bareos-director  
sudo systemctl is-active bareos-storage  
sudo systemctl is-active bareos-filedaemon

And all commands should return:

active

Plus:

sudo bconsole

and inside:

status dir

should open without errors connecting to catalog.

13. Ports

If we are talking about Bareos, then the standard ports are:

  • 9101/TCP - Director (bareos-dir), bconsole is usually connected here
  • 9102/TCP - File Daemon (bareos-fd)
  • 9103/TCP - Storage Daemon (bareos-sd)

Usually the most important thing to open is:

  • DIR → FD : 9102/TCP
  • DIR → SD : 9103/TCP
  • FD → SD : 9103/TCP
    or SD → FD : 9102/TCP if passive client is used.