r/BookStack • u/BagCompetitive357 • Aug 29 '25
Cannot set up Bookstack behind Cloudflare Tunnels
Hi
I have difficulty installing and set up Bookstack behind Cloudflare Tunnels. I have a yaml file for an installation behind a reverse proxy that is working. I changed it for CF as below. On CF, I tried several possibilities including http://localhost:6875.
I searched a lot, and I don't seem to be able to find the issue. I understand Bookstack takes only one URL, and APPI_URL must be the external and internal access url. Each time a change is made, the containers and volumes are removed.
Could this be a caching problem in CF? Some people mention you have to wait 30 minutes after some changes.
How to check inside container that env variable APP_URL is correctly set (so that, the docker does not silently ignore the yaml file and fall back to local host)? I set the APP_DEBUG environment variable and nothing strange is reported.
Update It seems the application’s domain set in CF Tunnels should be a subdomain, but cannot be a sub-subdomain, in the free plan.
services:
bookstack:
image: lscr.io/linuxserver/bookstack:latest
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- APP_URL=https://mydomain.cm
- APP_KEY=
- DB_HOST=bookstack_db
- DB_DATABASE=bookstackdbname
- DB_PORT=3306
- DB_USERNAME=bookstackuser
- DB_PASSWORD=
volumes:
- ./config:/config
ports:
- 6875:80
restart: unless-stopped
bookstack_db:
image: lscr.io/linuxserver/mariadb:latest
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Paris
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=bookstackdbname
- MYSQL_USER=bookstackuser
- MYSQL_PASSWORD=
volumes:
- ./db_config:/config
ports:
- 3308:3306
restart: unless-stopped
Thanks!
View all comments
Show parent comment
1
u/BagCompetitive357 Aug 29 '25
Yes, https://mydomain.com points to Cloudflare edge network. Issuing curl -v https://mydomain.com from anywhere (including in host) returns a TLS handshake error is, with any combination of settings that I could think of.
However, curl -v http://localhost:6875, or curl -v https://mydomain.com if a reverse proxy other than CF handles https://mydomain.com, returns the a successful handshake.
The problem is then, enabling some flags in bookstack installation that you may know but we users don’t, potentially in combination with settings in CF, or changes to the code of bookstack (like providing an environment variable to skip the domain check similar to in nextcloud AIO docker), to make it work.