Bacula 13.0.4 on AWS User Guide
No longer open to new subscribers. The AWS Marketplace listing this guide was written for is closed to new subscriptions. If you already run it, your instances and this guide are unaffected. For what you can launch today, see Bacula.
Overview
This guide covers launching and using the Bacula 13.0.4 on Ubuntu 24.04 AMI from cloudimg on Amazon EC2. It is one version of the cloudimg backup and recovery listing on AWS Marketplace; you pick it as the software version when you subscribe and launch.
Bacula(R) is an open source, network based backup and recovery suite. A Director schedules and supervises jobs and keeps a catalog of every job, file and volume in a database; File Daemons (clients) read the data on each machine you protect; Storage Daemons write it to volumes on disk or tape; bconsole is the console you manage it all from.
The cloudimg image runs a complete single-node Bacula installation from the first minute:
- Everything on one instance. The Director, Storage Daemon, File Daemon and a PostgreSQL 16 catalog are installed and running. The instance backs itself up out of the box: the job
BackupClient1saves/usr/sbinevery night at 23:05 (full on the first Sunday, differential on the other Sundays, incremental Monday to Saturday) to file volumes in/var/lib/bacula/backups, andBackupCatalogbacks up the catalog afterwards. Use it to learn Bacula, then add your own servers. - Per-instance secrets, nothing baked in. First boot creates the instance's own PostgreSQL cluster and Bacula catalog, and generates new passwords for the Director, the Storage Daemon, the File Daemon, their monitors and the catalog database role. They are written into
/etc/bacula/*.confand listed in/root/bacula-credentials.txt(mode 0600). No password or database ships in the image; the daemons stay stopped until first boot has finished. - Loopback only by default. The Director (9101), File Daemon (9102), Storage Daemon (9103), PostgreSQL (5432) and the local mail service (25) listen on
127.0.0.1only. SSH is the only network listener until you deliberately open Bacula to your own clients (Step 10). - A self test for backup and restore.
sudo bacula-selftestruns a full backup, restores it into a private temporary directory and checks that the restored binaries are byte for byte identical to the originals. - Locked down. The Bacula, PostgreSQL and mail services are denied the instance metadata service (IPv4 and IPv6) and reserved address ranges; the AMI requires IMDSv2. The catalog accepts the
bacularole only, from loopback, with SCRAM-SHA-256. - Ubuntu's own packages. Bacula 13.0.4 is Ubuntu 24.04's
bacula13.0.4 packaging, unmodified, with PostgreSQL 16 from Ubuntu, on fully patched Ubuntu 24.04 LTS with unattended security upgrades switched on.
What is on the image: Bacula 13.0.4 (bacula-director, bacula-director-pgsql, bacula-sd, bacula-fd, bacula-console, bacula-common, bacula-common-pgsql), PostgreSQL 16 server and client, postfix for local delivery of job reports, Ubuntu 24.04 LTS, cloud-init and the AWS Systems Manager agent.
Default user: ubuntu · Architecture: x86_64 · Recommended instance type: m5.large
Prerequisites
- An AWS account subscribed to the listing, an EC2 key pair and a VPC subnet.
- A security group that allows TCP 22 (SSH) from your own networks only. Bacula needs no inbound port for the single-node setup.
- To back up other servers: those servers in a network this instance can reach, and enough disk for the volumes you keep. Size the root volume for that at launch, or add an EBS volume for the backups (Step 12).
Step 1: Launch the instance
In the AWS Marketplace listing choose Continue to Subscribe, then Continue to Configuration, pick Bacula 13.0.4 on Ubuntu 24.04 as the software version and your Region, then Launch through EC2. Choose m5.large, your key pair, a security group as above, and a root volume large enough for the backups you plan to keep.
With the AWS CLI (replace the values in angle brackets):
aws ec2 run-instances --region <region> --image-id <ami-id-from-the-listing> \
--instance-type m5.large --key-name <your-key-pair> \
--security-group-ids <your-security-group> --subnet-id <your-subnet> \
--block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=<size-in-GiB>,VolumeType=gp3}' \
--metadata-options HttpTokens=required,HttpEndpoint=enabled \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=bacula}]'
Step 2: Connect to your instance
| Version | SSH user |
|---|---|
| Bacula 13.0.4 on Ubuntu 24.04 | ubuntu |
ssh -i <your-key.pem> ubuntu@<public-ip>
Step 3: Check that Bacula is running
First boot takes a few seconds: it creates the PostgreSQL cluster and the Bacula catalog, generates the passwords and writes the configuration. Then the catalog and the three daemons are active:
systemctl is-active postgresql@16-main.service bacula-director.service bacula-sd.service bacula-fd.service
sudo test -f /var/lib/cloudimg/bacula-firstboot.done && echo FIRSTBOOT_DONE
active
active
active
active
FIRSTBOOT_DONE
Every Bacula port, the catalog and the mail service listen on loopback; SSH is the only network listener:
sudo ss -Htln | awk '{print $4}' | sort -u
0.0.0.0:22
127.0.0.1:25
127.0.0.1:5432
127.0.0.1:9101
127.0.0.1:9102
127.0.0.1:9103
127.0.0.53%lo:53
127.0.0.54:53
[::1]:25
[::]:22
Step 4: Read the instance details
/root/bacula-credentials.txt (root only, mode 0600) lists this instance's names and passwords. The same values are already in /etc/bacula/*.conf, so you need them only when you connect a remote console or client. To see which entries it holds without printing any password:
sudo grep -vE '^[[:space:]]*(#|$)' /root/bacula-credentials.txt | cut -d= -f1
BACULA_HOST_PRIVATE_IP
BACULA_DIRECTOR_NAME
BACULA_DIRECTOR_PASSWORD
BACULA_STORAGE_NAME
BACULA_STORAGE_PASSWORD
BACULA_FILEDAEMON_NAME
BACULA_FILEDAEMON_PASSWORD
BACULA_DB_NAME
BACULA_DB_USER
BACULA_DB_PASSWORD
To read one value when you need it (keep it out of shell history, tickets and chat):
sudo grep '^BACULA_DIRECTOR_PASSWORD=' /root/bacula-credentials.txt
Step 5: Open the console
bconsole connects to the Director with this instance's own console password from /etc/bacula/bconsole.conf. Run sudo bconsole for an interactive session (type help for the commands, quit to leave), or pipe commands into it:
printf 'status director\nquit\n' | sudo bconsole | sed -n '1,10p'
Connecting to Director 127.0.0.1:9101
1000 OK: 10002 bacula-dir Version: 13.0.4 (12 February 2024)
Enter a period to cancel a command.
status director
bacula-dir Version: 13.0.4 (12 February 2024) x86_64-pc-linux-gnu ubuntu 24.04
Daemon started 13-Nov-26 17:56, conf reloaded 13-Nov-2026 17:56:31
Jobs: run=0, running=0 mode=0,0
Crypto: fips=N/A crypto=OpenSSL 3.0.13 30 Jan 2024
Heap: heap=544,768 smbytes=339,179 max_bytes=340,793 bufs=407 max_bufs=418
Res: njobs=3 nclients=1 nstores=2 npools=3 ncats=1 nfsets=2 nscheds=2
status client and status storage show the File Daemon and the Storage Daemon the same way.
Step 6: Run a backup now
Start the self-backup job by hand and wait for it to finish:
printf 'run job=BackupClient1 level=Full yes\nwait\nmessages\nquit\n' | sudo bconsole | grep -E 'Job queued|Termination'
Job queued. JobId=4
Termination: Backup OK
List the jobs and the volumes they were written to:
printf 'list jobs\nlist volumes pool=File\nquit\n' | sudo bconsole | grep -E '^[|+]' | cut -c1-110
+-------+---------------+---------------------+------+-------+----------+------------+-----------+
| jobid | name | starttime | type | level | jobfiles | jobbytes | jobstatus |
+-------+---------------+---------------------+------+-------+----------+------------+-----------+
| 1 | BackupClient1 | 2026-11-13 17:55:56 | B | F | 633 | 35,788,645 | T |
| 4 | BackupClient1 | 2026-11-13 17:58:44 | B | F | 633 | 35,788,645 | T |
+-------+---------------+---------------------+------+-------+----------+------------+-----------+
+---------+------------+-----------+---------+------------+----------+--------------+---------+------+-----------+
| mediaid | volumename | volstatus | enabled | volbytes | volfiles | volretention | recycle | slot | inchanger |
+---------+------------+-----------+---------+------------+----------+--------------+---------+------+-----------+
| 1 | Vol-0001 | Append | 1 | 71,930,389 | 0 | 31,536,000 | 1 | 0 | 0 |
+---------+------------+-----------+---------+------------+----------+--------------+---------+------+-----------+
Status T means the job terminated normally. Volumes are labelled automatically (Vol-0001, Vol-0002, ...) as files in /var/lib/bacula/backups.
Step 7: Run the self test
bacula-selftest proves backup and restore end to end: a full backup of BackupClient1, a restore of that job into a fresh private directory under /var/lib/bacula/restores, and a byte-for-byte comparison of restored binaries with the originals. The restored copy is removed afterwards; the backup job stays in the catalog.
sudo bacula-selftest
bacula-selftest: backup job 11 restored by job 12 (484 files); restored binaries match the originals byte for byte
BACULA_SELFTEST_OK 11
Step 8: Restore files
Restores run from the console. This restores the newest successful BackupClient1 job into /var/lib/bacula/restores (Bacula recreates the original paths below it):
JOBID="$(printf 'list jobs\nquit\n' | sudo bconsole | awk -F'|' '$3 ~ /BackupClient1/ && $5 ~ /B/ && $9 ~ /T/ {id=$2} END {gsub(/ /, "", id); print id}')"
echo "restoring job ${JOBID}"
printf 'restore jobid=%s client=bacula-fd where=/var/lib/bacula/restores all done\nyes\nwait\nmessages\nquit\n' "${JOBID}" | sudo bconsole | grep -E 'Job queued|Termination'
sudo find /var/lib/bacula/restores/usr/sbin -maxdepth 1 -name 'bacula-*' | sort
restoring job 11
Job queued. JobId=13
Termination: Restore OK
/var/lib/bacula/restores/usr/sbin/bacula-console
/var/lib/bacula/restores/usr/sbin/bacula-dir
/var/lib/bacula/restores/usr/sbin/bacula-fd
/var/lib/bacula/restores/usr/sbin/bacula-sd
For an interactive restore, run sudo bconsole, type restore and follow the menu: choose the client, pick the most recent backup (option 5) or a point in time, mark the files with mark in the file tree, then done. Remove restored copies when you have checked them:
sudo rm -rf /var/lib/bacula/restores/usr
Step 9: Inspect the catalog
The catalog is the bacula database in the local PostgreSQL 16 cluster. Read it with bconsole (list jobs, list files jobid=<n>, list volumes) or directly in SQL as the postgres operating system user:
sudo -u postgres psql -X -d bacula -c 'SELECT jobid, name, type, level, jobstatus, jobfiles FROM job ORDER BY jobid'
jobid | name | type | level | jobstatus | jobfiles
-------+---------------+------+-------+-----------+----------
1 | BackupClient1 | B | F | T | 633
2 | RestoreFiles | R | F | T | 633
3 | BackupCatalog | B | F | T | 1
4 | BackupClient1 | B | F | T | 633
(4 rows)
Step 10: Back up your own servers
Each server you protect runs a File Daemon (bacula-fd), and this Director needs a Client and a Job for it. Because every daemon on this instance listens on loopback, opening Bacula to your network takes three deliberate changes. Use the instance's private address and keep the traffic inside your VPC or VPN; never open 9101 to 9103 to the internet.
- Listen on the private address. In
/etc/bacula/bacula-sd.confsetSDAddressto the instance's private IP (BACULA_HOST_PRIVATE_IPin the credentials file), and in/etc/bacula/bacula-dir.confset theAddressof theFile1andFile2storage resources to the same IP, so remote File Daemons can reach the Storage Daemon. Do the same forDirAddressonly if you will runbconsolefrom another machine. - Open the ports to your clients only. Add security group rules for TCP 9103 (Storage Daemon; and 9101 for a remote console) from your clients' security group or private CIDR. The Director connects out to each client on 9102, so the clients' security groups must allow 9102 from this instance.
- Add the client. Install
bacula-fdon the server, then add aClientandJobhere, with a strong password shared only between this Director and that client:
# On THIS instance, append to /etc/bacula/bacula-dir.conf:
Client {
Name = webserver-fd
Address = 10.0.1.20 # the server's private address
FDPort = 9102
Catalog = MyCatalog
Password = "<a-new-strong-password>" # e.g. the output of: openssl rand -hex 24
File Retention = 60 days
Job Retention = 6 months
AutoPrune = yes
}
Job {
Name = "Backup-webserver"
JobDefs = "DefaultJob"
Client = webserver-fd
}
# On the SERVER, in /etc/bacula/bacula-fd.conf, the Director resource must use this
# Director's name and the SAME password:
Director {
Name = bacula-dir
Password = "<a-new-strong-password>"
}
# ... and set FDAddress to the server's private address, then: sudo systemctl restart bacula-fd
Check the configuration and load it without restarting the Director:
sudo bacula-dir -t -c /etc/bacula/bacula-dir.conf && echo CONFIG_OK
printf 'reload\nquit\n' | sudo bconsole | tail -2
CONFIG_OK
reload
quit
After a change to bacula-sd.conf restart the Storage Daemon with sudo systemctl restart bacula-sd. Then status client=webserver-fd in bconsole proves the Director can reach the new client, and run job=Backup-webserver takes its first backup.
Step 11: Schedules, retention and job reports
The schedules are in /etc/bacula/bacula-dir.conf: WeeklyCycle (full on the first Sunday, differential on the other Sundays, incremental Monday to Saturday, all at 23:05) drives BackupClient1, and WeeklyCycleAfterBackup runs BackupCatalog at 23:10. The File pool recycles volumes after 365 days, caps each volume at 50 GB and keeps at most 100 volumes; change Volume Retention, Maximum Volume Bytes and Maximum Volumes there to suit your storage.
Job reports go to the local root mailbox through postfix, which accepts mail on loopback only. Read them with sudo cat /var/mail/root, or relay them to your mail system by setting relayhost in /etc/postfix/main.cf. Every message also lands in /var/log/bacula/bacula.log:
sudo tail -n 3 /var/log/bacula/bacula.log
13-Nov 18:03 bacula-dir JobId 14: No Files found to prune.
13-Nov 18:03 bacula-dir JobId 14: End auto prune.
Step 12: Store backups on their own volume
For production, keep the volumes on a dedicated EBS volume rather than the root disk. Attach a gp3 volume, create a filesystem on it, mount it at /var/lib/bacula/backups through /etc/fstab (by UUID, with nofail), and run sudo chown bacula:bacula /var/lib/bacula/backups && sudo chmod 0750 /var/lib/bacula/backups. Take EBS snapshots of that volume, or copy the volumes to another Region, so a copy of your backups lives outside the instance.
Step 13: Check the security posture
The Bacula daemons, PostgreSQL and postfix are denied the instance metadata service and reserved address ranges through systemd drop-ins:
for u in bacula-director bacula-sd bacula-fd postgresql@16-main postfix@-; do printf '%s: ' "$u"; systemctl show -p IPAddressDeny --value "$u.service"; done
bacula-director: 198.18.0.0/15 224.0.0.0/4 240.0.0.0/4 fd00:ec2::254/128 169.254.169.254/32 168.63.129.16/32 192.0.0.0/24
bacula-sd: 168.63.129.16/32 240.0.0.0/4 169.254.169.254/32 fd00:ec2::254/128 192.0.0.0/24 224.0.0.0/4 198.18.0.0/15
bacula-fd: 192.0.0.0/24 169.254.169.254/32 fd00:ec2::254/128 198.18.0.0/15 168.63.129.16/32 240.0.0.0/4 224.0.0.0/4
postgresql@16-main: fd00:ec2::254/128 224.0.0.0/4 168.63.129.16/32 192.0.0.0/24 240.0.0.0/4 198.18.0.0/15 169.254.169.254/32
postfix@-: fd00:ec2::254/128 240.0.0.0/4 168.63.129.16/32 224.0.0.0/4 192.0.0.0/24 169.254.169.254/32 198.18.0.0/15
The catalog admits local operating system users by peer authentication and the bacula role to the bacula database from loopback only:
sudo grep -vE '^[[:space:]]*(#|$)' /etc/postgresql/16/main/pg_hba.conf
local all all peer
host bacula bacula 127.0.0.1/32 scram-sha-256
host bacula bacula ::1/128 scram-sha-256
The configuration files that hold passwords are readable by root and the bacula group only, and the credentials file by root only:
sudo stat -c '%a %U:%G %n' /etc/bacula/bacula-dir.conf /etc/bacula/bacula-sd.conf /etc/bacula/bacula-fd.conf /etc/bacula/bconsole.conf /root/bacula-credentials.txt
640 root:bacula /etc/bacula/bacula-dir.conf
640 root:bacula /etc/bacula/bacula-sd.conf
640 root:root /etc/bacula/bacula-fd.conf
640 root:bacula /etc/bacula/bconsole.conf
600 root:root /root/bacula-credentials.txt
Step 14: Server components
| Component | Path |
|---|---|
| Director, Storage Daemon, File Daemon | /usr/sbin/bacula-dir, /usr/sbin/bacula-sd, /usr/sbin/bacula-fd |
| Console | /usr/sbin/bconsole (/etc/bacula/bconsole.conf) |
| Configuration | /etc/bacula/bacula-dir.conf, bacula-sd.conf, bacula-fd.conf |
| Volumes and restores | /var/lib/bacula/backups, /var/lib/bacula/restores |
| Catalog | PostgreSQL 16 cluster 16/main, database bacula |
| Logs | /var/log/bacula/bacula.log, journalctl -u bacula-director -u bacula-sd -u bacula-fd |
| Service units | bacula-director.service, bacula-sd.service, bacula-fd.service (packaged), bacula-firstboot.service, with cloudimg drop-ins in /etc/systemd/system/<unit>.d/ |
| Helpers | /usr/local/sbin/bacula-selftest |
| Licence and provenance | /usr/share/doc/bacula-common/copyright, /usr/share/doc/cloudimg-bacula/BUILD-PROVENANCE.txt |
dpkg-query -W -f '${Package} ${Version}\n' bacula-director bacula-director-pgsql bacula-sd bacula-fd bacula-console bacula-common postgresql-16
{ bacula-dir -? 2>&1 || true; } | grep Version
bacula-common 13.0.4-1build3
bacula-console 13.0.4-1build3
bacula-director 13.0.4-1build3
bacula-director-pgsql 13.0.4-1build3
bacula-fd 13.0.4-1build3
bacula-sd 13.0.4-1build3
postgresql-16 16.15-0ubuntu0.24.04.1
Version: 13.0.4 (12 February 2024)
Step 15: Security recommendations
- Allow port 22 in the security group from your own networks only. Open the Bacula ports (9101 to 9103) only to your clients' private addresses or security groups, never to the internet.
- Give every client its own strong password, and keep
/etc/bacula/*.confat mode 0640 and the credentials file at 0600. - Consider Bacula's TLS directives (
TLS Enable,TLS Require, certificates per daemon) for traffic that leaves this instance, and its data encryption (PKI Encryption) on clients whose data must be encrypted at rest in the volumes. - Keep a copy of your backups off the instance (Step 12), and run
sudo bacula-selftestafter configuration changes. - Keep the operating system patched: unattended security upgrades are on, and
sudo apt-get update && sudo apt-get upgradeapplies everything else.
Support and licensing
Bacula is open source under the GNU Affero General Public License version 3 (AGPL-3.0) with the additional permissions and terms in Bacula's LICENSE file, which allow linking with OpenSSL. PostgreSQL is under the PostgreSQL licence. There is no per user or per CPU licence fee. The licence texts are in /usr/share/doc/bacula-common/copyright. The image ships Ubuntu's Bacula 13.0.4 packages unmodified; the corresponding source is the Ubuntu source package bacula 13.0.4-1build3 (Launchpad), and /usr/share/doc/cloudimg-bacula/BUILD-PROVENANCE.txt shows how to fetch it with apt-get source.
Bacula(R) is a registered trademark of Kern Sibbald. cloudimg is not affiliated with or endorsed by Kern Sibbald, Bacula Systems or the PostgreSQL Global Development Group. The AMI price covers cloudimg's hardening, first boot setup and support.
- Email: support@cloudimg.co.uk
- Website: https://www.cloudimg.co.uk
- Support: 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours