BookStack is a self-hosted wiki for documentation and knowledge. Organize content like a library: shelves contain books, books contain chapters and pages. Write pages in a WYSIWYG editor or in Markdown, with images, attachments, tables, and diagrams. Every change is saved as a revision in the history, and full-text search finds content across all books. Use roles to define who can read and edit what. BookStack is a PHP application based on Laravel and stores everything in a MariaDB database.
In this guide, we show you two ways to get started: the easy way with a One-Click App, which makes BookStack available over HTTPS in just a few minutes, and a manual installation with Docker Compose. After that, you’ll build your wiki’s structure, invite colleagues, and configure email delivery.
BookStack is a good fit wherever you need to collect and maintain knowledge in one place. It’s worth using on a VPS if:
- You want to create internal documentation for your team, club, or community, such as guides, processes, or server documentation.
- You need a clear structure instead of scattered notes. Shelves, books, and chapters provide a fixed structure, even for large collections.
- You want to keep your data with you instead of storing it with a cloud service. The database and uploads are stored on your server.
- Multiple people need to work with different permissions. BookStack comes with roles such as Admin, Editor, and Viewer, and you can add your own.
- You’re looking for a lightweight tool. On our test VPS, BookStack and MariaDB together used around 180 MB of RAM while idle.
BookStack is less suitable if you want to keep personal notes with links in the style of a Zettelkasten. Obsidian is designed for that. BookStack also isn’t intended for collaborating on Office files or for file storage. For those purposes, use Nextcloud.
The quickest way to get BookStack is through your VPS’s One-Click Apps. The app includes the MariaDB database and is directly accessible over HTTPS with a domain. You don’t need a reverse proxy, certificate, or firewall rules.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps to learn how.
- For BookStack and MariaDB, plan for at least 1 vCPU core, 512 MB RAM, and 3 GB of storage. We recommend 2 vCPU cores, 1 GB RAM, and 10 GB of storage, especially if you upload a lot of images and attachments.
- Open your VPS in the ZapX dashboard and switch to the One-Click Apps tab.
- Search the app catalog for BookStack and click Install app.
- Use a custom subdomain or zap.cloud is already selected, with a random name. Leave the option enabled or enter your own name, such as
wikiordocs. - Under App configuration, enter the email address you want to use to sign in as the admin in
BOOKSTACK_ADMIN_EMAIL. If you don’t enter an address,admin@example.comis used. Use a valid address; the app won’t start if the address is invalid. The panel automatically generates the password (SERVICE_PASSWORD_ADMIN), database credentials, and app key. You can fill in the optional email delivery fields (MAIL_HOST,MAIL_USERNAME, and so on) now or add them later. See “Email via SMTP for Invitations.” - Click Queue installation.
After two to three minutes, the app card shows Online. On its first start, BookStack creates the database tables and then replaces BookStack’s default account with your admin account.
- Open the App environment tab using the gear icon on the app card. Under Automatically generated values, you’ll find the password as
SERVICE_PASSWORD_ADMIN. Click the eye icon to show it or the icon next to it to copy it. - Open BookStack using the Access link on the app card. You’ll land on the Log In page.
- Enter the address from
BOOKSTACK_ADMIN_EMAILunder Email and the generated password under Password.
BookStack’s publicly known default login (admin@admin.com with the password password) isn’t used by the One-Click App: the installation replaces it on first startup, before anyone can access the site.
The admin account is created once using BOOKSTACK_ADMIN_EMAIL and SERVICE_PASSWORD_ADMIN. Changing the email address later in App environment won’t change your account. From then on, manage your email address and password directly in BookStack, as described in the next section.
The generated password is long and random, so you can keep using it. If you want to enter your own password or name, you can do so in BookStack:
- Click Admin in the top-right corner, then click My Account.
- Under Profile Details, enter your name under Name and change Email if needed. Click Save.
- In Access & Security, under Change Password, enter your current password under Confirm Current Password, enter a new one under New Password and Confirm New Password, then click Update. App environment will still show the original password, so save your new password in your password manager.
- In the same section, use Manage under Multi-Factor Authentication to set up a second factor, such as an authenticator app.
After installation, no one can create a new account themselves: self-registration is disabled by default. Find the setting under Settings > Registration. Leave Enable registration disabled if you want access to be limited to invited users.
The panel automatically sets your wiki’s address in APP_URL, using https://. All links, images, and stylesheets depend on this value. If you later change the app’s domain under App actions, links and images in existing pages will still point to the old address. In that case, connect to your VPS via SSH and replace the address in the database:
docker exec $(docker ps -q --filter name=bookstack-) php /app/www/artisan bookstack:update-url https://alte-adresse.example.com https://neue-adresse.example.com
If multiple BookStack instances are running on the server, replace the expression in $(...) with the correct container name from docker ps.
Update BookStack in the app settings (gear icon) under App update. Click Check for updates and install a new version with Apply update. If it says the app is up to date, there isn’t a newer version in the app catalog yet. BookStack handles any necessary database changes on startup.
Pages, uploads, and settings are stored in the app’s data volumes and are preserved during updates. Back up the entire VPS under Backups in the dashboard. To back up BookStack on its own, use the built-in tool; see “Back Up Your Data” in the manual installation section for details. For the One-Click App, use this command:
docker exec $(docker ps -q --filter name=bookstack-) php /app/www/bookstack-system-cli backup /config/backups/bookstack-backup.zip
The file will then be in the app’s data volume, in the backups folder.
The rest of this guide describes a manual installation of BookStack with Docker Compose on your VPS. You might choose this, for example, if you don’t use One-Click Apps on your server or want to run BookStack behind your own reverse proxy. We use the same linuxserver.io images as the One-Click App.
- A Linux VPS running Debian or Ubuntu, with SSH access. See First Access via SSH.
- Docker and Docker Compose (Compose v2). See Install Docker. Check the installation with
docker --versionanddocker compose version. - A domain or subdomain whose A record points to your VPS’s IP address (e.g.
wiki.example.com).
The values below are for BookStack and MariaDB together. If you’re running more on the server, add the requirements for your other apps.
| Hardware | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU core | 2 vCPU cores |
| RAM | 512 MB | 1 GB |
| Storage | 3 GB | 10 GB |
BookStack listens on port 80 inside the container. In this guide, you’ll access BookStack only through a reverse proxy, while the database remains entirely within the internal Docker network. With ufw, allow only SSH and the ports used by the reverse proxy:
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Ports published by Docker with ports: are accessible from outside even if ufw blocks them. Docker adds its own rules before those of ufw. So, as described below, bind BookStack only to 127.0.0.1. See Firewall Management on Linux for more information about the firewall.
Create a directory for BookStack:
mkdir -p /opt/bookstack
cd /opt/bookstack
BookStack needs an app key. Among other things, it encrypts sessions and two-factor authentication data. Generate one using the image itself:
docker run -it --rm --entrypoint /bin/bash lscr.io/linuxserver/bookstack:26.09.3 appkey
The command outputs a line that begins with base64:. Then create the .env file (nano .env) and enter the key and two strong, unique passwords for the database:
APP_URL=https://wiki.example.com
APP_KEY=base64:DEIN_SCHLUESSEL
DB_PASSWORD=LANGES_PASSWORT_1
DB_ROOT_PASSWORD=LANGES_PASSWORT_2
Protect the file with chmod 600 .env. Then create the docker-compose.yml file and add this content:
services:
bookstack:
image: lscr.io/linuxserver/bookstack:26.09.3
container_name: bookstack
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
- APP_URL=${APP_URL}
- APP_KEY=${APP_KEY}
- DB_HOST=mariadb
- DB_PORT=3306
- DB_USERNAME=bookstack
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE=bookstack
volumes:
- ./bookstack:/config
ports:
- "127.0.0.1:6875:80"
depends_on:
mariadb:
condition: service_healthy
mariadb:
image: lscr.io/linuxserver/mariadb:11.8.9
container_name: bookstack-db
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MYSQL_DATABASE=bookstack
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=${DB_PASSWORD}
volumes:
- ./mariadb:/config
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"]
interval: 5s
timeout: 20s
retries: 10
Here’s what the important lines mean:
image: BookStack and MariaDB from linuxserver.io at fixed versions. This lets you decide when to update.APP_URL: The address where your wiki is available, includinghttps://and without a trailing slash. If it’s incorrect, pages won’t load styles and links won’t work.APP_KEY: The key you just generated. Keep it safe and don’t change it later, or features such as configured two-factor authentication may stop working.DB_*andMYSQL_*: Database credentials. The username and password must match for both services../bookstack:/configand./mariadb:/config: These are where uploads, attachments, configuration, and the database are stored. Back up these folders later.healthcheckanddepends_on: BookStack starts only once the database is accepting connections. This prevents table setup from failing on first startup.127.0.0.1:6875:80: BookStack is accessible only from the server itself, and from outside only through the reverse proxy. The database doesn’t publish a port.
Pull the images and start both containers:
docker compose pull
docker compose up -d
docker compose logs -f bookstack
BookStack is ready when the log shows the line [ls.io-init] done.. Before that, on its first startup, BookStack creates the database tables. Exit the log view with Strg+C.
Until the reverse proxy is set up, open BookStack through an SSH tunnel. Run this command on your own PC:
ssh -L 6875:127.0.0.1:6875 root@SERVER_IP
Then open http://localhost:6875 in your browser and sign in with BookStack’s default account: admin@admin.com with the password password. These credentials are listed in the official documentation and are publicly known. So, immediately replace the email address and password as described above in “Set a Custom Password and Enable Two-Factor Authentication,” entering password as your current password. Only then should you make BookStack publicly accessible through the reverse proxy.
Since APP_URL already points to your future domain, the page may appear without styles in the tunnel. You can still sign in and change your profile. Once the reverse proxy is running, everything will look normal.
To access BookStack from outside, set up a reverse proxy with a valid certificate in front of it. Find the basics in Set Up a Reverse Proxy with nginx and Create an SSL Certificate (Let's Encrypt). Here’s a server block for nginx:
server {
listen 80;
server_name wiki.example.com;
client_max_body_size 50M;
location / {
proxy_pass http://127.0.0.1:6875;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
Then obtain the certificate with certbot --nginx -d wiki.example.com. Certbot adds HTTPS and HTTP redirection to the block. client_max_body_size sets the maximum size for uploaded images and attachments. The domain must match APP_URL exactly.
Find more tips for securing your server in Linux Security Tips.
BookStack includes its own backup tool, the BookStack System CLI. It packages the database, the .env file, uploads, attachments, and themes into a ZIP file:
docker exec bookstack php /app/www/bookstack-system-cli backup /config/backups/bookstack-backup-$(date +%F).zip
The file will then be on the server at /opt/bookstack/bookstack/backups. It also contains the app key and database credentials, so treat it like a password and don’t store it only on the VPS itself. You can restore the backup to a fresh installation with the restore command from the same tool.
Alternatively, back up the two folders directly. Briefly stop the containers first:
cd /opt/bookstack
docker compose stop
tar czf bookstack-backup-$(date +%F).tar.gz bookstack mariadb .env docker-compose.yml
docker compose start
Create a backup first, as described above. Then enter the new version for the image in docker-compose.yml and restart:
cd /opt/bookstack
docker compose pull
docker compose up -d
docker image prune
Available versions are listed on the image release page, and changes to BookStack itself are covered on the project blog. The container applies any necessary database changes on startup. Don’t jump blindly between major versions; read the update notes on the blog first. docker image prune then removes the old images.
After setup, fill your wiki with content and give others access.
BookStack organizes content into four levels:
| Level | Purpose | Example |
|---|---|---|
| Shelf | Groups books by topic | “IT,” “Club” |
| Book | A self-contained topic | “Server Documentation” |
| Chapter | Optionally organizes a book | “Backups” |
| Page | The actual content | “VPS Backup Plan” |
Create your first structure like this:
- Click Books at the top, then click Create New Book. Enter a name and click Save Book.
- In the book, use New Chapter to create chapters and New Page to create pages.
- Write the page in the editor and click Save Page. Add images by dragging and dropping them, and add attachments using the paperclip icon in the sidebar.
- Under Shelves, click New Shelf to create a shelf and assign books to it.
You can write pages in the WYSIWYG editor or in Markdown. Set the default under Settings > Customization, in Default Page Editor. You can find every saved change later under Revisions, where you can compare or restore it.
Create additional users under Settings > Users by clicking Add New User. BookStack comes with three roles:
- Admin: Can do everything, including changing settings and users.
- Editor: Can create and edit content.
- Viewer: Can only read.
Customize these roles or create your own under Settings > Roles. Assign more specific permissions directly to shelves, books, chapters, or pages using Permissions. For example, you can make a book visible to only one group.
If you want to show individual content without requiring a login, enable Public Access under Settings > Features & Security. Visitors will then have the permissions of the Public role. Check this role first to make sure only approved books are visible.
Without email delivery, you have to set a password yourself for each new user. With SMTP, BookStack can send invitations that let people set their own passwords, and “Forgot Password?” will work. You’ll need the SMTP details for an email account.
For the One-Click App, enter the values in the app settings (gear icon) under App environment, then click Save. The app will restart. For a manual installation, add them to the environment section of the bookstack service and restart with docker compose up -d.
| Variable | Meaning | Example |
|---|---|---|
MAIL_HOST | SMTP server | smtp.example.com |
MAIL_PORT | Port | 587 |
MAIL_ENCRYPTION | tls forces an encrypted connection: STARTTLS on port 587, or a direct connection on port 465 | tls |
MAIL_USERNAME | Email account username | wiki@example.com |
MAIL_PASSWORD | Email account password | |
MAIL_FROM | Sender address | wiki@example.com |
MAIL_FROM_NAME | Sender name | BookStack |
Then test email delivery under Settings > Maintenance, in the Send a Test Email section, by clicking Send test email. The test email will be sent to the email address in your profile. If it doesn’t arrive, first check the email account’s server, port, and credentials. When creating a user, you can then select Send user invite email.
- No real-time collaborative editing: If two people edit the same page at the same time, BookStack warns you but doesn’t merge the changes.
- Fixed structure: Pages are always part of a book. There’s no free-form linking like in a Zettelkasten; add cross-references as regular links.
- Not a file storage system: Attachments are intended for documents related to a page, not as a replacement for file storage.
- Logins through other services require configuration: BookStack supports single sign-on via OIDC or SAML, but you need to configure it using environment variables, for example with Keycloak or authentik.
BookStack gives you a clear, organized wiki that structures knowledge into shelves, books, chapters, and pages, with detailed permission controls. The One-Click App creates your admin account using your own email address and a generated password. With a manual installation, replace the default login admin@admin.com immediately after your first visit. Then create your structure, invite colleagues, and back up your wiki regularly.
Prefer to skip the Docker setup? Take the easy route with the One-Click App, as described above in “The Easy Way: BookStack as a One-Click App.”
