Run the docker container

April 3, 2026 ยท View on GitHub

The image contains the apache web server and the librebooking application files. It needs to be linked to a running MariaDB database container.

Environment variables

From version-3, this docker image makes full usage of the environment variables override.

Required variables

VariableDefaultsDescription
LB_DATABASE_NAMEDatabase name
LB_DATABASE_USERDatabase user
LB_DATABASE_PASSWORDDatabase password
LB_DATABASE_HOSTSPECDatabase network address
LB_INSTALL_PASSWORDLibrebooking installation password
LB_DEFAULT_TIMEZONETimezone
LB_LOGGING_FOLDER/var/log/librebookingLogs folder
LB_LOGGING_LEVELnoneLogging level
LB_LOGGING_SQLfalseSQL logging

Optional variables

VariableDescription
APP_PATHURL path

Optional mounts

If you need to persist some librebooking directories beyond the container lifecycle, you need to bind-mount the required directories. For instance:

  • Images directory: /var/www/html/Web/uploads/images
  • Reservation attachments directory: /var/www/html/Web/uploads/reservation

If you need to customize some files, you can bind-mount them as well. For instance:

  • favicon: /var/www/html/Web/favicon.ico

Bind mounts

If you are using bind mounts for librebooking, then you need to grant the required permissions before running the librebooking container

sudo mkdir --parents <bind_dir_path>
sudo chown go+rwx <bind_dir_path>

Backround jobs

Several services in librebooking such as reminder emails require a job scheduler. For a full list of background jobs, checkout the wiki

The background jobs can either be handled by the:

  • Container itself, by running a separate librebooking/librebooking container where the command is set to supercronic /config/lb-jobs-cron

  • Host running the container, by calling the desired script, as in

    docker exec \
      --detach \
      <container_name> \
      php -f /var/www/html/Jobs/sendreminders.php`
    

Based on the value of the environment variable LB_LOGGING_LEVEL, the background jobs will output to the app.log file inside the log folder defined by the environment variable LB_LOGGING_FOLDER.

Examples of running librebooking

Examples are provided inside directory .examples