Skip to main content

BookStack with Docker Compose

BookStack supports MySQL 8.0+ and MariaDB 10.6+ only. PostgreSQL is not supported, and neither is SQLite β€” the app is built on Laravel's MySQL driver and needs the PHP pdo_mysql extension. It also needs PHP 8.2+, which the official container images already ship. The Compose file below runs BookStack with MariaDB; the one-click template runs it with a managed MySQL database.

Before using the one-click template, here is a minimal Docker Compose example for self-hosting BookStack.

If you're new to Docker Compose, check out our guide on how to self-host a Docker Compose app. More stacks are in our Docker Compose library.

Self-host BookStack with Docker Compose (minimal)​

BookStack needs a MySQL 8.0+ or MariaDB 10.6+ database. The official LinuxServer image expects an APP_KEY and the database connection details.

services:
bookstack:
image: lscr.io/linuxserver/bookstack:latest
ports:
- "6875:80"
environment:
- APP_URL=http://localhost:6875
- APP_KEY=base64:GENERATE_A_32_BYTE_KEY # see note below
- DB_HOST=bookstack_db
- DB_PORT=3306
- DB_DATABASE=bookstackapp
- DB_USERNAME=bookstack
- DB_PASSWORD=changeme
volumes:
- bookstack-config:/config
depends_on:
- bookstack_db

bookstack_db:
image: lscr.io/linuxserver/mariadb:latest
environment:
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=changeme
- MYSQL_ROOT_PASSWORD=changeme-root
volumes:
- bookstack-db:/config

volumes:
bookstack-config:
bookstack-db:

πŸ”‘ Generate APP_KEY with: docker run -it --rm --entrypoint /usr/bin/php lscr.io/linuxserver/bookstack:latest /app/www/artisan key:generate --show


Deploy BookStack on Hostim.dev (One-Click)​

BookStack is an open-source, self-hosted platform for organizing and storing information. It uses a simple, book-style structure (Shelves β†’ Books β†’ Chapters β†’ Pages) that makes documentation easy to write and easy to find. With Hostim.dev, you can deploy BookStack with Docker, a managed MySQL database, and persistent storage in one click – complete with automatic domain and HTTPS.

πŸ“– A clean, searchable wiki for your team – without managing servers.

Try it Yourself

Guest project runs for 1 hour. Log in to save and extend to 5 days.

Why Host BookStack on Hostim.dev?​

  • One-click Docker deployment
  • Managed MySQL database (no manual setup)
  • Persistent volume (/config) for uploads and attachments
  • Automatic HTTPS and domain
  • Real-time logs and metrics
  • Fully self-hosted and private

What's included​

ResourceDetails
Applscr.io/linuxserver/bookstack image
DatabaseManaged MySQL
Volume/config
DomainFree *.hostim.dev subdomain
SSLLet’s Encrypt (auto-enabled)
Port80

How to Deploy​

  1. Go to your Hostim.dev dashboard.
  2. Click Create Project β†’ Use a Template.
  3. Select BookStack.
  4. Choose a resource plan.
  5. Deploy.

The APP_URL, APP_KEY, and database connection are configured automatically.

⚠️ Default login: admin@admin.com / password. Change both immediately at /my-account/auth after your first sign-in.


FAQ​

Frequently asked questions

What database does BookStack require β€” is PostgreSQL supported?

BookStack requires MySQL 8.0 or newer, or MariaDB 10.6 or newer. PostgreSQL is not supported and there is no SQLite option. BookStack is a Laravel application that uses the MySQL driver and the pdo_mysql PHP extension, so a MySQL-compatible database is mandatory.

Which MySQL and MariaDB versions does BookStack support?

MySQL 8.0 and above, or MariaDB 10.6 and above. Older versions such as MySQL 5.7 or MariaDB 10.3 are below the supported minimum and can fail during the database migration step.

What are the full BookStack system requirements?

PHP 8.2 or newer with the curl, dom, gd, iconv, mbstring, mysqlnd, openssl, pdo, pdo_mysql, tokenizer, xml and zip extensions; MySQL 8.0+ or MariaDB 10.6+; a PHP-compatible web server; and Composer for dependency installation. The official Docker image bundles PHP and the web server, so only the database is left to provide.

How do I generate the BookStack APP_KEY?

Run: docker run -it --rm --entrypoint /usr/bin/php lscr.io/linuxserver/bookstack:latest /app/www/artisan key:generate --show. Copy the resulting base64: string into the APP_KEY environment variable. On Hostim the key is generated for you.

What are the default BookStack login credentials?

The first admin account is admin@admin.com with the password 'password'. Change both immediately after the first sign-in, under /my-account/auth.

Where does BookStack store uploads and images?

Uploaded files, images and attachments live in the /config volume. Page, book and shelf content lives in the MySQL or MariaDB database. Both must be persisted.

How do I back up BookStack?

Back up two things: a mysqldump of the BookStack database, and the /config volume that holds uploaded files and images. Restoring either one alone gives an incomplete instance.

How do I update BookStack running in Docker?

Run 'docker compose pull && docker compose up -d' to pull the newer image and recreate the container. Database migrations run automatically at container start. On Hostim, redeploy the app to pull the latest image.

Can I use a custom domain with BookStack?

Yes. Point the domain at the app and set APP_URL to the final URL, including the scheme. If APP_URL does not match, links, images and redirects resolve to the wrong host.

Does BookStack support Markdown?

Yes. Every page can be edited with either the WYSIWYG editor or a Markdown editor, switchable per page in the editor settings.


Alternatives​

  • Wiki.js β€” Node.js wiki with a modern editor
  • Outline β€” team knowledge base with real-time collaboration
  • DokuWiki β€” lightweight, file-based wiki (no database)

Source + Docs​


Looking for something else? Browse all templates β†’


Try it now​

Deploy BookStack Now – in less than 60 seconds