Public | Automated Build

Last pushed: 2 months ago
Short Description
Full installation of Bareos, a fork of Bacula
Full Description


Bareos on Docker

Bareos is a fork of the well know backup solution "Bacula"

This Bareos installation on Docker comes with integrated mysql backend and Bareos Webui.
Database files and configuration are mapped to volumes. It was made to run on a Synology


Variables must be predefined, see run.vars sample below and
On a Synology Diskstation you may use the Docker Gui instead of the following commands

docker pull tommi2day/bareos-mysql
docker run --name bareos-mysql \
--add-host bareos: \
--add-host ntp: \
-e TZ=$TZ \
-v ${BACKUP_DIR}:/backup \
-v ${SHARED_DIR}/db:/db \
-v ${SHARED_DIR}/etc-bareos:/etc/bareos \
-v ${SHARED_DIR}/log-mysql:/var/log/mysql \
-v ${SHARED_DIR}/log-bareos:/var/log/bareos \
-v ${SHARED_DIR}/etc-bareos-webui:/etc/bareos-webui \
-v ${SHARED_DIR}/log-apache2:/var/log/apache2 \
-p ${EXT_DIR_PORT}:9101 -p ${EXT_FD_PORT}:9102 -p ${EXT_SD_PORT}:9103 \
-p ${EXT_DB_PORT}:3306 -p ${EXT_HTML_PORT}:80

Bareos Gui Access:

local settings

  • bareos.env --> will be sourced each time container starts.
    You may place your mailconfig or others there, with is not persistent in the container. Put this file into your shared /etc/bareos folder
#bareos env system configuration
#will be executed on every start by
#put your local system changes here
postconf -e relayhost=mailhost
postconf -e myhostname=bareos
echo "
" >>/etc/aliases
postfix restart

if [ -r $TZF ];then
    echo $TZ >/etc/timezone
    rm /etc/localtime && ln -s $TZF /etc/localtime
ntpdate -q
  • run.vars --> defines variables used by Put this file into the same path,
    if you want to use this commandline script.
    #shared folder on a synology nas
    #runtime variables

    exposed Ports

    # web, director, fd, storage, mysql daemons 
    EXPOSE 80 9101 9102 9103 3306


    VOLUME /db # mysql datadir
    VOLUME /var/log/mysql # mysql logfiles
    VOLUME /var/log/apache2 # apache logfiles
    VOLUME /backup # Backup Storage
    VOLUME ["/etc/bareos","/var/log/bareos","/etc/bareos-webui"] # Bareos konfiguration

    Environment variables used

    TARGET_HOST # Host/IP for bareos dir, fd and sd Address configuration parameter  
    BAREOS_DB_PASSWORD # create bareos user account with this password
    DB_ROOT_PASSWORD # create database with this password
    TZ #valid time zone name for /usr/share/zoneinfo

Attention: Update to Docker Bareos-Mysql:16.2 from previous versions

First of all: Make sure you have a valid backup of all your configuration files and the mysql database
(e.g. mysqldump -A ..). You may need it in case of errors.

The database engine has been changed from mysql to mariadb. The update will cause an unrecoverable change of
the mysql datafiles.

In Bareos 16.2 the configuration file structure has been changed.
See the documentation for details.
Bareos provides a migrate-config
script. This script extracts the existing configuration
with bconsole show commands und builds pure new config files only based on the extracted config,
not on the existing config files. As of Bareos 16.2.4 this method is known to produce invalid
configuration files, which prevents the director to come up.

However: To extract the configuration you need a running director instance acessible by bconsole.
Because this is not available when upgrading the docker container my start script will only do the most
important changes to bringup the director and leaves the directory changes for you.

Alternativ you may run the migrate-config script against your running old 15.2 director,
and copy the resulting files over after the first boot of 16.2 succeeded and do a reload.

Docker Pull Command
Source Repository