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 edited Aug 29 '25
Hi
Thanks for responding.
First of all, I just checked. If I run caddy reverse proxy in front of bookstack, forwarding https://mydomain.com to http://localhost:6875, the exact same book stack installation, with the above yaml file, works (which is same setup as my old installation!). So bookstack installation is not broken.
I ran cloudflared daemon on the host. I can expose apps published on host with CF. I have not tried running Cloudflare in docker. I suspect that might be an issue (maybe docker doesn’t allow access to 6875 unless in host mode). Maybe I change networking mode or run another instance of Cloudflare in docker on the same network as bookstack.
The setting in Cloudflare tunnels web interface is http://localhost:6875. There is no path, but I tried with /login, and did not help.