Skip to content

Deploying LibreBooking

Introduction

LibreBooking is an open-source web-based resource scheduling system designed for managing room reservations, equipment bookings, and shared resource allocation. A fork of the popular Booked Scheduler, LibreBooking provides organizations with a powerful tool for coordinating spaces and assets without licensing costs.

Built with PHP and designed for ease of use, LibreBooking offers a clean calendar interface where users can view availability, make reservations, and manage their bookings. Administrators gain comprehensive control over resources, user permissions, booking rules, and reporting.

Key highlights of LibreBooking:

  • Resource Management: Define rooms, equipment, and other bookable resources with detailed attributes
  • Calendar Views: Multiple calendar views including day, week, month, and resource timeline
  • Booking Rules: Set minimum/maximum booking times, advance notice requirements, and quotas
  • User Management: Create accounts, groups, and assign permissions
  • Recurring Reservations: Schedule repeating bookings with flexible patterns
  • Approval Workflow: Optional reservation approval by administrators or resource managers
  • Email Notifications: Automatic notifications for booking confirmations and reminders
  • Waiting Lists: Allow users to join waitlists when resources are fully booked
  • Custom Attributes: Add custom fields to resources and reservations
  • Reports: Generate usage reports for resources and users
  • LDAP/Active Directory: Integrate with enterprise directory services

This guide walks through deploying LibreBooking on Klutch.sh using Docker and configuring it for organizational use.

Why Deploy LibreBooking on Klutch.sh

Deploying LibreBooking on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically builds LibreBooking from your Dockerfile. Push to GitHub, and your scheduling system deploys automatically.

Persistent Storage: Attach persistent volumes for your database and uploaded files. Reservations survive container restarts.

HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure access to your booking system.

GitHub Integration: Connect your repository directly from GitHub. Updates trigger automatic redeployments.

Scalable Resources: Allocate resources based on your organization’s size and booking activity.

Environment Variable Management: Securely store database credentials and configuration.

Custom Domains: Assign a professional domain for your booking portal.

Always-On Availability: Your booking system remains accessible 24/7.

Prerequisites

Before deploying LibreBooking on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • A MySQL/MariaDB database (can be deployed as a separate service)
  • (Optional) SMTP server for email notifications
  • (Optional) A custom domain for your booking system

Understanding LibreBooking Architecture

LibreBooking uses a traditional web application architecture:

PHP Application: Core application built on PHP with a modular design.

MySQL/MariaDB Database: Stores users, resources, reservations, and configuration.

File Storage: Upload directory for attachments and custom images.

Smarty Templates: Theming system using Smarty template engine.

Cron Jobs: Background tasks for email reminders and maintenance.

Preparing Your Repository

Repository Structure

librebooking-deploy/
├── Dockerfile
├── config.php
├── cron/librebooking-cron
├── README.md
└── .dockerignore

Creating the Dockerfile

FROM php:8.2-apache
# Install PHP extensions
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libldap2-dev \
cron \
curl \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd mysqli pdo pdo_mysql zip ldap \
&& rm -rf /var/lib/apt/lists/*
# Enable Apache modules
RUN a2enmod rewrite
# Set working directory
WORKDIR /var/www/html
# Download LibreBooking
RUN curl -L https://github.com/LibreBooking/app/archive/refs/heads/develop.tar.gz | tar -xz --strip-components=1
# Set permissions
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html
# Copy custom configuration
COPY config.php /var/www/html/config/config.php
# Copy cron configuration
COPY cron/librebooking-cron /etc/cron.d/librebooking
RUN chmod 0644 /etc/cron.d/librebooking && crontab /etc/cron.d/librebooking
# Expose port
EXPOSE 80
# Start services
CMD cron && apache2-foreground

Creating the Configuration File

Create config.php:

<?php
$conf['settings']['database']['type'] = 'mysql';
$conf['settings']['database']['user'] = getenv('DB_USER') ?: 'librebooking';
$conf['settings']['database']['password'] = getenv('DB_PASSWORD') ?: '';
$conf['settings']['database']['hostspec'] = getenv('DB_HOST') ?: 'localhost';
$conf['settings']['database']['name'] = getenv('DB_NAME') ?: 'librebooking';
$conf['settings']['app.title'] = getenv('APP_TITLE') ?: 'LibreBooking';
$conf['settings']['default.timezone'] = getenv('TIMEZONE') ?: 'America/New_York';
$conf['settings']['script.url'] = getenv('SCRIPT_URL') ?: 'https://your-domain.com/Web';
$conf['settings']['registration.captcha.enabled'] = 'false';
$conf['settings']['registration.require.email.activation'] = 'false';
$conf['settings']['registration.auto.subscribe.email'] = 'true';
$conf['settings']['email']['default.from.address'] = getenv('SMTP_FROM') ?: 'noreply@example.com';
$conf['settings']['email']['default.from.name'] = getenv('APP_TITLE') ?: 'LibreBooking';

Creating the Cron File

Create cron/librebooking-cron:

*/15 * * * * www-data php /var/www/html/Jobs/sendmissedcheckin.php > /dev/null 2>&1
0 * * * * www-data php /var/www/html/Jobs/sendreminders.php > /dev/null 2>&1

Creating the .dockerignore File

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Deploying LibreBooking on Klutch.sh

    Set Up MySQL/MariaDB Database

    Deploy a MySQL database and create a database for LibreBooking. Import the initial schema from the database_schema/ directory after deployment.

    Push Your Repository to GitHub

    Terminal window
    git init
    git add Dockerfile config.php cron/ .dockerignore README.md
    git commit -m "Initial LibreBooking deployment configuration"
    git remote add origin https://github.com/yourusername/librebooking-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project named “librebooking” or “room-booking”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account and select your LibreBooking repository.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Add the following:

    VariableValue
    DB_HOSTYour MySQL hostname
    DB_NAMElibrebooking
    DB_USERYour database username
    DB_PASSWORDYour database password
    APP_TITLEYour organization name
    TIMEZONEYour timezone (e.g., America/New_York)
    SCRIPT_URLhttps://your-app.klutch.sh/Web

    Attach Persistent Volumes

    Mount PathRecommended SizePurpose
    /var/www/html/uploads5 GBUploaded attachments
    /var/www/html/tpl_c1 GBCompiled templates

    Deploy Your Application

    Click Deploy to start the build process.

    Initialize the Database

    After deployment:

    1. Navigate to https://your-app.klutch.sh/Web/install
    2. Follow the installation wizard
    3. Create the admin account

Initial Configuration

Setting Up Resources

Create bookable resources:

  1. Log in as administrator
  2. Navigate to Application Management > Resources
  3. Add resources (rooms, equipment, etc.)
  4. Configure properties like capacity and images

Configuring Schedules

Set up booking schedules:

  1. Go to Application Management > Schedules
  2. Define available time slots
  3. Set working hours and blocked times
  4. Assign resources to schedules

User Management

Configure user access:

  1. Create user accounts or enable registration
  2. Set up groups for departments or teams
  3. Assign resource permissions to groups
  4. Configure booking quotas if needed

Email Configuration

Set up notifications:

  1. Configure SMTP settings in environment variables
  2. Enable email notifications in admin settings
  3. Customize email templates

Production Best Practices

Security Recommendations

  • Use strong admin passwords
  • Enable HTTPS for all access
  • Configure captcha for registration
  • Regularly update LibreBooking

Performance Tips

  • Optimize database with proper indexes
  • Enable PHP opcache
  • Use database connection pooling
  • Monitor resource usage

Backup Strategy

  1. Schedule MySQL backups regularly
  2. Back up the uploads directory
  3. Export configuration settings

Troubleshooting

Database Connection Errors

  • Verify database credentials
  • Check MySQL is accessible
  • Ensure database exists

Booking Conflicts

  • Review booking rules configuration
  • Check resource availability settings
  • Verify timezone configuration

Email Not Sending

  • Verify SMTP settings
  • Check spam filters
  • Review email logs

Additional Resources

Conclusion

Deploying LibreBooking on Klutch.sh gives you a powerful, self-hosted room and resource scheduling system. Whether managing conference rooms, shared equipment, or any bookable resources, LibreBooking provides the flexibility and control your organization needs.

With automatic builds, persistent storage, and secure HTTPS access, you can focus on managing resources rather than infrastructure.