3 description = "How to install BookStack"
8 Below you can find details on how to install BookStack on your own hosting. There are a number of installation options available depending on your setup. The install process will require some knowledge of hosting a PHP web application & database.
10 * [Requirements](#requirements)
11 * [Shared Hosting](#shared)
14 * [Ubuntu 24.04 Script](#ubuntu-2404)
15 * [Ubuntu 22.04 Script](#ubuntu-2204)
16 * [Ubuntu 20.04 Script](#ubuntu-2004)
17 * [Community Guides](#community)
18 * [Other Hosting Options](#other)
19 * [High Availability](#ha)
23 <a name="requirements"></a>
27 BookStack has the following core requirements:
30 * For installation and maintenance, you'll need to be able to run `php` from the command line.
31 * Required Extensions: gd, dom, iconv, mbstring, mysqlnd, openssl, pdo, pdo_mysql, tokenizer, xml, zip.
32 * Optional Extensions: ldap *(If wanting to use LDAP Auth)*, exif *(For accurate image rotation handling)*.
33 * *For PHP MySQL extensions use `nd` (Native Driver) variants where provided, otherwise these may be the default provided in modern `mysql` PHP extension packages.*
34 * **MySQL** >= 5.7 or **MariaDB** >= 10.2
35 * For the storage of BookStack content and data.
36 * Single Database *(All permissions advised since application manages schema)*
37 * **Git Version Control**
38 * For application of updates when following our standard process.
39 * **[Composer](https://getcomposer.org/)** >= v2.2.0
40 * For installation and management of our PHP dependencies.
41 * **A PHP Compatible Webserver**
42 * For usage with PHP and for serving static files.
50 BookStack does not currently support shared PHP hosting. There are too many differences between shared hosting providers and too many limitations to support the current install process although we would like to make this easier in the future. You can try searching for 'Laravel Install Guides' for your hosting provider as the process would be similar. Beware that modifying the application source files or applying large work-arounds could lead to security or stability issues.
56 ## Manual Installation
58 Ensure the above requirements are met before installing.
60 This project currently uses the `release` branch of the BookStack GitHub repository as a stable channel for providing updates. The installation is currently somewhat complicated and will be made simpler in future releases. Some PHP or Laravel experience will make this easier.
62 1. Clone the release branch of the BookStack GitHub repository into a folder.
64 git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch bookstack
66 2. `cd` into the application folder and run `composer install --no-dev`.
67 3. Copy the `.env.example` file to `.env` and fill with your own database and mail details.
68 4. Ensure the `storage`, `bootstrap/cache` & `public/uploads` folders are writable by the web server ([More information here](/docs/admin/filesystem-permissions/)).
69 5. In the application root, Run `php artisan key:generate` to generate a unique application key.
70 6. If not using Apache or if `.htaccess` files are disabled you will have to create some URL rewrite rules as shown below.
71 7. Set the web root on your server to point to the BookStack `public` folder. This is done with the `root` setting on Nginx or the `DocumentRoot` setting on Apache.
72 8. Run `php artisan migrate` to update the database.
73 9. Done! You can now login using the default admin details `
[email protected]` with a password of `password`. You should change these details immediately after logging in for the first time.
75 #### Webserver Configuration
77 - [Example Apache VirtualHost configuration](https://codeberg.org/bookstack/devops/src/branch/main/config/apache/bookstack.conf)
78 - [Example Nginx Server block](https://codeberg.org/bookstack/devops/src/branch/main/config/nginx)
86 Community docker setups are available for those that would prefer to use a containerised version of BookStack:
90 * [GitHub Repository](https://github.com/linuxserver/docker-bookstack)
91 * [GitHub container package](https://github.com/linuxserver/docker-bookstack/pkgs/container/bookstack)
92 * [Example compose stack](https://codeberg.org/bookstack/devops/src/branch/main/config/lsio-docker/docker-compose.yml)
96 * [GitHub Repository](https://github.com/solidnerd/docker-bookstack)
97 * [Docker Hub page](https://hub.docker.com/r/solidnerd/bookstack/)
101 <a name="ubuntu-2404"></a>
103 ## Ubuntu 24.04 Installation Script
105 A script to install BookStack on a fresh instance of Ubuntu 24.04 is available. This script is ONLY FOR A FRESH OS, it will install Apache, MySQL 8.0 & PHP 8.3 and could OVERWRITE any existing web setup on the machine. It also does not set up mail settings or configure system security so you will have to do those separately. You can use the script as a reference if you're installing on a non-fresh machine.
107 - [Link to installation script](https://codeberg.org/bookstack/devops/src/branch/main/scripts/installation-ubuntu-24.04.sh)
108 - [Video guide](https://foss.video/w/cqy2J21V44KWKj3d3pMut5)
110 #### Running the Script
113 # Ensure you have read the above information about what this script does before executing these commands.
115 # Download the script
116 wget https://codeberg.org/bookstack/devops/raw/branch/main/scripts/installation-ubuntu-24.04.sh
119 chmod a+x installation-ubuntu-24.04.sh
121 # Run the script with admin permissions
122 sudo ./installation-ubuntu-24.04.sh
125 The script will output a log file for debugging within your current working directory when running the script.
126 Permissions for the BookStack installation files & folders will be set based upon the user used to run the script.
130 <a name="ubuntu-2204"></a>
132 ## Ubuntu 22.04 Installation Script
134 A script to install BookStack on a fresh instance of Ubuntu 22.04 is available. This script is ONLY FOR A FRESH OS, it will install Apache, MySQL 8.0 & PHP 8.4 and could OVERWRITE any existing web setup on the machine. It also does not set up mail settings or configure system security so you will have to do those separately. You can use the script as a reference if you're installing on a non-fresh machine.
136 - [Link to installation script](https://codeberg.org/bookstack/devops/src/branch/main/scripts/installation-ubuntu-22.04.sh)
137 - [Video guide](https://foss.video/w/emk5bMzhRdk4qzDoq3R6xe)
139 #### Running the Script
142 # Ensure you have read the above information about what this script does before executing these commands.
144 # Download the script
145 wget https://codeberg.org/bookstack/devops/raw/branch/main/scripts/installation-ubuntu-22.04.sh
148 chmod a+x installation-ubuntu-22.04.sh
150 # Run the script with admin permissions
151 sudo ./installation-ubuntu-22.04.sh
154 The script will output a log file for debugging within your current working directory when running the script.
155 Permissions for the BookStack installation files & folders will be set based upon the user used to run the script.
159 <a name="ubuntu-2004"></a>
161 ## Ubuntu 20.04 Installation Script
163 A script to install BookStack on a fresh instance of Ubuntu 20.04 is available. This script is ONLY FOR A FRESH OS, it will install Apache, MySQL 8.0 & PHP 8.2 and could OVERWRITE any existing web setup on the machine. It also does not set up mail settings or configure system security so you will have to do those separately. You can use the script as a reference if you're installing on a non-fresh machine.
165 - [Link to installation script](https://codeberg.org/bookstack/devops/src/branch/main/scripts/installation-ubuntu-20.04.sh)
166 - [Video guide](https://foss.video/w/59udkzBf8ftVPWutkBcuyM)
168 #### Running the Script
171 # Ensure you have read the above information about what this script does before executing these commands.
173 # Download the script
174 wget https://codeberg.org/bookstack/devops/raw/branch/main/scripts/installation-ubuntu-20.04.sh
177 chmod a+x installation-ubuntu-20.04.sh
179 # Run the script with admin permissions
180 sudo ./installation-ubuntu-20.04.sh
185 <a name="community"></a>
189 Below is a collection of guides created by awesome members of the BookStack community. Keep in mind we don't specifically provide support for these scripts or listed environments.
191 * RedHat based (Rocky, Alma, Oracle Linux, etc.) :
192 * [RHEL 8 with PHP 8.3](https://github.com/blogmotion/bm-bookstack-install/blob/master/bookstack-install-RHEL8.sh) [by @xhark](https://github.com/blogmotion/bm-bookstack-install/), ([french guide](https://blogmotion.fr/internet/bookstack-script-installation-centos-8-18255))
193 * [RHEL 9 with PHP 8.3](https://github.com/blogmotion/bm-bookstack-install/blob/master/bookstack-install-RHEL9.sh) [by @xhark](https://github.com/blogmotion/bm-bookstack-install/), ([french guide](https://blogmotion.fr/internet/bookstack-script-installation-centos-8-18255))
194 * [Sample Docker Swarm Stack by @neuroforgede](https://github.com/neuroforgede/bookstack-docker-swarm)
195 * [List of all our install scripts](https://codeberg.org/bookstack/devops/src/branch/main/scripts)
197 In addition to written guides, there are a bunch [community videos on YouTube](https://www.youtube.com/playlist?list=PLLIji4SLo6EiAUI5X3amBSB99HpabUqsS)
198 in addition to the guides on the official [BookStack YouTube channel](https://www.youtube.com/c/BookStackApp)
199 or [BookStack PeerTube channel](https://foss.video/c/bookstack/).
203 The below are community guides that are no longer current, due to using old operating systems or installing out-of-date dependencies,
204 but they are still listed here as a useful resource:
206 * [Debian 11 Install by Othman Alikhan](https://gist.github.com/OthmanAlikhan/322f83a77c15dfd1c91a2afe0b6a6fc2)
207 * [Fedora 27 Install by Jared Busch](https://mangolassi.it/topic/16471/install-bookstack-on-fedora-27/)
213 ## Other Hosting Options
215 Below are some alternative platforms and services that can be used to host BookStack. <br>
216 _**Note: These are not tested, vetted nor supported by the official BookStack project in any manner**_.
218 - [Cloudron](https://www.cloudron.io/store/com.bookstackapp.cloudronapp.html) - A solution for running apps on your own server.
219 - [Uberspace](https://lab.uberspace.de/guide_bookstack.html) - A European based hosting provider.
220 - [Home Assistant Community Add-on](https://github.com/hassio-addons/addon-bookstack) - For [Home Assistant](https://www.home-assistant.io/) users.
221 - [Stellar Hosted](https://www.stellarhosted.com/bookstack/) - A European based managed hosting provider.
222 - [alwaysdata](https://www.alwaysdata.com/en/marketplace/bookstack/) - A European based managed hosting provider.
223 - [PikaPods](https://www.pikapods.com/pods?run=bookstack) - Managed open source hosting, EU and US regions available.
224 - [YunoHost](https://install-app.yunohost.org/?app=bookstack) - A Debian-based distribution that automates personal web server installation.
225 - [Elestio](https://elest.io/open-source/bookstack) - Managed hosting in common cloud services or on-premise.
226 - [Nexxwave](https://www.nexxwave.eu/app-hosting/bookstack) - Managed application hosting in the EU.
227 - [Easypanel](https://easypanel.io/docs/templates/bookstack) - A modern server control panel. You can use it to deploy BookStack on your own server.
228 - [K&T Host](https://www.knthost.com/bookstack) - US based managed BookStack hosting with a focus on high availability.
236 Some enterprise environments may need to configure a "High Availability" setup of BookStack to include some operational redundancy.
237 **This type of setup is not needed for the vast majority of BookStack instances.**
238 For a "High Availability" BookStack setup you'll likely need to consider the following:
240 - High availability is not something we assure to support. There may be scenarios that will not allow availability.
241 - For example: The BookStack upgrade process does not assure availability when ran.
242 - Sessions and Cache use the local filesystem by default.
243 - The database/memcached/redis options allow sharing across instances.
244 - [Cache and session options are documented here](/docs/admin/cache-session-config/).
245 - Uploaded files use the local filesystem by default.
246 - You could instead use S3 or an S3 like storage system for these files.
247 - Alternatively you could mount/link the used directories to shared locations.
248 - [Directory locations and storage options are documented here](/docs/admin/upload-config/).
249 - The [theme system](/docs/admin/hacking-bookstack/#theme-system) and [error log](/docs/admin/debugging/) also use the local filesystem.
250 - A simplistic health-check endpoint can be found at the `/status` URI.
251 - This performs basic checks on subsystems.
252 - This should return a HTTP error status code (>=400) on any failure otherwise a 200 status code.