Skip to main content
Version: 9.x

Install using Docker

Available since v8.7.0

Requirements

  • docker installed and properly configured, and docker compose addon installed
  • your user is a member of the docker group (or you're allowed to run the sudo command)

Available tags

tagdescription
latestLatest release
nightly-9.xNightly build from branch dev-9.x
v<version>Released version (example: v9.9.0)

Supported architectures

  • linux/amd64
  • linux/arm64

Getting started

Prepare the configuration

Create a bacula-web folder and move into it

mkdir ~/bacula-web && cd bacula-web

Download the config.php.sample PHP config file.

curl -L https://raw.githubusercontent.com/bacula-web/bacula-web/master/application/config/config.php.sample > config.php

Configure Bacula director catalog database

Mandatory

Configure at least one Bacula director database connection to the 'config.php` file and update the other settings if needed.

For more details, refer to the General Configuration or Bacula Catalog Database Connection sections.

tip

You can also use the application/config/config.php if you've previously installed Bacula-Web on another server and want to keep the same configuration.

Authentication

In order to authenticate users, you need to

  • create an SQLite database file (stored in application/assets/protected/application.db) to store users' credentials and details
  • create your first user
tip

Additional users can be created using the web UI after setup is complete.

Create a directory named protected in the current working directory.

mkdir protected

Create the users database and first user

docker run --rm -it -u www-data \
-v $PWD/protected:/var/www/html/application/assets/protected \
baculaweb/bacula-web:latest php bwc setupauth
Output example
It's now time to set up the application back-end database
[Important!] Please note that all information stored in the user database will be destroyed
Can we proceed ?
[0] yes
[1] no
> 0
You have selected: yes
Deleting the users' authentication database
Creating database schema
Database created
User creation
Username: admin
Email: admin@acme.net
Password:
User created successfully
You can now connect to your Bacula-Web instance using the provided credentials.

After providing all the necessary information, the SQLite database and the new user should be created.

Start the container

Using Docker Compose

The easiest way to use the Bacula-Web Docker image is by using Docker Compose

Create a docker-compose.yml file in the current directory.

docker-compose.yml
services:
bacula-web:
image: baculaweb/bacula-web:latest
container_name: "bacula-web"
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ${PWD}/config.php:/var/www/html/application/config/config.php
- ${PWD}/protected:/var/www/html/application/assets/protected
Docker image tag

In the above example, we use the :latest Docker image tag, which refers to the latest released version.

But you can, of course, set it to any available release tag (e.g: v9.8.0)

To start the Docker container, run

docker-compose up -d

Using docker run

You can also simply use the docker run command.

docker run --rm --name bacula-web \
-d -p 8000:80 \
-v $PWD/config.php:/var/www/html/application/config/config.php \
-v $PWD/protected:/var/www/html/application/assets/protected \
baculaweb/bacula-web:latest

If you've followed the above instructions, Bacula-Web should be available using your web browser at http://localhost:8080

Bacula with SQLite catalog database

If you are using Bacula with SQLite catalog database, you must run the Docker container on the same server running the Bacula director.

You can use the instructions below to bind the Bacula SQLite database into the Docker container.

docker run --rm --name bacula-web -d -p 8000:80 \
-v $PWD/config.php:/var/www/html/application/config/config.php \
-v $PWD/protected:/var/www/html/application/assets/protected \
-v /var/lib/bacula/bacula.db:/var/lib/bacula/bacula.db \
baculaweb/bacula-web:latest
tip

If you get the error below

SQLSTATE[HY000] [14] unable to open database file

Make sure your user have read permission the /var/lib/bacula/bacula.db file.

A simple way to fix this is to add current user to the bacula group.

sudo usermod -a -G bacula <your-username>

Troubleshoot

A few troubleshooting tips

Check container status

docker ps

Docker container logs

If you have used the docker-compose.yml file with Docker Compose, you can check the container logs as shown below.

docker logs bacula-web -f --tail 50

Docker registry

Bacula-Web Docker image is available at DockerHub