docker.recipes

BookStack Documentation

beginner

BookStack documentation platform with MySQL.

Overview

BookStack is an open-source, self-hosted documentation platform designed to create and organize technical documentation, wikis, and knowledge bases. Originally developed by Dan Brown in 2015 as a PHP application, BookStack provides an intuitive interface for creating structured documentation through its three-tier organization system of books, chapters, and pages. The platform features a WYSIWYG editor, robust search capabilities, user management, and permission controls that make it ideal for teams needing collaborative documentation solutions. This stack combines BookStack with MySQL 8.0 to create a robust documentation platform where MySQL serves as the primary database backend for storing all content, user data, and application metadata. MySQL's proven reliability and performance characteristics make it an excellent choice for BookStack's content management needs, particularly when handling large documentation repositories with frequent read operations. The MySQL InnoDB storage engine provides ACID compliance for data integrity while supporting full-text search capabilities that enhance BookStack's search functionality. This combination is particularly valuable for development teams, technical writers, and organizations requiring structured knowledge management with strong database reliability. The stack offers excellent performance for content-heavy applications where documentation grows over time, leveraging MySQL's optimized query processing for BookStack's hierarchical content structure. IT departments and growing companies will appreciate the scalability this pairing provides, allowing documentation systems to expand from small team wikis to enterprise-wide knowledge bases without requiring database migrations or architectural changes.

Key Features

  • Three-tier content organization system with books, chapters, and pages for structured documentation hierarchy
  • WYSIWYG editor with markdown support and custom HTML capabilities for flexible content creation
  • MySQL full-text search integration providing fast content discovery across large documentation repositories
  • Role-based permission system with granular access controls down to individual page levels
  • BookStack's drawing tool integration for creating diagrams and visual documentation directly within pages
  • MySQL InnoDB storage engine ensuring ACID compliance and data integrity for all documentation content
  • Advanced page templating system for consistent documentation formatting across teams
  • BookStack's audit logging capabilities tracking all content changes and user activities

Common Use Cases

  • 1Software development teams creating technical documentation and API guides with version control
  • 2IT departments building internal knowledge bases for procedures, troubleshooting guides, and system documentation
  • 3Technical writing teams managing product documentation with collaborative editing and review workflows
  • 4Educational institutions creating course materials and student resources with structured access controls
  • 5Engineering teams documenting infrastructure, deployment procedures, and operational runbooks
  • 6Product management teams maintaining feature specifications, requirements, and project documentation
  • 7Customer support teams building comprehensive help centers and FAQ systems with search capabilities

Prerequisites

  • Docker and Docker Compose installed on host system
  • Minimum 1GB RAM recommended for MySQL 8.0 optimal performance with BookStack workloads
  • Port 6875 available for BookStack web interface access
  • Basic understanding of MySQL database concepts for maintenance and backup procedures
  • At least 5GB free disk space for MySQL data storage and BookStack file uploads
  • Administrative access to configure environment variables and manage container permissions

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 mysql:
3 image: mysql:8.0
4 container_name: bookstack-mysql
5 restart: unless-stopped
6 environment:
7 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
8 MYSQL_DATABASE: ${MYSQL_DATABASE:-bookstack}
9 MYSQL_USER: ${MYSQL_USER:-bookstack}
10 MYSQL_PASSWORD: ${MYSQL_PASSWORD:-bookstack}
11 volumes:
12 - mysql_data:/var/lib/mysql
13 networks:
14 - bookstack-network
15
16 bookstack:
17 image: lscr.io/linuxserver/bookstack:latest
18 container_name: bookstack
19 restart: unless-stopped
20 ports:
21 - "${BOOKSTACK_PORT:-6875}:80"
22 environment:
23 - PUID=${PUID:-1000}
24 - PGID=${PGID:-1000}
25 - TZ=${TZ:-UTC}
26 - APP_URL=${APP_URL:-http://localhost:6875}
27 - DB_HOST=mysql
28 - DB_DATABASE=${MYSQL_DATABASE:-bookstack}
29 - DB_USERNAME=${MYSQL_USER:-bookstack}
30 - DB_PASSWORD=${MYSQL_PASSWORD:-bookstack}
31 volumes:
32 - bookstack_data:/config
33 depends_on:
34 - mysql
35 networks:
36 - bookstack-network
37
38volumes:
39 mysql_data:
40 bookstack_data:
41
42networks:
43 bookstack-network:
44 driver: bridge

.env Template

.env
1# BookStack
2BOOKSTACK_PORT=6875
3APP_URL=http://localhost:6875
4MYSQL_ROOT_PASSWORD=root
5MYSQL_DATABASE=bookstack
6MYSQL_USER=bookstack
7MYSQL_PASSWORD=bookstack
8PUID=1000
9PGID=1000
10TZ=UTC

Usage Notes

  1. 1BookStack at http://localhost:6875
  2. 2Default login: admin@admin.com/password
  3. 3Change password immediately
  4. 4Organized by books/chapters/pages

Individual Services(2 services)

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

mysql
mysql:
  image: mysql:8.0
  container_name: bookstack-mysql
  restart: unless-stopped
  environment:
    MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
    MYSQL_DATABASE: ${MYSQL_DATABASE:-bookstack}
    MYSQL_USER: ${MYSQL_USER:-bookstack}
    MYSQL_PASSWORD: ${MYSQL_PASSWORD:-bookstack}
  volumes:
    - mysql_data:/var/lib/mysql
  networks:
    - bookstack-network
bookstack
bookstack:
  image: lscr.io/linuxserver/bookstack:latest
  container_name: bookstack
  restart: unless-stopped
  ports:
    - ${BOOKSTACK_PORT:-6875}:80
  environment:
    - PUID=${PUID:-1000}
    - PGID=${PGID:-1000}
    - TZ=${TZ:-UTC}
    - APP_URL=${APP_URL:-http://localhost:6875}
    - DB_HOST=mysql
    - DB_DATABASE=${MYSQL_DATABASE:-bookstack}
    - DB_USERNAME=${MYSQL_USER:-bookstack}
    - DB_PASSWORD=${MYSQL_PASSWORD:-bookstack}
  volumes:
    - bookstack_data:/config
  depends_on:
    - mysql
  networks:
    - bookstack-network

Quick Start

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

Troubleshooting

  • BookStack shows database connection error: Verify MySQL container is running and check DB_HOST environment variable matches service name 'mysql'
  • MySQL container fails to start with permission denied: Ensure Docker has proper file system permissions and PUID/PGID values match host user
  • BookStack interface loads but shows 500 error: Check MySQL database initialization completed and credentials in environment variables match between services
  • Cannot access BookStack on port 6875: Verify BOOKSTACK_PORT environment variable is set correctly and no firewall blocking the port
  • MySQL data loss after container restart: Confirm mysql_data volume is properly mounted and persistent storage location has adequate permissions
  • BookStack file uploads fail: Check bookstack_data volume permissions and ensure sufficient disk space for file storage

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