How to Install BookStack on Your Synology NAS

How to Install BookStack on Your Synology NAS

From now on you can become the author of your own book! All thanks to Dan Brown, the man behind BookStack, a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor, it allows for teams to create detailed and useful documentation with ease. Bookstack is a great alternative to DokuWiki that can be used for storing and organizing information and documentation. In this step by step guide I will show you how to install BookStack on your Synology NAS using Docker & Portainer.

💡Note: This guide works perfectly with the latest Bookstack v24.10.3 release.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 3

Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.

  • STEP 4

Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.

BookStack Synology NAS Set up 1 new 2023

  • STEP 5

Now click the “Create” button. Follow the instructions in the image below.

BookStack Synology NAS Set up 2 new 2023

  • STEP 6

After you click the Create button, the window below will open. Follow the instructions in the image below.

On the General area, set the Reverse Proxy Name description: type in BookStack. After that, add the following instructions:

Source:
Protocol: HTTPS
Hostname: bookstack.yourname.synology.me
Port: 443

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 6875

BookStack Synology NAS Set up 3 new 2023

  • STEP 7

On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.

Synology Proxy WebSocket

  • STEP 8

Go to Control Panel / Network / Connectivity tab/ Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.

BookStack Synology NAS Set up 4 new 2023

  • STEP 9

Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.

BookStack Synology NAS Set up 5 new 2023

  • STEP 10

Go to File Station and open the docker folder. Inside the docker folder, create one new folder and name it bookstack. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

BookStack Synology NAS Set up 6 new 2023

  • STEP 11

Now create three new folders inside the bookstack folder that you created at STEP 10 and name them db, storage-uploads, uploads. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

BookStack Synology NAS Set up 7 new 2023

  • STEP 12

Download (click on the blue link below) and upload the my.cnf file below in the db folder that you have previously created at STEP 11. Follow the instructions in the image below. 🔒Note: Support my work to unlock the password. You can use this password to download any file on mariushosting forever!

👉🏻Download my.cnf

Bookstack Synology NAS database configuration

  • STEP 13

Right click on the uploads folder that you have previously created at STEP 11 then click Properties. Follow the instructions in the image below.

BookStack Synology NAS Set up 8 new 2023

  • STEP 14

Go to the Permission tab then click Advanced options. From the drop-down menu choose “Make inherited permissions explicit“. Follow the instructions in the image below.

BookStack Synology NAS Set up 9 new 2023

  • STEP 15

Select Everyone then click the Edit tab. Follow the instructions in the image below.

BookStack Synology NAS Set up 10 new 2023

  • STEP 16

Check all Read and Write Permissions. Click Done. Follow the instructions in the image below.

BookStack Synology NAS Set up 11 new 2023

  • STEP 17

After you click Done on STEP 16, check “Apply to this folder, sub-folders and files“. Click Save. Follow the instructions in the image below.

BookStack Synology NAS Set up 12 new 2023

  • STEP 18

Right click on the storage-uploads folder that you have previously created at STEP 11 then click Properties. Add the Everyone permission to that folder too, just like you did with the uploads folder.

  • STEP 19

Follow my step by step guide on how to activate SMTP for your Gmail account. This step is mandatory. Note: If you don’t want to use the easiest way for SMTP with Google and you already have SMTP details from your own Mail Server, you can just skip this STEP and use your personalized email SMTP details instead.

  • STEP 20

Log into Portainer using your username and password. On the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.

1 Synology Portainer Add Stack

  • STEP 21

In the Name field type in bookstack. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

services:
  db:
    image: mariadb:11.4-noble
    container_name: BookStack-DB
    hostname: bookstack-db
    mem_limit: 1g
    cpu_shares: 768
    healthcheck:
      test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/3306' || exit 1
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 90s
    security_opt:
      - no-new-privileges:false
    volumes:
      - /volume1/docker/bookstack/db:/var/lib/mysql:rw
      - /volume1/docker/bookstack/db:/etc/mysql/conf.d:rw
    environment:
      TZ: Europe/Bucharest
      MYSQL_ROOT_PASSWORD: rootpass
      MYSQL_USER: bookstackuser
      MYSQL_PASSWORD: bookstackpass
      MYSQL_DATABASE: bookstack
    restart: on-failure:5

  bookstack:
    image: solidnerd/bookstack:latest
    container_name: BookStack
    hostname: bookstack
    mem_limit: 1g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    ports:
      - 6875:8080
    volumes:
      - /volume1/docker/bookstack/uploads:/var/www/bookstack/public/uploads:rw
      - /volume1/docker/bookstack/storage-uploads:/var/www/bookstack/storage/uploads:rw
    environment:
      DB_HOST: bookstack-db:3306
      DB_DATABASE: bookstack
      DB_USERNAME: bookstackuser
      DB_PASSWORD: bookstackpass
      APP_KEY: base64:YnFsamt2aDBocDNyZGQxb2YyMng0cGlpcXo1NGFiNWc=
      APP_URL: https://bookstack.yourname.synology.me
      MAIL_DRIVER: smtp
      MAIL_HOST: smtp.gmail.com
      MAIL_PORT: 465
      MAIL_ENCRYPTION: tls
      MAIL_USERNAME: Your-own-gmail-address
      MAIL_PASSWORD: Your-own-app-password
      MAIL_FROM: Your-own-gmail-address
      MAIL_FROM_NAME: BookStack
    restart: on-failure:5
    depends_on:
      db:
        condition: service_started

Note: Before you paste the code above in the Web editor area below, change the value for TZ. (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value for APP_KEY and type in your own APP_KEY. Generate your free APP_KEY using the online Laravel APP KEY GENERATOR WEBSITE.
Note: Before you paste the code above in the Web editor area below, change the value for APP_URL and type in your own synology.me DDNS with https:// at the beginning that you have previously created at STEP 6.
Note: Before you paste the code above in the Web editor area below, change the value for MAIL_USERNAME and type in your own Gmail address. STEP 19.
Note: Before you paste the code above in the Web editor area below, change the value for MAIL_PASSWORD and type in your own Gmail app passwordSTEP 19.
Note: Before you paste the code above in the Web editor area below, change the value for MAIL_FROM and type in your own Gmail address. STEP 19.

BookStack Synology NAS Set up 13 new2 2027 master

  • STEP 22

Scroll down on the page until you see a button called Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

BookStack Synology NAS Set up 14 new2 2027 master

  • STEP 23

If everything goes right, you will see this message at the top right of your screen: “Success Stack successfully deployed“.

BookStack Synology NAS Set up 15 new 2023

  • STEP 24

Go back to STEP 1 or you will deal with karma 🙂

  • STEP 25

The installation process can take up to a few seconds/minutes. Please wait approximately 5 minutes or you will get a blank synology error page if you try to connect too soon. Now open your browser and type in your HTTPS/SSL certificate like this https://bookstack.yourname.synology.me In my case it’s https://bookstack.mariushosting.synology.me If everything goes right, you will see the BookStack Log In page. Click Create account. Type in the default Email and Password, then click LOG IN.

⚠️Warning: the default email is admin@admin.com and the default password is password

BookStack Synology NAS Set up 16 new 2023

  • STEP 26

Edit your profile and change the default theme from light to dark, email, password, avatar, language etc. Follow the instructions in the image below.

BookStack Synology NAS Set up 17 new 2023

  • STEP 27

Scroll down the page a little bit, then hit the SAVE button. Follow the instructions in the image below.

BookStack Synology NAS Set up 18 new 2023

  • STEP 28

At the top right of the page click Settings to Customize your BookStack instance. Follow the instructions in the image below.

BookStack Synology NAS Set up 19 new2 2023

  • STEP 29

Scroll down the page a little bit then click SAVE SETTINGS. Follow the instructions in the image below.

BookStack Synology NAS Set up 20 new3 2023

  • STEP 30

At the top right of the page, click Books to create your new Book. Follow the instructions in the image below

BookStack Synology NAS Set up 20 new 2023

  • STEP 31

At the top right of the page click Settings then Maintenance. Click SEND TEST EMAIL to test your email. Follow the instructions in the image below.

BookStack Synology NAS Set up 21 new 2023

If you correctly Followed STEP 19 and STEP 21, you will receive a successful email confirmation. Email is very useful in case you lose your BookStack password.

BookStack Synology NAS Set up 22 new 2023

Enjoy BookStack!

Note: Find out how to update the Bookstack container with the latest image.
Note: How to Back Up Docker Containers on your Synology NAS.
Note: Can I run Docker on my Synology NAS? See the supported models.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Friday / November 29th, 2024 at 4:25 PM