Skip to main content

BookStack Installation Guide

This Guide goes trough steps necessary for creating a good well organized step by step process. This guide walks you through deploying BookStack using Docker and Docker Compose, with a working configuration that includes MariaDB, proper environment variables, and SSL disabled for local development.

BoookStack Installation Documentation

GitHub Repository

Prerequisites
  • Docker and Docker Compose installed
  • Portainer or terminal access

Steps

These steps are for terminal access

  1. Create Project Directory
mkdir ~/bookstack-docker
cd ~/bookstack-docker
  1. Generate Larvel app Key
docker run -it --rm --entrypoint /bin/bash lscr.io/linuxserver/bookstack:latest appkey
  1. Create docker-compose.yml

- Change 'supersecurepassword' with unique password. Make sure they match for both environments

version: '3.8'

services:
  bookstack:
    image: lscr.io/linuxserver/bookstack:latest
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - APP_URL=http://localhost:6875
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USERNAME=bookstack_user
      - DB_PASSWORD=supersecurepassword
      - DB_DATABASE=bookstack
      - APP_KEY=base64:YOUR_GENERATED_KEY_HERE
    volumes:
      - bookstack_config:/config
    ports:
      - 6875:80
    depends_on:
      - bookstack_db
    restart: unless-stopped

  bookstack_db:
    image: mariadb:10.5
    container_name: bookstack_db
    command: --ssl=OFF
    environment:
      - MYSQL_ROOT_PASSWORD=rootpassword
      - MYSQL_DATABASE=bookstack
      - MYSQL_USER=bookstack_user
      - MYSQL_PASSWORD=supersecurepassword
    volumes:
      - ./bookstack/db:/var/lib/mysql
    restart: unless-stopped

volumes:
  bookstack_config:
  1. Start the Stack
docker-compose up -d
  • This will create containers, initialize the database, run Larvel migrations and serve BookStack on port 6875
  1. Check Logs
    1. This will check if the bookstack started correctly. You should see Larvel migrations completing and no errors about SSL or DB access
docker logs bookstack
  1. Inspect App Files
    1. You should see Laravel files like artisan, routes/, app/, etc.
docker exec -it bookstack /bin/bash
ls /app/www
  1. Create Admin User
    1. Once completed and app is running properly, creating a local user with strong password is great way. Do this inside container
docker exec -it bookstack /bin/bash
cd /app/www
php artisan bookstack:create-admin

Optional Enhancements

  • Presistent uploads/themes
volumes:
  - ./bookstack/uploads:/config/www/uploads
  - ./bookstack/themes:/config/www/themes