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└── .dockerignoreCreating the Dockerfile
FROM php:8.2-apache
# Install PHP extensionsRUN 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 modulesRUN a2enmod rewrite
# Set working directoryWORKDIR /var/www/html
# Download LibreBookingRUN curl -L https://github.com/LibreBooking/app/archive/refs/heads/develop.tar.gz | tar -xz --strip-components=1
# Set permissionsRUN chown -R www-data:www-data /var/www/html \ && chmod -R 755 /var/www/html
# Copy custom configurationCOPY config.php /var/www/html/config/config.php
# Copy cron configurationCOPY cron/librebooking-cron /etc/cron.d/librebookingRUN chmod 0644 /etc/cron.d/librebooking && crontab /etc/cron.d/librebooking
# Expose portEXPOSE 80
# Start servicesCMD cron && apache2-foregroundCreating 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>&10 * * * * www-data php /var/www/html/Jobs/sendreminders.php > /dev/null 2>&1Creating the .dockerignore File
.git.github*.mdLICENSE.gitignore*.log.DS_Store.env.env.localDeploying LibreBooking on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 80
- Navigate to
https://your-app.klutch.sh/Web/install - Follow the installation wizard
- Create the admin account
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
git initgit add Dockerfile config.php cron/ .dockerignore README.mdgit commit -m "Initial LibreBooking deployment configuration"git remote add origin https://github.com/yourusername/librebooking-deploy.gitgit push -u origin mainCreate 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:
Set Environment Variables
Add the following:
| Variable | Value |
|---|---|
DB_HOST | Your MySQL hostname |
DB_NAME | librebooking |
DB_USER | Your database username |
DB_PASSWORD | Your database password |
APP_TITLE | Your organization name |
TIMEZONE | Your timezone (e.g., America/New_York) |
SCRIPT_URL | https://your-app.klutch.sh/Web |
Attach Persistent Volumes
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/www/html/uploads | 5 GB | Uploaded attachments |
/var/www/html/tpl_c | 1 GB | Compiled templates |
Deploy Your Application
Click Deploy to start the build process.
Initialize the Database
After deployment:
Initial Configuration
Setting Up Resources
Create bookable resources:
- Log in as administrator
- Navigate to Application Management > Resources
- Add resources (rooms, equipment, etc.)
- Configure properties like capacity and images
Configuring Schedules
Set up booking schedules:
- Go to Application Management > Schedules
- Define available time slots
- Set working hours and blocked times
- Assign resources to schedules
User Management
Configure user access:
- Create user accounts or enable registration
- Set up groups for departments or teams
- Assign resource permissions to groups
- Configure booking quotas if needed
Email Configuration
Set up notifications:
- Configure SMTP settings in environment variables
- Enable email notifications in admin settings
- 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
- Schedule MySQL backups regularly
- Back up the uploads directory
- 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.