Self-host BookStack on a managed VPS: your documentation, on your server

When you self-host BookStack on a managed VPS, your documentation lives on a machine of your own, which our teams keep up to date and monitor day and night. BookStack is free software under the MIT licence, and simple to run: PHP, MySQL or MariaDB and a web server, with no Docker. This guide follows its official documentation: installation, HTTPS, data, email, security, backups and updates.

Simon Vasconcelos Lee By Published on 13 November 202611-minute read

All guides

In short

  1. The MIT licence lets you use BookStack in any way in your business, and the project maintains a single free version, with no enterprise edition.
  2. BookStack needs no Docker: it asks for PHP 8.2 or later, MySQL 8.0 or MariaDB 10.6 or later, and a web server that serves its public folder.
  3. Install it with the project’s script on a brand-new Ubuntu system, or by hand with Git and Composer on a machine already in service.
  4. Serve it over HTTPS with Certbot, then write the exact address in APP_URL: links and secure cookies depend on it.
  5. Back up the database, .env, public/uploads, storage/uploads and themes, and keep APP_KEY safe.

What BookStack does

BookStack is a documentation platform designed to stay simple: its README aims for an experience anyone can pick up with basic word-processing skills. Your teams write their procedures, documentation and knowledge base in a browser, in the language each person prefers.

The project stands by its choices: its README states that BookStack is not designed as an extensible platform for other purposes, and it stays focused on documentation. PDF rendering goes through dompdf, with nothing extra to install and limited capabilities; the project documents other engines through EXPORT_PDF_COMMAND.

What the MIT licence allows

BookStack is published under the MIT licence by Dan Brown and the project’s contributors. It allows any use, modification and distribution, on one condition: keep the copyright notice and the licence text in every copy of the software. The project’s FAQ explains that this attribution applies to the code you share: nothing requires you to show the BookStack name or logo on your instance.

The project maintains a single version, free in both senses: it offers no enterprise edition, and it has no official hosting service and no plans for one. It does sell support plans, which help fund it alongside donations and sponsorships. So BookStack installs on your server, with no licence to buy.

BookStack requirements

ComponentRequired versionDetails
PHP8.2 or laterExtensions curl, dom, gd, iconv, mbstring, mysqlnd, openssl, pdo, pdo_mysql, tokenizer, xml and zip
DatabaseMySQL 8.0 or later, MariaDB 10.6 or laterA single database, whose schema BookStack manages itself
Composer2.2 or laterFor PHP dependencies
GitNo version specifiedTo fetch the code and apply updates
Web serverPHP-compatibleApache or Nginx, with the web root on the public folder

Docker stays optional. The project publishes no official image: container setups come from community projects, LinuxServer.io and solidnerd. This guide follows the official path, PHP and MySQL directly on the server, which needs nothing more.

The documentation rules out shared PHP hosting: BookStack needs a server you administer. It gives no figures for memory or processor. On a Managed VPS, describe your usage to us, the number of people and the volume of images and attachments, and we will recommend the right size.

Installing BookStack

The project offers two paths: a script for Ubuntu, the shortest on a new server, and a manual installation for every other case.

With the project’s script, on a brand-new Ubuntu system

SystemWhat the script installs
Ubuntu 26.04Apache, MySQL 8.4 and PHP 8.5
Ubuntu 24.04Apache, MySQL 8.0 and PHP 8.3
Ubuntu 22.04Apache, MySQL 8.0 and PHP 8.4
Terminal, for Ubuntu 24.04
wget https://codeberg.org/bookstack/devops/raw/branch/main/scripts/installation-ubuntu-24.04.sh
chmod a+x installation-ubuntu-24.04.sh
sudo ./installation-ubuntu-24.04.sh

These scripts are meant for a freshly installed system only: they can overwrite an existing web setup. They also leave out two topics, mail settings and system security, to plan for separately.

The script places BookStack in /var/www/bookstack. The Ubuntu 26.04 script asks for the domain and the admin account’s email address, then displays a randomly generated password at the end, which stays out of its log: write it down. With another script, note the access details shown at the end and change any default credentials at first sign-in.

By hand, on any other machine

Start with the database: one database, and a user limited to it. The project’s script does it this way, with the password of your choice in place of change-me:

Terminal
sudo mysql -u root --execute="CREATE DATABASE bookstack;"
sudo mysql -u root --execute="CREATE USER 'bookstack'@'localhost' IDENTIFIED BY 'change-me';"
sudo mysql -u root --execute="GRANT ALL ON bookstack.* TO 'bookstack'@'localhost';FLUSH PRIVILEGES;"

Then fetch the release branch, set the permissions the documentation gives for /var/www/bookstack, and install the dependencies:

Terminal
cd /var/www
sudo git clone https://source.bookstackapp.com/bookstack.git --branch release --single-branch bookstack
sudo chown -R $USER:www-data /var/www/bookstack
sudo chmod -R 755 /var/www/bookstack
sudo chmod -R 775 /var/www/bookstack/storage /var/www/bookstack/bootstrap/cache /var/www/bookstack/public/uploads
cd bookstack
composer install --no-dev
cp .env.example .env
sudo chmod 640 .env

Fill in the database and the address in .env:

.env
APP_URL=https://docs.example.com
DB_HOST=localhost
DB_DATABASE=bookstack
DB_USERNAME=bookstack
DB_PASSWORD=change-me
Terminal, in /var/www/bookstack
php artisan key:generate
php artisan migrate

Finally, point the web root at the public folder: DocumentRoot on Apache, root on Nginx. Without Apache, or when .htaccess files are disabled, add the URL rewrite rules: the project publishes examples for Apache and for Nginx.

A manual installation opens with the account admin@admin.com and the password password. Change the address and the password at first sign-in.

HTTPS and APP_URL

Visitors arrive on ports 80 and 443, under the server’s domain name. Create A and AAAA records for that name, then request the certificate: the Ubuntu 26.04 script sets up Apache on port 80 only, and the installation page leaves HTTPS in your hands. Certbot installs the Let’s Encrypt certificate, adapts Apache and renews the certificate on its own. On Nginx, replace --apache with --nginx.

Terminal
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/local/bin/certbot
sudo certbot --apache -d docs.example.com

Then switch the address to HTTPS in .env. APP_URL must match the address people visit exactly, prefix included: a mismatch shows up as missing styles, oversized icons and broken menus. An https address turns on secure cookies by itself.

.env
APP_URL=https://docs.example.com

If pages already exist, their links keep the old address in the database. Back up the database, then run the project’s command:

Terminal, in /var/www/bookstack
php artisan bookstack:update-url http://docs.example.com https://docs.example.com

BookStack is served at the root of a domain or subdomain, and the documentation also describes an installation under a subfolder, such as example.com/bookstack. If a reverse proxy goes in front of Apache, declare its address in APP_PROXIES: without it, the audit log and rate limiting see the proxy’s address instead of the visitors’. The documentation keeps APP_PROXIES="*" for debugging.

Where your data lives

LocationWhat it holds
The MySQL or MariaDB databaseAll the application’s data, including your page content
.envThe configuration, with APP_KEY and the database and mail server credentials
public/uploadsImages, with the default storage
storage/uploadsAttachments, protected by BookStack’s permissions
themesYour theme customizations, if any

Keep the same APP_KEY over time and back it up. BookStack uses it to encrypt, among other things, multi-factor authentication secrets: changing it can break those features, and since version 26.09 the application returns an error if it is missing.

Images are public by default

With the default storage, the web server serves images directly, which is fast, and anyone who knows their address can open them. For internal documentation, the choice is made in STORAGE_TYPE:

<code>STORAGE_TYPE</code>ImagesAccess
localpublic/uploads/imagesServed directly by the web server
local_securestorage/uploads/imagesFor signed-in people only, unless public access is on
local_secure_restrictedstorage/uploads/imagesAccording to the page’s permissions, the most resource-intensive option
s3An S3-compatible bucketImages made public on upload

For large files, three settings work together: FILE_UPLOAD_SIZE_LIMIT in .env, post_max_size and upload_max_filesize in php.ini, and client_max_body_size on Nginx, which defaults to 1 MB.

Two more settings matter for living documentation: each page keeps 100 revisions by default (REVISION_LIMIT), and the recycle bin holds deleted items for 30 days (RECYCLE_BIN_LIFETIME).

Email: SMTP and the queue

BookStack sends email for address confirmation, forgotten passwords, invitations and notifications. From a Simafri VPS, sending goes through an authenticated SMTP relay on port 587: the address of a mail account you already have, or Simafri Suite.

.env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=bookstack@example.com
MAIL_PASSWORD=change-me
MAIL_FROM=bookstack@example.com
MAIL_FROM_NAME=BookStack

Check the result in "Settings", "Maintenance", with the "Send a Test Email" action, which displays any errors it meets. A failed invitation shows on screen, while a failed notification stays in the application log.

Sending in the background

By default, BookStack sends email and webhooks during the request, which can slow pages down. To move them to the background, write QUEUE_CONNECTION=database in .env and run a service, using the example the documentation gives for a script-based Ubuntu installation:

/etc/systemd/system/bookstack-queue.service
[Unit]
Description=BookStack Queue Worker

[Service]
User=www-data
Group=www-data
Restart=always
ExecStart=/usr/bin/php /var/www/bookstack/artisan queue:work --sleep=3 --tries=1 --max-time=3600

[Install]
WantedBy=multi-user.target
Terminal
sudo systemctl daemon-reload
sudo systemctl enable bookstack-queue.service
sudo systemctl start bookstack-queue.service

Securing your BookStack instance

The security documentation gives a list to work through right after installation:

  1. Change the first administrator’s address and password.
  2. Check that the web server serves only the public folder, especially if BookStack lives under /var/www.
  3. Limit the database user to the BookStack database alone.
  4. Set APP_URL, so that system-generated addresses cannot be manipulated.
  5. Review the registration and public access settings, then the roles.

Multi-factor authentication can then be enforced per role. Also sign up for the project’s security mailing list to receive its alerts. The /status address is there for monitoring: it answers 200 when all is well, and an error code of 400 or higher otherwise.

PHP matters as much as BookStack. On October 21, 2026, the project published an alert about a critical PHP security update, fixed in 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Ubuntu ships these fixes under its own package numbers, such as 8.3.6-0ubuntu0.24.04.13 for Ubuntu 24.04.

For your content, keep the default filtering on, and loosen it only on instances where nobody but trusted people write. If an admin account is lost, php artisan bookstack:create-admin creates another one, and php artisan bookstack:reset-mfa removes a user’s multi-factor authentication.

Backups and updates

A complete backup brings together the database and the four file locations specific to your instance. Content exports serve another purpose: the documentation states that they do not replace a backup.

Terminal, in /var/www/bookstack
sudo mysqldump -u root bookstack > bookstack.backup.sql
tar -czvf bookstack-files-backup.tar.gz .env public/uploads storage/uploads themes

The first line suits a script-based installation, where the MySQL root user connects through sudo; elsewhere, write mysqldump -u bookstack -p bookstack. Store both files separately, preferably on another machine. The archive contains .env, and so APP_KEY and your passwords: treat it as a secret.

Restoring

On a new machine, install BookStack without running php artisan migrate, a step to comment out in the script if you use it, then restore the database and the files, keeping the original APP_KEY:

Terminal, in /var/www/bookstack
sudo mysql -u root bookstack < bookstack.backup.sql
tar -xvzf bookstack-files-backup.tar.gz

If the installed version is newer than the backup, then run php artisan migrate. Restore the web server’s write permissions on the restored folders. If the address has changed, correct APP_URL and run bookstack:update-url.

Updating

Back up the database and the files before each update, then, from the BookStack folder:

Terminal, in /var/www/bookstack
git pull origin release
composer install --no-dev
php artisan migrate
php artisan cache:clear
php artisan config:clear
php artisan view:clear

The Ubuntu 26.04 script installs BookStack without Composer. For that case, the updates page offers, in beta, ./bookstack-system-cli download-vendor in place of composer install --no-dev. The same tool can back up and restore, but the project does not yet consider it production-ready: test it before relying on it.

The documentation keeps a list of instructions specific to each version, to read for the version you are moving to. A few examples:

Vulnerabilities are fixed in maintenance releases, such as 26.09.3 of November 11, 2026: images and drawings on a draft or trashed page remained accessible and editable, and an editor's personal draft could become visible to other people.

Who does what on a Managed VPS

Self-hosting means running the server on top of the application. On a Managed VPS, our teams take the server in hand and proactively monitor your instance; BookStack remains your software, with its settings and its data.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe time that suits your business
MonitoringServer watched 24/7, with intervention without waiting for your callYour users, their roles and your content
BookStackProactive monitoring: errors, slowdowns and disk space spotted, fix recommendedIts installation, updates and settings, which you apply, yourself or through your AI assistant
BackupsEvery night, encrypted and kept off the machine; restores includedThe restore request, when you need one
MigrationYour current server migrated, free of chargeThe time of the switchover

If you would rather have our teams work inside the application itself, that service is billed hourly or at a fixed price, with a quote given before the work begins.

BookStack, on a server run for you

With a Simafri Managed VPS, our teams keep your BookStack instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is complimentary.

Explore Managed VPS

Frequently asked questions

Is BookStack free for a business?

Yes. BookStack is under the MIT licence, which allows any use, and the project maintains a single version, with no enterprise edition. It also offers paid support plans, which are optional. What remains is the cost of the server that runs it.

How do I install BookStack on Ubuntu?

On a brand-new Ubuntu 26.04, 24.04 or 22.04 system, download the project’s installation script, make it executable and run it with sudo. It installs Apache, MySQL and PHP. On a machine already in service, follow the manual installation, because the script can overwrite an existing web setup.

Is there an official BookStack Docker image?

No. Container setups come from community projects, LinuxServer.io and solidnerd. The official path installs BookStack directly on the server, with PHP, MySQL or MariaDB and a web server, by hand or with the Ubuntu script.

What do I need to self-host BookStack?

PHP 8.2 or later, MySQL 8.0 or MariaDB 10.6 or later, Composer 2.2 or later, Git and a PHP-compatible web server. The project gives no figures for memory or processor, and rules out shared PHP hosting.

What is the default BookStack password?

A manual installation opens with admin@admin.com and the password password, to change at first sign-in. The Ubuntu 26.04 script displays a randomly generated password at the end. If you lose access, php artisan bookstack:create-admin creates a new administrator.

How do I back up BookStack?

Export the database with mysqldump, and archive .env, public/uploads, storage/uploads and themes. Keep the original APP_KEY when restoring, and store everything off the machine. BookStack’s content exports do not replace this backup.

How do I set up email in BookStack?

Fill in MAIL_DRIVER, MAIL_HOST, MAIL_PORT, MAIL_ENCRYPTION, MAIL_USERNAME, MAIL_PASSWORD, MAIL_FROM and MAIL_FROM_NAME in the .env file, then run Send a Test Email under Settings, Maintenance. From a Simafri VPS, sending goes through an authenticated SMTP relay on port 587.

Does a Managed VPS cover BookStack?

A Managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed hourly or at a fixed price.

Contact us