Skip to main content

Bookstack

Bookstack installation

Change port to 6975

$docker directory = /home/docker .... etc 

Docker-Compose file reference

https://github.com/solidnerd/docker-bookstack/blob/master/docker-compose.yml

 

version: '2'
services:
  mysql:
  image: mysql:8.0
  environment:
  - MYSQL_ROOT_PASSWORD=secret
  - MYSQL_DATABASE=bookstack
  - MYSQL_USER=bookstack
  - MYSQL_PASSWORD=secret
  volumes:
  - mysql-data:/var/lib/mysql

  bookstack:
  image: solidnerd/bookstack:22.10.2
  depends_on:
  - mysql
  environment:
  - DB_HOST=mysql:3306
  - DB_DATABASE=bookstack
  - DB_USERNAME=bookstack
  - DB_PASSWORD=secret
  #set the APP_ to the URL of bookstack without without a trailing slash APP_URL=https://example.com
  - APP_URL=http://example.com
 xxx.xxxmydomainxxx.duckdns.org volumes:
  - $docker/public-uploads:/var/www/bookstack/public/uploads
  - $docker/storage-uploads:/var/www/bookstack/storage/uploads
  ports:
  - "8080:6975:8080"

Backup and Restore

Files Backup:

tar -czvf bookstack-files-backup.tar.gz public-uploads storage-uploads

Restore:

tar -xvzf bookstack-files-backup.tar.gz

Database backup:

sudo docker exec bookstack_mysql_1 /usr/bin/mysqldump -u root --password=secret bookstack > /$docker/bookstack/bookstack_db.sql

Restore:

sudo docker exec -i bookstack_mysql_1 mysql -u root --password=secret bookstack < /$docker/bookstack/bookstack_db.sql
  • bookstack_mysql1 is the container name
  • password is secret or the database password

Reverse Proxy

Use subdomain in proxy manager.