This repository contains a fully usable BookStack with Traefik as a reverse proxy. Additionally, Traefik uses Let's Encrypt as an ACME provider to automate certificate generation.
- Make sure you've installed Docker including
docker compose
support on your target system. You can installdocker compose
following this instruction: https://docs.docker.com/compose/install/
-
Clone this repository:
sudo git clone https://github.com/symnixhq/traefik-bookstack.git
- Open the file called
traefik-letsencrypt-bookstack-docker compose.yml
- Adjust the variables for your configuration. Edit the following values:
- Passwords (declared as "MODIFY_ME")
- E-Mail address (declared as "example.mail@examplemailservice.com")
- Domain (declared as "example.url.com")
- PGID and PUID of the user who owns the database data directory
- Edit and Encode the password you want to use in the .env file It is declared as "${BASICAUTH_PASSWORD}" but needs to be changed in the .env file
Note: You can hash your password with the following line, assuming you installed htpasswd
before.
echo $(htpasswd -nb user password) | sed -e s/\\$/\\$\\$/g
After you've decrypted your password you need to escape every "$" sign with another "$".
Tip: You can use:
docker compose convert
to resolve your configuration file into the terminal.
- Adjust the data volumes
In our example we use:
volumes:
- /data/bookstack/database:/config
as the volume that we mount into the container. If you want to use the exact same volumes, you need to create them on your system before. You can do this like this for example:
sudo mkdir -p /data/bookstack/database
-
Start the project
sudo docker compose -f <name_of_the_docker_file> up -d
-
Check the application logs and verify that everything is running appropriatly
sudo docker compose logs -f
-
Enjoy your new Bookstack installation!
Note: If you have questions regarding bookstack, have a look at https://www.bookstackapp.com/docs/.
See Contributing.
GPLv3