The new Docker setup is ready for (beta) testing!

Hey everyone :waving_hand:

As I mentioned back in August, Ghost-CLI is being deprecated and replaced with a new-and-improved Ghost Docker setup.

Today, the docker setup + Ghost-CLI migration path is ready to test for those that want to try it early! :smiley: We’d appreciate any feedback from those that want to test it out, to help us iron out any issues before Ghost 7.0.

Highlights

  • Documentation: lives on docker.ghost.org and in the repo for the time being - it’ll be moved into the main Ghost Docs once the beta testing/development period is done.
  • Installation: now a one-line bash command that sets up the local docker-compose files (for both local and production installs) - no Git required.
  • ghost-docker CLI helper: the Docker setup now ships with a lightweight CLI tool to help with automating common maintenance tasks (update, backup, restore, check, etc.) Normal day-to-day use (logs, start, stop, etc) uses the normal docker compose commands.
  • Local Installs: now supported with the --local flag. Add --with mailpit to start a local Mailpit instance for email testing.
  • Ghost-CLI Migration: Migrating a Ghost-CLI install (both local and production) is supported via Ghost-CLI’s migrate-export command and the installer’s --import flag.
  • One-Click Admin Updates: Adding --with supervisor starts a supervisor image that enables one-click updates in Ghost Admin (needs Ghost >= 6.72.0, not available under rootless Docker)
  • Nightly Images: Ghost now publishes a nightly docker image that you can opt into for testing the latest features prior to release. Add --ghost-channel nightly to have your install use the nightly image (for testing only - it’s not currently possible to switch between stable and nightly channels)

Testing it out

  • Production Setup: curl -fsSL https://docker.ghost.org/install.sh | bash -s -- install --domain mysite.com
  • Local Setup: curl -fsSL https://docker.ghost.org/install.sh | bash -s -- install --local
  • Migrating a Ghost-CLI site: Ensure you’re on the latest version of Ghost-CLI (>= v1.34.0) and a recent version of Ghost (>= v6.61.0), then run ghost migrate-export --output <export path> and curl -fsSL https://docker.ghost.org/install.sh | bash -s -- install --import <export path> (docs)
  • Migrating from a current ghost-docker main clone: see the docs Note: this will move your site into the beta channel

Beta Caveats

  • This new setup is still in beta, and while we don’t expect things to change too dramatically between now and the full release with Ghost 7.0, there still could be breaking changes. That said, those changes will be communicated out if/when they happen.
  • Production Sites: This setup should be safe to try for production sites, but make sure to take a backup before switching to the Docker setup. Also, while the update and self-update commands take automatic backups before running, it’s still worth running ./ghost-docker backup yourself and copying it off the server, just in case.

Not Supported Yet

There’s a few things that we’ll be adding to the docker setup before it’s finalized that aren’t ready yet, namely:

  • Multi-site installs (multiple Ghost sites behind a shared Caddy instance)
  • Smaller optimizations/hardening fixes (file-based secrets, Redis caching, etc)
  • (potentially) Native Windows support. Currently on Windows, use WSL2 with Docker Desktop’s WSL integration.

Feedback

Any issues or requests for the new setup should be reported as Github Issues in the ghost-docker repo using the next-docker template. Check the list of open issues with the next-docker label first to ensure the issue hasn’t been reported already :grinning_face_with_smiling_eyes:

Questions or general feedback can be submitted as replies in this thread.


Thank you in advance to anyone who’s willing to help test this out, as well as to anyone who’s used and submitted feedback to the current ghost-docker setup in the past.

Hi there! I deployed a fresh Ghost instance to my Hetzner virtual server using this Docker setup. It took about 3 minutes. It works like a charm → https://ghost.nbaglivo.dev. I already had an ActivityPub server running behind a reverse proxy so I simply put Ghost behind it instead of using Ghost’s Caddy

Hi! Is the default image built with the current code from docker-library-ghost/6-next/bookworm/Dockerfile at master · TryGhost/docker-library-ghost · GitHub ? I mean, it’s expected to use the published tgz from the repo’s releases?
Thanks a lot! Congrats :slight_smile:

Yup! The image it uses by default is the next variant of the official Docker image, which builds off of the published GitHub release tarball. (the next variant will become the default variant in 7.0)

Ghost 7.0 will stop publishing releases to npm, hence why the next variant uses the GitHub release artifact :slightly_smiling_face:

I installed Ghost on my Mac mini as a test (after downloading Docker Desktop).

curl -fsSL https://docker.ghost.org/install.sh | bash -s --install --local

Everything worked perfectly right away.

I checked it out: docker compose exec ghost sh

Perfect! Congratulations!

I know this isn’t exactly what you asked for, but it could be useful:
I build/package a custom image crafted with hardening practices and intended to be used with kubernetes.
Based on tre existing Dockerfile next, I’ve adapted the steps from the upstream Dockerfile and this is my result (It works alongside the workflow to provision the build args:

Can confirm that the WSL2 option works well! Install Docker desktop on Windows, install WSL2/Ubuntu 24, run the commands provided within the WSL2 container.

I tried to migrate an existing website (Ghost CLI) to Docker on Ubuntu 26.

curl -fsSL https://docker.ghost.org/install.sh | bash -s --install --no-start

It worked, but I have the following comments.


I didn’t need Caddy as a proxy because I already configured apache as the proxy for the old website.

However, the COMPOSE_PROFILES file “production” contains Caddy, specifically in compose.yml:

caddy:
...
profiles: [production]
docker compose config --services
db
ghost
caddy

On every restart, I had to run:
docker compose --profile production stop caddy
docker compose --profile production up -d ghost db
or
docker compose --profile production up -d --force-recreate ghost db

(or change it in .env: `COMPOSE_PROFILES=“”)

The bottom line:
An --no-caddy install parameter would be helpful.
A ghost-docker restart wouldn’t hurt either.


I had problems with MigrationsAreLockedError.

But I don’t know when or with which command it happened.
I’ve tried many things.
When accessing the page, I always got “This service is unavailable.”

docker compose logs --tail=200 ghost

MigrationsAreLockedError: Migration lock was never released or currently a migration is running.
at Object.isLocked (/home/ghost/node_modules/.pnpm/knex-migrator@6.2.1_@types+node@25.9.9_knex@2.4.2_better-sqlite3@12. 11.1_mysql2@3.24.5__f3d0bffc060eb2a96f23d03fe406caa7/node_modules/knex-migrator/lib/locking.js:76:15) ...

I was able to fix it with:

docker compose exec db sh -c \
'mysql -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" ghost \
-e "UPDATE migrations_lock SET locked = 0, released_at = NOW() WHERE lock_key = '\''km01'\'';"'

The website is now running on Docker :slightly_smiling_face:

Will this eventually still be pushed to the docker hub or will it only be available from github? I’ve used the docker setup for years and only pulled the image from docker hub in my compose file.

@disgustipated Not sure what you mean :thinking: The ghost-docker repo compose setup (both the current main version and the new beta version) pull the Ghost official image from Docker Hub.

We do have some ongoing work to mirror some of the other images (ActivityPub/Traffic Analytics) to both Docker Hub and GitHub to make sure that they’re pullable from both locations.

I pull from here ghost - Official Image | Docker Hub
I have my compose file for just ghost

  ghost_site:
    image: ghost:6
    container_name: ghost_site
    restart: always
    ports:
      - 8184:2368
    environment:
      - NODE_ENV=production 
      - verifyRequestIntegrity=true
    volumes:
      - /home/ghost/containers/ghost_site/content:/var/lib/ghost/content
      - /home/ghost/containers/ghost_site/config.production.json:/var/lib/ghost/config.production.json
      - /home/ghost/containers/ghost_site/BuiltInThemes/:/var/lib/ghost/current/content/themes/

and the database for all of my instances on another server, and my nginx on a different server as well so it is not a simple single all in one instance like the basic directions.

Ah ok. I think maybe what you’re asking then is “is the official docker hub ghost image going away”? To answer that question - the official image is not going away, it’s owned by the Ghost team now and is regularly updated with new Ghost versions.

Regarding your specific setup - there’s nothing wrong with continuing to do it that way :smiley: The ghost-docker setup mentioned at the top of this post is the official/supported way to run Ghost with Docker, but it sounds like you’ve got a good setup already, and afaik there’s nothing that’ll intentionally prevent you from continuing to run it that way.

The only thing you might look at doing is testing out the next variant of the official Docker image - we’re going to be making a few breaking changes to the image layout with Ghost v7, and the next variant allows you to update to the new layout now if you want instead of waiting until v7 is released.

Not exactly what I was asking but answers it in the opposite direction i think :smiley:
So it sounds like then that the docker hub will still be fine to pull from and you’ll have the new tag for v7 which sounds pretty normal to work with. sounds good. I do see the next tags up there so ill test out some things.thanks!