# Bacula Installation and Configuration Guide for Ubuntu 24.04 ## 1. Introduction This guide provides step-by-step instructions for installing and configuring Bacula on Ubuntu 24.04. The configuration files will be moved to a custom directory: `/opt/calypso/conf/bacula`. ## 2. Installation First, update the package lists and install the Bacula components and a PostgreSQL database backend. ```bash sudo apt-get update sudo apt-get install -y bacula-director bacula-sd bacula-fd postgresql ``` During the installation, you may be prompted to configure a mail server. You can choose "No configuration" for now. ### 2.1. Install Bacula Console Install the Bacula console, which provides the `bconsole` command-line utility for interacting with the Bacula Director. ```bash sudo apt-get install -y bacula-console ``` ## 3. Database Configuration Create the Bacula database and user. ```bash sudo -u postgres createuser -P bacula sudo -u postgres createdb -O bacula bacula ``` When prompted, enter a password for the `bacula` user. You will need this password later. Now, grant privileges to the `bacula` user on the `bacula` database. ```bash sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE bacula TO bacula;" ``` Bacula provides scripts to create the necessary tables in the database. ```bash sudo /usr/share/bacula-director/make_postgresql_tables.sql | sudo -u postgres psql bacula ``` ## 4. Configuration File Migration Create the new configuration directory and copy the default configuration files. ```bash sudo mkdir -p /opt/calypso/conf/bacula sudo cp /etc/bacula/* /opt/calypso/conf/bacula/ sudo chown -R bacula:bacula /opt/calypso/conf/bacula ``` ## 5. Systemd Service Configuration Create override files for the `bacula-director` and `bacula-sd` services to point to the new configuration file locations. ### 5.1. Bacula Director ```bash sudo mkdir -p /etc/systemd/system/bacula-director.service.d sudo bash -c 'cat > /etc/systemd/system/bacula-director.service.d/override.conf < /etc/systemd/system/bacula-sd.service.d/override.conf < /etc/systemd/system/bacula-fd.service.d/override.conf <