Public | Automated Build

Last pushed: a month ago
Short Description
Configurable Golden Ghost image.
Full Description


Docker golden image (gold/ghost) for Ghost.

Most interesting version tags

  • 0.11 - latest of 0.11

  • 0.11.12

  • 0.11.8
  • 0.11.7

Experimental branch

  • alpine - not recomendet for production now.

Why yet another image for Ghost?

Ghost environments suggest that it's better to use production

The official container for Ghost is fine for running in development mode, but it has the wrong
permissions for running in production.

Also backup script is backed in.
Switc from dev to production environment is easy. Beware in default config both modes operate on same database


docker run --name some-ghost -p 8080:2368 -d gold/ghost

This will start Ghost in development mode and whire to the port 80 of the container.

Then, access it via http://localhost:8080 or http://host-ip:8080 in a browser.

Running in production

The official Ghost image places the blog content in /var/lib/ghost and exports it as a VOLUME.
This allows two main modes of operation:

Content on host filesystem

In this mode, the Ghost blog content lives on the filesystem of the host with the UID:GID of
1000:1000. If this is acceptable, create a directory somewhere, and use the -v Docker command
line option to mount it:

sudo mkdir -p /var/lib/ghost
sudo chown 1000:1000 /var/lib/ghost
docker run --name some-ghost --env-file /etc/default/ghost -p 80:2368 -v /var/lib/ghost:/var/lib/ghost -d gold/ghost npm start --production

This is very convinient, because you can tweak your configuration directly in host's /var/lib/ghost/confg.js.

Content in a data volume

This is the preferred mechanism to store the blog data. Please see the
Docker documentation
for backup, restore, and migration strategies.

docker create -v /var/lib/ghost --name some-ghost-content busybox
docker run --name some-ghost --env-file /etc/default/ghost -p 80:2368 --volumes-from some-ghost-content -d gold/ghost npm start --production

You should now be able to access this instance as in a browser.

Configuration via environment variables

Epecially in case you run the content in a volume it's good to have a posibillity to injet some config form outide.

There are environment variables that can be used:

  • GHOST_URL: the URL of your blog (e.g.,
  • MAIL_FROM: the email of the blog installation (e.g., '"Webmaster" <>')
  • MAIL_HOST: which host to send email to (e.g.,
  • PROD_FORCE_ADMIN_SSL: Relevant for prodction mode only. Tel's Ghost to force use SSL for admin pages (default: true)
  • MAIL_PORT: sets a port for secure mail connection
  • MAIL_SSL : set "true" or "false"
  • MAIL_USERNAME : The username for the mail server
  • MAIL_PASSWORD : The password for the username above

These can either be set on the Docker command line directly, or stored in a file and passed on
the Docker command line:

docker run --name some-ghost --env-file /etc/default/ghost -p 8080:2368 -d gold/ghost

Here an example of ENV variables file:

# Ghost environment example
# Place in /etc/default/ghost

MAIL_FROM='"Webmaster" <>'

Behind a reverse proxy

Of course, you should really be running Ghost behind a reverse proxy, and set things up to auto restart. For that,
a reasonable container would be:

docker create --name some-ghost -h --env-file /etc/default/ghost -p --volumes-from some-ghost-content --restart=on-failure:10 gold/ghost npm start --production
docker run some-ghost


Backup is working for host based or volume based data (see below)

docker run --rm --volumes-from some-ghost -v $(pwd)/backups:/backups gold/ghost /

Backups ghost to current directory.

Restoring Backup

Attention: Restore script for volume based data keeping is not provied yet. Make sure you know what to do.

For the host based solution just extract backup file content to volume location on host.
Please contact me if you have good ideas how to improve things here.

Example docker-comose.yaml

  image: gold/ghost:0.7.9
  command: npm start --production
  restart: always  
   - "2368:2368"
   - /var/containerdata/ghost/blog/:/var/lib/ghost
   - MAIL_FROM='"Webmaster" <>'
   - MAIL_SSL=true
   - MAIL_PORT=465
   - MAIL_PASSWORD=hopefullyasecurepassword

Even if env varibales are provided, config.js can b still found and tweaked in /var/containerdata/ghost/blog/ on the host.

More information

Docker Pull Command
Source Repository