How to Install Bareos on Debian Latest

In this tutorial, we will guide you on how to install Bareos on Debian latest release. Bareos is an open-source network backup solution suitable for enterprise-level backups.

Before we begin, let’s make sure our Debian system is up-to-date with the following command:

sudo apt update && sudo apt upgrade

Step 1: Add Bareos Repository

To add the Bareos repository to the Debian system, perform the following steps:

sudo apt -y install lsb-release

sudo echo "deb https://download.bareos.org/bareos/release/latest/Debian_$ (lsb_release -cs)/" > /etc/apt/sources.list.d/bareos.list

curl https://download.bareos.org/bareos/release/latest/Debian_$ (lsb_release -cs)/Release.key | sudo apt-key add -

Step 2: Install Bareos Packages

Now we will install the bareos packages using the below command:

sudo apt update && sudo apt install bareos bareos-filedaemon bareos-webui bareos-database-postgresql -y

Step 3: Configure Bareos

The main configuration file of Bareos is located at /etc/bareos/bareos-dir.conf. Open the file using the text editor of your choice and modify according to your settings. Here is a sample configuration:

Director {
  Name = bareos-dir
  DIRport = 9101
  QueryFile = "/usr/lib/bareos/scripts/query.sql"

  JobRetention = 6 months
  Schedule = "WeeklyCycle"
  Messages = Daemon
  Password = "yourpassword"
  JobDefs = "DefaultJob"
  Storage = File
  Catalog = MyCatalog
  AutomaticMount = yes
}

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = bareos-fd
  FileSet = "/etc/bareos/bareos-dir.conf"
  Schedule = "WeeklyCycle"
  Storage = File
  Messages = Standard
  Pool = Default
  Priority = 10
  Write Bootstrap = "/var/lib/bareos/%c.bsr"
}

Client {
  Name = bareos-fd
  Address = localhost
  Password = "yourpassword"
  File Retention = 6 months
  Job Retention = 6 months
}

FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
    }
    File = "/"
  }
  Exclude {
    File = "/var/lib/bareos"
    File = "/var/cache/bareos"
    File = "/var/log/bareos"
    File = "/var/run/bareos"
    File = "/etc/bareos/bareos-fd.d"
    File = "/proc"
    File = "/tmp"
    File = "/sys"
    File = "/dev"
    File = "/mnt"
    File = "/media"
    File = "/lost+found"
  }
}

Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6 months
  Maximum Volume Jobs = 1
  Maximum Volume Bytes = 50G
}

Storage {
  Name = File
  Address = localhost
  SDPort = 9103
  Password = "yourpassword"
  Device = FileStorage
  Media Type = File
}

Catalog {
  Name = MyCatalog
  catalog Name = dbi:postgresql:bareos
  dbuser = postgres
  dbpassword = yourpassword
  dbaddress = localhost
}

In this sample configuration, we have defined the director, job, and client configurations. We have also defined the fileset, pool, storage, and catalog configurations. Make sure to save the changes once you have modified the configuration accordingly.

Step 4: Start Bareos Services

After configuring Bareos, we need to start the bareos service using the below command:

sudo systemctl start bareos-dir

We started the Bareos director using the above command. Similarly, we can start the bareos-storage, bareos-filedaemon, and bareos-webui services with the following commands:

sudo systemctl start bareos-storage

sudo systemctl start bareos-filedaemon

sudo systemctl start bareos-webui

Step 5: Verify Bareos Installation

We have successfully installed and configured Bareos on Debian. To verify that it is working correctly, we can use the following command to check the status of Bareos:

sudo bareos-dir -t

This command will perform a configuration test of the Bareos director daemon.

Conclusion

In this tutorial, we walked through the step-by-step instructions on how to install Bareos on Debian latest. We also configured Bareos, started the Bareos services, and verified that Bareos is working as expected.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!