Install using Docker
Requirements
dockerinstalled and properly configured, anddocker composeaddon installed- your user is a member of the
dockergroup (or you're allowed to run thesudocommand)
Available tags
| tag | description |
|---|---|
latest | Latest release |
nightly-9.x | Nightly 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
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.
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
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
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.
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
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.
- Using docker run
- Using docker compose
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
services:
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
- /var/lib/bacula/bacula.db:/var/www/html/application/assets/protected:ro
Start the Docker container
docker-compose up -d
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
- Using docker run
- Using docker compose
docker ps
docker-compose 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.
- Using docker run
- Using docker compose
docker logs bacula-web -f --tail 50
docker-compose logs -f --tail 50
Docker registry
Bacula-Web Docker image is available at DockerHub