Developers Hate This! One Easy Trick to Fix a Ghost Blog Container Instantly
Have you ever run a Docker container… and suddenly it stops working ?
Maybe your blog doesn’t load anymore. Maybe “docker ps”says the container is up, but your logs says something else. That’s exactly what happened to me on May 17, 2025.
By the end of this blog post, you’ll feel more confident fixing Docker container issues , checking volumes, inspecting moutns and pruning useless resources.
✅ You’ll learn how to:
- Inspect Docker volumes and bind mounts
- Use pruning to clean up old volumes
- Dive into a container to investigate issues
- Fix a broken Ghost blog hosted with Docker
🧠 The “What” and the “Why”
What happened?
My Ghost blog (running inside a Docker container) just… stopped serving the site. I suspected something was wrong with the volume or bind mount.
Why is this important?
When you want to self-host your site(e.g., Ghost or WordPress) with Docker, you must understand volumes and how to fix common mount and data issues.
Otherwise, you’ll find yourself lost the moment something breaks.
🔍 Step 1: Inspect the container mounts
To start, I needed to know exactly what was being mounted where:
docker inspect ghost | grep -A 10 Mounts
📸 Terminal Output:
"Mounts": [
{
"Type": "bind",
"Source": "/home/arash/ghost-site/ghost",
"Destination": "/ghost-site/ghost",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
}
],
This showed me that the bing mount from my local file system (/home/arash/ghost-site/ghost) was successfully mounted into the container at (/ghost/user_data).
📊 Visual Diagram: How Bind Mounts Work
Here’s a simple diagram to visualize what’s happening:
+---------------------------+
| Host Machine |
| |
| /home/arash/ghost-site |
| | |
| V |
| Mounted into Container |
+---------------------------+
|
V
+---------------------------+
| Docker Container |
| |
| /ghost/user_data |
| (Visible inside Ghost) |
+---------------------------+
If the host directory is empty, Ghost won’t find its config and content!
🧹 Step 2: Prune unused Docker volumes
Next, I made sure there where no stale or dangling volumes:
docker volumes prune -f
📸 Terminal Output:
Total reclaimed space: 0B
So.. nothing was removed. This told me i didn’t have any unused volumes–which is a good sign. But I still didn’t have a working blog.
🧱 Step 3: Check the existing volumes and images
Next, I checked the list of volumes:
docker volume ls
Then I verified the image:
docker images
📸 Output:
REPOSITORY TAG IMAGE ID CREATED SIZE
ghost latest abcdef123456 2 days ago 476MB
Everything looked fine.
🧪 Step 4: Try accessing the container manually
I needed to manually check if the files were there.
docker exec -it ghost bash
Inside the container:
cd /ghost/user_data
ls
📸 Output:
config.json logs/ strategies/ db.sqlite3
✅ Files were present! So the mount worked. Time to check logs.
cat logs/latest.log
Or for Ghost specifically:
docker logs ghost
✅ The Final Fix: Restart it
With everything in place, I restarted the container:
docker restart ghost
📸 Output:
ghost
Visited the site–and… 🎉 it worked again!
💡 What I Learned
Here’s a compact checklist to follow whenever a container isn’t behaving:
- Run docker inspect <container>
- Check “Mounts” and “Volumes” sections
- Confirm host paths actually exist and contain correct data
- Try docker exec -it <container> bash to check from inside
- Run docker logs <container> for service-specific errors
- Use docker volume prune to remove old volumes
- Restart container with docker restart <container>
- Try rebuilding with docker compose up — build if needed
- Use docker compose down -v to removes volumes and rebuild cleanly
✅ Final Fix
After knowing the mount path was correct and no volumes were interfering, I restarted the container:
docker restart ghost
And like magic… the blog was back online.
🎉 Congratulations!
You’ve just walked through a real-life debugging session of a Docker container powering a Ghost blog.
Next time your container mysteriously stops working, you’ll know how to inspect it, prune it, exec into it, and fix it–without stressing.
👉 IF You Want to read more about Docker, Ghost, or web hosting with Linux:
Visit my medium at: [medium]
You can fuel my next data science deep dive by buying me a coffee ☕!