Skip to content

Installation

effgarces edited this page Feb 7, 2022 · 3 revisions

Prerequisites

  • PHP 7 or greater
  • MySQL 5.5 or greater
  • Web server (Apache2, IIS)

Fresh Installation

Upload LibreBooking Files

  • Unzip the archived distribution to your web server’s document root. Or
    • If you don’t have direct access to your document root or use hosting service, then transfer the extracted directory to your web server’s document root using FTP
  • Copy config/config.dist.php to config/config.php and adjust the settings for your environment.
  • The most important settings for installation are script.url and the database settings. script.url should be pointed to the full, public URL for LibreBooking including /Web
  • The web server must have write access (0755) to /your-librebooking/tpl_c and /your-librebooking/tpl (want to know why?)
    • If using an FTP client, check read/write/execute for Owner and Group on /tpl, /tpl_c, and /uploads
  • Important! LibreBooking will not work if PHP session.autostart is enabled. Ensure this setting is disabled.

Installation Configuration

The most important settings for installation are script.url and the database settings. script.url should be pointed to the full, public URL for LibreBooking including /Web. Ensure these are correct before continuing with the installation. To configure the application, open /config/config.php and update any settings accordingly. Note: If you try to load the application at this time (eg. https://yourhostname/librebooking/Web/), you will probably get a white page. This is because there is no backend database configured yet

Database Setup

Creating the MySQL Database and User

You must create a database and user with the same name, credentials and other database settings that you just set in config.php. The database user must have SELECT, CREATE, UPDATE, INSERT and DELETE privileges. Steps using MySQL command line Connect to MySQL using root credentials then run the following commands. Make sure the database name, user name, and password all match your config.php.

  • CREATE DATABASE `librebooking`;
  • CREATE USER ‘lb_user’@’localhost’ identified by ‘password’;
  • CREATE USER ‘lb_user’@’127.0.0.1’ identified by ‘password’;
  • GRANT ALL on librebooking.* to ‘lb_user’@’localhost’;
  • GRANT ALL on librebooking.* to ‘lb_user’@’127.0.0.1’;

Steps using cPanel

  • Select the MySQL Databases tool
  • Add a new user with username and password of your choice. This will be the database user and database password that you just set in your LibreBooking config file. Please be aware that some hosts will prefix your database user name.
  • Create a new database with whatever name you choose. This will be the name of the database in your LibreBooking config file. ‘librebooking’ is the recommended database name. Please be aware that some hosts will prefix your database name.
  • Associate the new user with the new database, giving the user permission to SELECT, CREATE, UPDATE, INSERT and DELETE. Click the ‘Add User to Db’ button.

Automatic Schema Setup

LibreBooking can set up the required tables and data directly. This is the recommended approach. Open https://yourhostname/librebooking/Web/install and follow the instructions.

Manual Schema Setup

Steps using MySQL command line Run the following commands

  • mysql librebooking < /full/path/to/librebooking/database_schema/create-schema.sql
  • mysql librebooking < /full/path/to/librebooking/database_schema/create-data.sql

Steps using cPanel

  • Open phpMyAdmin.
  • Click on the database name that you just created in the left panel.
  • Click the SQL tab at the top of the page.
  • Import “/database_schema/create-schema.sql” to librebooking (or whatever database name was used in the creation process)
  • Import “/database_schema/create-data.sql” to librebooking (or whatever database name was used in the creation process)

Upgrading

Backup

Always back up your filesystem and database prior to an upgrade. This is the only way to restore the application to a working state in the event something goes wrong.

Upload Latest Files

  • Extract the latest LibreBooking package to your local computer
  • Using an FTP client, upload the local files to your web server running LibreBooking. Fully overwrite all existing files and directories.
  • Delete all contents of /tpl_c

Complete the Upgrade

First Login – Administrator

The first user registered will become your primary administrator account. You can change this at any time by updating the admin.email configuration setting.