docker: ghost blog via bash

In this guide we install ghost blog into a docker container via the command line.

docker: ghost blog via bash
Photo by Roman Synkevych / Unsplash
Linux Rocks Every Day

The (basic) method does not require a mysql, just docker which you can get basic instructions on how to install here

  • ghost:alpine method does not require a mysql instance with it
  • -e url=yoururl.com
  • -p 80:2368  (2368 is the default port)
  • /ghost/ is the relative URL for login and admin
sudo docker run --name ghost -e NODE_ENV=development -v ghost_data:/var/lib/ghost/content -e url=http://yourdomain.com:80 -p 80:2368 ghost:alpine

We can expand this farther with some more bells and whistles -d for daemon mode:

sudo docker run --name ghost -e NODE_ENV=development -v ghost_data:/var/lib/ghost/content -e url=http://localhost.com:80 -p 80:2368 --restart unless-stopped -d ghost:alpine

--restart unless-stopped is important

 -d without this it will run in the foreground.  Leave this option out if you want to see it's debug logs.

Linux Rocks Every Day