$docker.recipes

BookStack

beginner

Simple wiki and documentation platform.

[i]Overview

BookStack is a self-hosted documentation and wiki platform built with PHP and Laravel, designed to organize information in an intuitive hierarchical structure. Created by Dan Brown in 2016, BookStack emphasizes simplicity and user-friendliness while providing powerful documentation features like WYSIWYG editing, page templates, and comprehensive search functionality. The platform uses a logical organizational system of Shelves containing Books, which contain Chapters and Pages, making it easy for teams to structure their knowledge base naturally. This deployment pairs BookStack with MariaDB 11, which serves as the primary database backend for storing all documentation content, user accounts, and application metadata. MariaDB's enhanced MySQL compatibility ensures optimal performance for BookStack's Laravel framework while providing additional features like improved connection handling through thread pooling and better storage engine options. The combination delivers a robust documentation solution that can handle everything from personal note-taking to enterprise-wide knowledge management, with MariaDB's reliability ensuring your documentation remains highly available and performant even under heavy usage.

[*]Key Features

  • [+]Hierarchical content organization with Shelves, Books, Chapters, and Pages structure for logical documentation flow
  • [+]Dual editing modes supporting both WYSIWYG visual editor and Markdown syntax for different user preferences
  • [+]Multi-format export capabilities including PDF generation, HTML export, and Markdown conversion for content portability
  • [+]Advanced search functionality with full-text indexing powered by MariaDB's enhanced search capabilities
  • [+]Role-based permission system with granular access controls at shelf, book, chapter, and page levels
  • [+]Drawing and diagramming tools with built-in image annotation and markup features
  • [+]Page templates and custom HTML support for standardized documentation formats
  • [+]MariaDB's Aria storage engine providing crash-safe operations and improved performance for BookStack's data

[#]Common Use Cases

  • [1]Technical documentation hubs for software development teams managing API docs, deployment guides, and coding standards
  • [2]IT knowledge bases storing troubleshooting procedures, network diagrams, and infrastructure documentation
  • [3]Project wikis for tracking requirements, specifications, and collaborative planning documents
  • [4]Educational institutions creating course materials, student handbooks, and research documentation
  • [5]Small business operations manuals documenting processes, procedures, and training materials
  • [6]Personal knowledge management systems for researchers and professionals organizing notes and references
  • [7]Client documentation portals for agencies and consultants sharing guides and project information

[!]Prerequisites

  • [!]Minimum 1GB RAM for optimal MariaDB performance with BookStack's database operations
  • [!]Docker and Docker Compose installed with support for environment variable substitution
  • [!]Port 6875 available for BookStack web interface access
  • [!]Environment variables configured for DB_USER, DB_PASSWORD, DB_NAME, and DB_ROOT_PASSWORD
  • [!]Basic understanding of user permission systems for configuring BookStack access controls
  • [!]Storage space planning for document uploads, images, and database growth over time
[!]

WARNING: 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: linuxserver/bookstack:latest
4 container_name: bookstack
5 restart: unless-stopped
6 environment:
7 PUID: 1000
8 PGID: 1000
9 APP_URL: http://localhost:6875
10 DB_HOST: mariadb
11 DB_USER: ${DB_USER}
12 DB_PASS: ${DB_PASSWORD}
13 DB_DATABASE: ${DB_NAME}
14 volumes:
15 - bookstack_config:/config
16 ports:
17 - "6875:80"
18 depends_on:
19 - mariadb
20 networks:
21 - bookstack
22
23 mariadb:
24 image: mariadb:11
25 container_name: bookstack-mariadb
26 environment:
27 MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
28 MARIADB_DATABASE: ${DB_NAME}
29 MARIADB_USER: ${DB_USER}
30 MARIADB_PASSWORD: ${DB_PASSWORD}
31 volumes:
32 - mariadb_data:/var/lib/mysql
33 networks:
34 - bookstack
35
36volumes:
37 bookstack_config:
38 mariadb_data:
39
40networks:
41 bookstack:
42 driver: bridge

[$].env Template

[.env]
1DB_ROOT_PASSWORD=rootpassword
2DB_NAME=bookstack
3DB_USER=bookstack
4DB_PASSWORD=changeme

[i]Usage Notes

  1. [1]Docs: https://www.bookstackapp.com/docs/
  2. [2]Access at http://localhost:6875 - default: admin@admin.com / password
  3. [3]Hierarchy: Shelves > Books > Chapters > Pages
  4. [4]WYSIWYG and Markdown editors available
  5. [5]Export to PDF, HTML, plaintext, or Markdown
  6. [6]LDAP/SAML/OAuth authentication supported for enterprise

Individual Services(2 services)

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

bookstack
bookstack:
  image: linuxserver/bookstack:latest
  container_name: bookstack
  restart: unless-stopped
  environment:
    PUID: 1000
    PGID: 1000
    APP_URL: http://localhost:6875
    DB_HOST: mariadb
    DB_USER: ${DB_USER}
    DB_PASS: ${DB_PASSWORD}
    DB_DATABASE: ${DB_NAME}
  volumes:
    - bookstack_config:/config
  ports:
    - "6875:80"
  depends_on:
    - mariadb
  networks:
    - bookstack
mariadb
mariadb:
  image: mariadb:11
  container_name: bookstack-mariadb
  environment:
    MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    MARIADB_DATABASE: ${DB_NAME}
    MARIADB_USER: ${DB_USER}
    MARIADB_PASSWORD: ${DB_PASSWORD}
  volumes:
    - mariadb_data:/var/lib/mysql
  networks:
    - bookstack

[>]Quick Start

[terminal]
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 bookstack:
5 image: linuxserver/bookstack:latest
6 container_name: bookstack
7 restart: unless-stopped
8 environment:
9 PUID: 1000
10 PGID: 1000
11 APP_URL: http://localhost:6875
12 DB_HOST: mariadb
13 DB_USER: ${DB_USER}
14 DB_PASS: ${DB_PASSWORD}
15 DB_DATABASE: ${DB_NAME}
16 volumes:
17 - bookstack_config:/config
18 ports:
19 - "6875:80"
20 depends_on:
21 - mariadb
22 networks:
23 - bookstack
24
25 mariadb:
26 image: mariadb:11
27 container_name: bookstack-mariadb
28 environment:
29 MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
30 MARIADB_DATABASE: ${DB_NAME}
31 MARIADB_USER: ${DB_USER}
32 MARIADB_PASSWORD: ${DB_PASSWORD}
33 volumes:
34 - mariadb_data:/var/lib/mysql
35 networks:
36 - bookstack
37
38volumes:
39 bookstack_config:
40 mariadb_data:
41
42networks:
43 bookstack:
44 driver: bridge
45EOF
46
47# 2. Create the .env file
48cat > .env << 'EOF'
49DB_ROOT_PASSWORD=rootpassword
50DB_NAME=bookstack
51DB_USER=bookstack
52DB_PASSWORD=changeme
53EOF
54
55# 3. Start the services
56docker compose up -d
57
58# 4. View logs
59docker 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/run | bash

[?]Troubleshooting

  • [!]BookStack shows database connection error: Verify MariaDB container is running and DB_HOST matches the MariaDB service name
  • [!]Login fails with default credentials: Check if BookStack has fully initialized by viewing logs with docker logs bookstack
  • [!]File uploads not working: Ensure bookstack_config volume has proper write permissions for PUID/PGID 1000
  • [!]MariaDB container exits with code 1: Check that all required environment variables (MARIADB_ROOT_PASSWORD, MARIADB_DATABASE) are properly set
  • [!]BookStack interface loads but images/assets missing: Verify APP_URL environment variable matches your actual access URL
  • [!]Performance issues with large wikis: Increase MariaDB memory allocation using innodb_buffer_pool_size configuration

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