BookStack Documentation
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.04 container_name: bookstack-mysql5 restart: unless-stopped6 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/mysql13 networks: 14 - bookstack-network1516 bookstack: 17 image: lscr.io/linuxserver/bookstack:latest18 container_name: bookstack19 restart: unless-stopped20 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=mysql28 - DB_DATABASE=${MYSQL_DATABASE:-bookstack}29 - DB_USERNAME=${MYSQL_USER:-bookstack}30 - DB_PASSWORD=${MYSQL_PASSWORD:-bookstack}31 volumes: 32 - bookstack_data:/config33 depends_on: 34 - mysql35 networks: 36 - bookstack-network3738volumes: 39 mysql_data: 40 bookstack_data: 4142networks: 43 bookstack-network: 44 driver: bridge.env Template
.env
1# BookStack2BOOKSTACK_PORT=68753APP_URL=http://localhost:68754MYSQL_ROOT_PASSWORD=root5MYSQL_DATABASE=bookstack6MYSQL_USER=bookstack7MYSQL_PASSWORD=bookstack8PUID=10009PGID=100010TZ=UTCUsage Notes
- 1BookStack at http://localhost:6875
- 2Default login: admin@admin.com/password
- 3Change password immediately
- 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 file2cat > docker-compose.yml << 'EOF'3services:4 mysql:5 image: mysql:8.06 container_name: bookstack-mysql7 restart: unless-stopped8 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/mysql15 networks:16 - bookstack-network1718 bookstack:19 image: lscr.io/linuxserver/bookstack:latest20 container_name: bookstack21 restart: unless-stopped22 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=mysql30 - DB_DATABASE=${MYSQL_DATABASE:-bookstack}31 - DB_USERNAME=${MYSQL_USER:-bookstack}32 - DB_PASSWORD=${MYSQL_PASSWORD:-bookstack}33 volumes:34 - bookstack_data:/config35 depends_on:36 - mysql37 networks:38 - bookstack-network3940volumes:41 mysql_data:42 bookstack_data:4344networks:45 bookstack-network:46 driver: bridge47EOF4849# 2. Create the .env file50cat > .env << 'EOF'51# BookStack52BOOKSTACK_PORT=687553APP_URL=http://localhost:687554MYSQL_ROOT_PASSWORD=root55MYSQL_DATABASE=bookstack56MYSQL_USER=bookstack57MYSQL_PASSWORD=bookstack58PUID=100059PGID=100060TZ=UTC61EOF6263# 3. Start the services64docker compose up -d6566# 4. View logs67docker compose logs -fOne-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 | bashTroubleshooting
- 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
Components
bookstackmysql
Tags
#bookstack#documentation#wiki#knowledge-base#mysql
Category
Productivity & CollaborationAd Space
Shortcuts: C CopyF FavoriteD Download