How to Update Ghost CMS with Docker
Update Ghost CMS with Docker using pull, down and up commands. Safe for minor versions only, with sample container names and checks
If your Ghost blog runs in Docker, minor version updates should be simple. This guide shows the clean update method using docker pull ghost:latest, docker-compose down, and docker-compose up -d, with sample container names only.
The quick answer: for minor Ghost CMS Docker updates, pull the latest Ghost image, stop the Compose stack, then start it again. Do this only when you are staying within the same major Ghost version, such as Ghost 5.x to another Ghost 5.x release or Ghost 6.x to another Ghost 6.x release. For major upgrades, check Ghost’s official upgrade notes first because database, theme, and service changes can break production sites.
Ghost’s own Docker documentation says the normal Docker upgrade process uses image pulling and docker compose up -d, while Docker’s documentation confirms that docker compose down stops and removes Compose-created containers and networks by default, not named volumes unless you explicitly ask it to. That is why this method works well for minor updates when your Ghost content and database are stored in persistent volumes. (Ghost Developer Docs)
Why Ghost Docker Updates Are Usually Simple
Ghost Docker updates are simple because the application lives in the container image, while your content and database should live outside the container. When the container is recreated, Docker starts Ghost from the newer image and keeps using the mounted volumes defined in your Compose file.
That separation is the whole point of running Ghost with Docker. The Ghost app can be replaced. Your MySQL data, images, themes, routes, redirects, and uploads must persist.
For a minor version update, you don’t need a long runbook. You need three commands and one sensible warning: don’t use this method for major upgrades without checking compatibility first.
The Hitori Tech blog format calls for direct, practical Ghost CMS articles with clear internal links, FAQ schema, and related technical posts linked naturally. The related blog list includes Ghost and Docker content such as hosting Ghost on a subpath, Ghost theme deployment, Docker on Windows, and Docker hosting guides.
The Solution: Update Ghost CMS with Docker
Use this method only for minor version updates. Keep the commands simple.
docker pull ghost:latest
docker-compose down
docker-compose up -d
That is the whole update flow.
Here is what each command does.
docker pull ghost:latest downloads the latest Ghost image from Docker Hub.
docker-compose down stops and removes the containers created by your Compose file. Docker says this removes Compose-created containers and networks by default, while named volumes are not removed unless you use volume removal options. (Docker Documentation)
docker-compose up -d starts the stack again in detached mode. Your Compose file will create the Ghost container from the image now available on the server.
Use sample names in tutorials and internal notes. For example, call the Ghost container sample_ghost_app and the database container sample_ghost_db. Don’t publish real production container names in a blog post, screenshot, or public command history.
A simple sample Compose service looks like this:
services:
sample_ghost_app:
image: ghost:latest
container_name: sample_ghost_app
restart: unless-stopped
ports:
- "2368:2368"
environment:
url: https://blog.example.com
database__client: mysql
database__connection__host: sample_ghost_db
database__connection__user: ghost_user
database__connection__password: change_this_password
database__connection__database: ghost
volumes:
- sample_ghost_content:/var/lib/ghost/content
depends_on:
- sample_ghost_db
sample_ghost_db:
image: mysql:8
container_name: sample_ghost_db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: change_this_root_password
MYSQL_DATABASE: ghost
MYSQL_USER: ghost_user
MYSQL_PASSWORD: change_this_password
volumes:
- sample_ghost_mysql:/var/lib/mysql
volumes:
sample_ghost_content:
sample_ghost_mysql:
The important part is the volume section. sample_ghost_content keeps your Ghost uploads, themes, and content files. sample_ghost_mysql keeps the database files. Without persistent volumes, a container refresh becomes a data loss risk.
When You Should Not Use This Method
Do not use this three-command method for major Ghost upgrades. It is for minor versions only.
A minor update means staying within the same major version. Examples include Ghost 5.80 to Ghost 5.100, or Ghost 6.0 to Ghost 6.5. A major update means Ghost 4 to 5, or Ghost 5 to 6. Major upgrades can include database migrations, theme compatibility changes, Node.js changes, Docker stack changes, or feature changes.
Ghost’s official Docker install documentation now describes Docker Compose as part of the self-hosted path, and Ghost’s Docker setup can include more than just the Ghost app and database in newer installations. That matters because a major upgrade is not always a single-container refresh. (Ghost Developer Docs)
For major upgrades, check:
| Upgrade type | Use the three commands? | What to do |
|---|---|---|
| Ghost 6.1 to 6.2 | Yes | Pull, down, up |
| Ghost 5.90 to 5.100 | Yes | Pull, down, up |
| Ghost 5 to Ghost 6 | No | Read official upgrade notes first |
| SQLite to MySQL | No | Plan a migration |
| Old custom theme upgrade | No | Test the theme first |
| New Docker stack with analytics or ActivityPub | No | Follow Ghost’s current Docker docs |
The Docker Hub Ghost image page also warns that upgrades need the right mounted data path and a clean successor container. That is another reason to keep major upgrades separate from minor refreshes. (Docker Hub)
Check Ghost After the Update
After running the three commands, check that Ghost is actually running. Don’t assume the update worked just because Docker started a container.
Run:
docker-compose ps
Then check logs:
docker-compose logs -f sample_ghost_app
Look for a clean startup. You should not see repeated database connection errors, theme errors, or restart loops.
Then open:
https://blog.example.com
https://blog.example.com/ghost
Check the public site first. Then log into Ghost Admin and confirm that posts, images, tags, members, and settings still look correct.
Common Mistakes
The most common mistake is using this method for a major upgrade. Don’t do that. The three-command update is for minor versions only.
The second mistake is forgetting persistent volumes. If your Ghost content is stored inside the container instead of a mounted volume, docker-compose down followed by recreation can leave you with missing content.
The third mistake is publishing real container names in a tutorial. Use names like sample_ghost_app, sample_ghost_db, ghost_web, or ghost_mysql. Keep production names private.
The fourth mistake is skipping logs. A Ghost container can restart repeatedly while still appearing briefly in docker-compose ps. Logs tell you what really happened.
The fifth mistake is updating the database image at the same time. Keep the Ghost app update separate from MySQL updates. One change at a time is easier to debug.
Related Ghost CMS and Docker Guides
If your Ghost setup uses Cloudflare or subpath hosting, read our guide on how to host Ghost on a subpath using Cloudflare. It connects well with Ghost Docker hosting because reverse proxy configuration is often where small production issues appear.
If you customise themes, read how to automatically deploy Ghost themes using GitHub Actions. It helps separate theme deployment from container updates, which keeps Ghost maintenance cleaner.
For Docker troubleshooting on Windows, we also cover how to install Docker on Windows without WSL and Docker Desktop stuck on starting in Windows. These fit the wider Docker content cluster that Hitori Tech’s SEO plan already prioritises for technical search traffic.
For production hosting help, see Hitori Tech’s managed web hosting and DevOps and cloud services. If you want us to check your Ghost Docker setup before an update, contact Hitori Tech.
Frequently Asked Questions
What is the command to update Ghost CMS with Docker?
The command sequence is docker pull ghost:latest, then docker-compose down, then docker-compose up -d. Use this only for minor Ghost version updates. For major upgrades, read Ghost’s official upgrade guidance first.
How do I update Ghost Docker without losing data?
You avoid data loss by storing Ghost content and MySQL data in persistent Docker volumes. The update commands recreate containers, but named volumes remain unless you explicitly remove them. Always check your Compose file before updating.
Can I use this method for Ghost 5 to Ghost 6?
No. Do not use this simple method for Ghost 5 to Ghost 6 unless you have already checked the official upgrade notes and tested the upgrade. Ghost 5 to Ghost 6 is a major upgrade, not a minor update.
Why use docker pull ghost:latest before docker-compose up?
docker pull ghost:latest makes sure the newer Ghost image is already downloaded on the server. Then docker-compose up -drecreates the service using the available image defined in your Compose file.
Which container names should I use in a public blog post?
Use sample names such as sample_ghost_app and sample_ghost_db. Don’t publish real production container names, database names, internal network names, or passwords in public documentation.