How to Install BookStack (A Self-Hosted Wiki for Your Home Server Notes)

Eighty tutorials in, your server does a lot — and in six months you won't remember which port Immich is on, why that firewall rule exists, or how the Minecraft backups work. BookStack is a wiki that's simple enough to actually use: shelves hold books, books hold chapters and pages, the editor is a normal rich-text box with code blocks and image paste, and search finds anything. It's also fine for the household: Wi-Fi password, boiler instructions, where the stopcock is.
Quick reference
| Task | What |
|---|---|
| Folder | ~/docker/bookstack/compose.yaml |
| Web | http://server-ip:6875 |
| Default login | admin@admin.com / password — change it |
| Structure | Shelf → Book → Chapter → Page |
| Back up | ./config + the database container's volume |
| Export | any book → Export → PDF / HTML / Markdown |
1. The compose file
mkdir -p ~/docker/bookstack && cd ~/docker/bookstack
nano compose.yaml
services:
bookstack:
image: lscr.io/linuxserver/bookstack:latest
container_name: bookstack
environment:
PUID: 1000
PGID: 1000
TZ: Europe/London
APP_URL: http://192.168.1.50:6875
APP_KEY: ${APP_KEY}
DB_HOST: bookstack_db
DB_PORT: 3306
DB_USER: bookstack
DB_PASS: ${DB_PASSWORD}
DB_DATABASE: bookstackapp
volumes:
- ./config:/config
ports:
- "6875:80"
depends_on:
- bookstack_db
restart: unless-stopped
bookstack_db:
image: lscr.io/linuxserver/mariadb:latest
container_name: bookstack_db
environment:
PUID: 1000
PGID: 1000
TZ: Europe/London
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: bookstackapp
MYSQL_USER: bookstack
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- ./db:/config
restart: unless-stopped
.env (tutorial 59):
APP_KEY=base64:REPLACE_ME
DB_PASSWORD=long-random
DB_ROOT_PASSWORD=another-long-random
Generate the app key with docker run -it --rm --entrypoint /bin/bash lscr.io/linuxserver/bookstack:latest appkey and paste the whole base64:... value. APP_URL must be the address you'll use — change it later if you move behind a proxy.
docker compose up -d
sudo ufw allow 6875/tcp
2. First login
http://192.168.1.50:6875, admin@admin.com / password. Click the profile → Edit profile → change the email and password now.
3. Structure that works for a home server
- Shelf: Home Server
- Book: Services — a page per app: what it is, the port, the compose folder, how to update, anything odd.
- Book: Network — IP reservations, DNS names, firewall rules and why each exists, port forwards.
- Book: Backups — what runs when, where it goes, how to restore (tutorial 23's test, written down).
- Book: Runbooks — "if X breaks, do Y" from tutorial 80.
- Shelf: House — Wi-Fi, appliances, insurance, who to call.
Write the Services book now while you remember. Future you is the reader.
4. The editor
Rich text by default (Markdown available per page). Paste a screenshot straight in. Code blocks with language highlighting for compose files and commands. [[ links pages to each other. Drafts save automatically; every page keeps revision history.
5. Who sees what
Settings → Roles: the built-in Viewer role can read but not edit — right for family. Per shelf or book, Permissions can hide the server shelf from the household and show them only the House shelf.
6. Back up and export
The content is in the database (./db) plus uploaded images in ./config. Back up both; or Settings → Maintenance has nothing for this, so rely on the normal backups (tutorial 65 — dump the database). For a human-readable copy, any book → Export → Contained Web File or PDF, kept in your backups too.
Behind the proxy
wiki.example.com → 127.0.0.1:6875, then set APP_URL to https://wiki.example.com and docker compose up -d. Links and images break if APP_URL doesn't match what's in the browser.
Troubleshooting
Images or CSS don't load. APP_URL is wrong for how you're reaching it.
"No application encryption key". APP_KEY missing or not the full base64: string.
Database connection refused on first start. The database container was still initialising. docker compose restart bookstack.
Lost the admin password. docker compose exec bookstack php /app/www/artisan bookstack:reset-admin (or create a new admin via the artisan command in the docs).
Wrapping up
Two containers, change the default login, a shelf for the server and one for the house. Twenty minutes writing down what each service is and how to update it will repay itself the first time something breaks at midnight — and the family finally has somewhere to find the Wi-Fi password.
