Hello all,
I’m attempting to self-host Ghost on my ubuntu 24.04 server running rootless docker and a caddy reverse proxy. The caddy reverse proxy is running on the server itself (not in a container) and is the latest version from the caddy repositories. This reverse proxy sits in front of all my self-hosted services, whether they are containers or running directly on a server. I’d like to keep in this way and not have two different reverse proxies for a number of technical reasons on my self-hosted setup.
So I’d like help with two things:
-
verifying my compose file and caddy snippet edits are correct to make ghost work with an external caddy reverse proxy.
-
help with understanding why (after I successfully deploy ghost and login in for the first time) anytime I try to do a docker compose down for the ghost compose file, I get this error (and whether the two things are related) which results in ghost not working anymore.
✘ Container ghost-db-1 Error while Stopping 14.0s
Error response from daemon: cannot stop container
Ok, first the edits I made to make ghost-docker work with an external caddy reverse proxy:
- I copied the ghost-docker repository to my computer. Note: I copied it to a directory in my home directory, not to /opt/ghost… but i don’t think this matters?
- I filled out the .env per install instructions.
- I did change the UPLOAD_LOCATION and MYSQL_DATA_LOCATION to a different directory that is regularly backed up. I used absolute paths, not relative paths.
- I commented out the caddy service definition in the compose file.
- I added the following to the ghost service definition in the compose file so my caddy reverse proxy (running on the same server) can access ghost.
-
ports:
- 127.0.0.1:2368:2368
-
- I copied the caddy config from the Caddyfile in the ghost-docker git into my Caddyfile and made the necessary edits.
- I copied the caddy snippets folder over and replaced the activitypub variable in the ActivityPub snippet to point directly to https://ap.ghost.org, since there would be no way that it’d know the value of a variable that is only defined inside of docker…..
I run “docker compose up” in the ghost directory and things start perfectly! I’m able to create the admin user, create a site, and email (using smtp.gmail.com) and things seem to work great.
So i think i got #1 right? Is there anything I missed as far as getting ghost-docker running with an external reverse proxy?
break break
Ok, here is where things start to break down. If i run “docker compose down” to bring my containers down i get the following:
docker compose down
[+] Running 2/2
Container ghost-ghost-1 Removed 0.3s
✘ Container ghost-db-1 Error while Stopping 14.0s
Error response from daemon: cannot stop container: e91d03f0dd72f61fe01ebaddd7eeb68bf18d44277a55cae447d4cebfce9eb20e: permission denied
No matter what I try (e.g. docker kill) nothing works. The only thing that does work is restarting the docker process:
sudo systemctl --user restart docker.service
and then the ghost-db-1 container is finally stopped and I can remove the container. If however, I try to bring ghost-docker back up using “docker compose up -d” i get the following error:
docker compose up -d
[+] Running 2/2
✘ Container ghost-db-1 Error 100.8s
Container ghost-ghost-1 Created 0.0s
dependency failed to start: container ghost-db-1 is unhealthy
The docker logs show this for ghost-deb-1
db-1 | 2025-11-12T14:31:04.123178Z 0 [ERROR] [MY-010338] [Server] Can’t find error-message file ‘/usr/share/mysql-8.0/errmsg.sys’. Check error-message file location and ‘lc-messages-dir’ configuration directive.
db-1 | 2025-11-12T14:31:04.126802Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
db-1 | 2025-11-12T14:31:04.149420Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11
db-1 | 2025-11-12T14:31:05.149529Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11
db-1 | 2025-11-12T14:31:06.149681Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11
and I am right back where i started. i could try and disable the lock? but even if that works, that doesn’t solve the problem that i can’t use “docker compose down” without encountering this error.
If I nuke everything, and restart the install from the beginning, the same thing happens. I can get the site up and running, but as soon as I try and bring ghost-docker down using “docker compose down,” the whole thing goes to
Any help would be greatly appreciated!
Brian