Skip to content

Instantly share code, notes, and snippets.

@ssddanbrown
Last active August 28, 2025 09:49
Show Gist options
  • Select an option

  • Save ssddanbrown/7f2a045b612dbfcc029abe6d27c7dc58 to your computer and use it in GitHub Desktop.

Select an option

Save ssddanbrown/7f2a045b612dbfcc029abe6d27c7dc58 to your computer and use it in GitHub Desktop.
bookstack-npm-docker-compose
---
version: "2"
services:
bookstack:
image: lscr.io/linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=https://wiki.bookstackapp.com
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASS=mydatabasepassword
- DB_DATABASE=bookstackapp
volumes:
- ./bookstack:/config
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: lscr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=mysecretrootpassword
- TZ=Europe/London
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=mydatabasepassword
volumes:
- ./database:/config
restart: unless-stopped
proxy:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx_proxy_manager
ports:
# Public HTTP Port:
- '80:80'
# Public HTTPS Port:
- '443:443'
# Admin Web Port:
- '81:81'
environment:
# If you would rather use Sqlite uncomment this
# and remove all DB_MYSQL_* lines above
DB_SQLITE_FILE: "/data/database.sqlite"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ./proxy/data:/data
- ./proxy/letsencrypt:/etc/letsencrypt
restart: unless-stopped
networks:
default:
external:
name: web
@dw5

dw5 commented Jun 5, 2023

Copy link
Copy Markdown

docker-compose.yml: yaml: unmarshal errors:
line 53: mapping key "restart" already defined at line 36
👍

@ssddanbrown

Copy link
Copy Markdown
Author

Thanks @dw5, have updated it to fix the duplicate line.

@dishoneprabu

Copy link
Copy Markdown

How to setup Bookstack Email on bookstack container.

@dishoneprabu

dishoneprabu commented Jul 6, 2023

Copy link
Copy Markdown

After adding this env in the compose file it works✌️.

MAIL_DRIVER=smtp
MAIL_FROM_NAME="BookStack"
MAIL_FROM=bookstack@example.com
MAIL_HOST=localhost
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

@fitzdoingprojects

Copy link
Copy Markdown

I spent an evening trying to track down a bug in this docker_compose.yml file. It looks like linuxserver now requires that the environment configuration use the 'DB_USERNAME' instead of 'DB_USER' and 'DB_PASSWORD' instead of 'DB_PASS'

@LikesToys

Copy link
Copy Markdown

I spent an evening trying to track down a bug in this docker_compose.yml file. It looks like linuxserver now requires that the environment configuration use the 'DB_USERNAME' instead of 'DB_USER' and 'DB_PASSWORD' instead of 'DB_PASS'

Yes - I wasted a day and a half - totally messed me up. I don't think anyone should be copying .yaml and loading it as a base. At least point to the source, which I believe has it corrected.

@LikesToys

Copy link
Copy Markdown

Thanks @dw5, have updated it to fix the duplicate line.

this needs another update - see comments below:
I spent an evening trying to track down a bug in this docker_compose.yml file. It looks like linuxserver now requires that the environment configuration use the 'DB_USERNAME' instead of 'DB_USER' and 'DB_PASSWORD' instead of 'DB_PASS'

@ssddanbrown

Copy link
Copy Markdown
Author

I've updated this gist with links to more up-to-date configs, and removed the compose content by default to avoid providing wrong outdated information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment