docker.recipes

BookStack Documentation

beginner

Simple, self-hosted wiki platform for organizing and storing information.

Overview

BookStack is a modern, self-hosted wiki platform designed to organize and store information in a structured, searchable format. Developed in PHP and built with simplicity in mind, BookStack offers an intuitive hierarchical structure using Shelves, Books, Chapters, and Pages to organize documentation, knowledge bases, and collaborative content. The platform emphasizes ease of use while providing powerful features like real-time collaborative editing, comprehensive search capabilities, and flexible user permission systems. This deployment combines BookStack with MariaDB to create a robust documentation platform where MariaDB's enhanced MySQL compatibility and performance optimizations provide reliable data storage for wiki content, user accounts, and revision histories. MariaDB's Aria storage engine offers improved crash recovery for BookStack's frequent content updates, while its enhanced JSON functions support BookStack's metadata and configuration storage requirements. This stack is ideal for teams, organizations, and individuals who need a professional wiki solution without the complexity of enterprise platforms like Confluence. Small to medium businesses can deploy this for internal documentation, software development teams can maintain technical wikis, and educational institutions can create collaborative knowledge repositories with full control over their data and customization options.

Key Features

  • WYSIWYG and markdown editor with real-time collaborative editing and revision tracking
  • Hierarchical content organization with Shelves containing Books, Chapters, and Pages structure
  • Advanced search functionality with full-text search across all content and attachments
  • Flexible role-based permissions with granular control down to individual pages and books
  • Multiple authentication methods including LDAP, SAML, and OpenID Connect integration
  • File attachment system with image galleries and drawing tools for diagrams
  • MariaDB's Aria storage engine providing enhanced crash recovery for wiki content
  • BookStack's API integration with MariaDB's JSON functions for metadata management

Common Use Cases

  • 1Internal company wikis and knowledge bases for employee onboarding and procedures
  • 2Software development teams maintaining technical documentation and API references
  • 3Educational institutions creating collaborative learning resources and course materials
  • 4IT departments documenting infrastructure, troubleshooting guides, and system procedures
  • 5Project management teams organizing project documentation and meeting notes
  • 6Personal knowledge management for researchers and content creators
  • 7Community organizations maintaining member resources and organizational information

Prerequisites

  • Minimum 1GB RAM for MariaDB optimal performance with BookStack's content storage
  • Available port 6875 for BookStack web interface access
  • Docker and Docker Compose installed with support for bridge networks
  • Environment variables configured for TZ, APP_URL, DB_PASSWORD, and DB_ROOT_PASSWORD
  • Basic understanding of wiki concepts and content organization hierarchy
  • SSL certificate and reverse proxy knowledge for production HTTPS deployment

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 bookstack:
3 image: lscr.io/linuxserver/bookstack:latest
4 container_name: bookstack
5 environment:
6 - PUID=1000
7 - PGID=1000
8 - TZ=${TZ}
9 - APP_URL=${APP_URL}
10 - DB_HOST=db
11 - DB_PORT=3306
12 - DB_USER=bookstack
13 - DB_PASS=${DB_PASSWORD}
14 - DB_DATABASE=bookstack
15 volumes:
16 - bookstack-data:/config
17 ports:
18 - "6875:80"
19 depends_on:
20 - db
21 networks:
22 - bookstack-network
23 restart: unless-stopped
24
25 db:
26 image: mariadb:10.11
27 container_name: bookstack-db
28 environment:
29 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
30 - MYSQL_DATABASE=bookstack
31 - MYSQL_USER=bookstack
32 - MYSQL_PASSWORD=${DB_PASSWORD}
33 volumes:
34 - mariadb-data:/var/lib/mysql
35 networks:
36 - bookstack-network
37 restart: unless-stopped
38
39volumes:
40 bookstack-data:
41 mariadb-data:
42
43networks:
44 bookstack-network:
45 driver: bridge

.env Template

.env
1# BookStack
2TZ=UTC
3APP_URL=http://localhost:6875
4DB_PASSWORD=secure_bookstack_password
5DB_ROOT_PASSWORD=secure_root_password

Usage Notes

  1. 1Web UI at http://localhost:6875
  2. 2Default login: admin@admin.com / password
  3. 3Change default password immediately
  4. 4Organize with Shelves > Books > Chapters > Pages
  5. 5Supports LDAP, SAML, OIDC auth

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

bookstack
bookstack:
  image: lscr.io/linuxserver/bookstack:latest
  container_name: bookstack
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=${TZ}
    - APP_URL=${APP_URL}
    - DB_HOST=db
    - DB_PORT=3306
    - DB_USER=bookstack
    - DB_PASS=${DB_PASSWORD}
    - DB_DATABASE=bookstack
  volumes:
    - bookstack-data:/config
  ports:
    - "6875:80"
  depends_on:
    - db
  networks:
    - bookstack-network
  restart: unless-stopped
db
db:
  image: mariadb:10.11
  container_name: bookstack-db
  environment:
    - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
    - MYSQL_DATABASE=bookstack
    - MYSQL_USER=bookstack
    - MYSQL_PASSWORD=${DB_PASSWORD}
  volumes:
    - mariadb-data:/var/lib/mysql
  networks:
    - bookstack-network
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 bookstack:
5 image: lscr.io/linuxserver/bookstack:latest
6 container_name: bookstack
7 environment:
8 - PUID=1000
9 - PGID=1000
10 - TZ=${TZ}
11 - APP_URL=${APP_URL}
12 - DB_HOST=db
13 - DB_PORT=3306
14 - DB_USER=bookstack
15 - DB_PASS=${DB_PASSWORD}
16 - DB_DATABASE=bookstack
17 volumes:
18 - bookstack-data:/config
19 ports:
20 - "6875:80"
21 depends_on:
22 - db
23 networks:
24 - bookstack-network
25 restart: unless-stopped
26
27 db:
28 image: mariadb:10.11
29 container_name: bookstack-db
30 environment:
31 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
32 - MYSQL_DATABASE=bookstack
33 - MYSQL_USER=bookstack
34 - MYSQL_PASSWORD=${DB_PASSWORD}
35 volumes:
36 - mariadb-data:/var/lib/mysql
37 networks:
38 - bookstack-network
39 restart: unless-stopped
40
41volumes:
42 bookstack-data:
43 mariadb-data:
44
45networks:
46 bookstack-network:
47 driver: bridge
48EOF
49
50# 2. Create the .env file
51cat > .env << 'EOF'
52# BookStack
53TZ=UTC
54APP_URL=http://localhost:6875
55DB_PASSWORD=secure_bookstack_password
56DB_ROOT_PASSWORD=secure_root_password
57EOF
58
59# 3. Start the services
60docker compose up -d
61
62# 4. View logs
63docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/bookstack-wiki/run | bash

Troubleshooting

  • BookStack shows database connection error: Verify DB_PASSWORD matches MYSQL_PASSWORD and ensure MariaDB container is running
  • Login page shows 'Application key not set': Check APP_URL environment variable matches your actual domain and restart BookStack container
  • File uploads failing with permission errors: Ensure PUID and PGID match your host user permissions for bookstack-data volume
  • MariaDB container exits with 'Can't connect to server': Check mariadb-data volume permissions and verify MYSQL_ROOT_PASSWORD is set
  • BookStack performance slow with large wikis: Increase MariaDB memory allocation and enable query cache in MariaDB configuration
  • Authentication integration failing: Verify APP_URL uses HTTPS for SAML/OIDC and check BookStack logs for certificate validation errors

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space