How Do I Setup A Free Website Using Docker? is developing a Docker container service in the cloud. While it's in development, they are offering a free Docker node within which you can run containers. This is perfect for creating a small website.

Beware, does not guarantee your data will be safe.

In fact, they had a server problem which resulted in total loss of everything I had stored in my Docker containers. Regardless, this is a very handy service, just keep your data backed up.

The following steps show how to:

  • Connect your docker installation to the cluster
  • Create a ghost container
  • Create a ghost-data container
  • Run Ghost persisting data to the ghost-data container
  • Update config.js in /var/lib/ghost to point to your site

Creating the Ghost Site with a Persistent Store

Connect the local docker commands to administer docker on the cluster:
eval $(curl -s | sh)
docker create -v /var/lib/ghost --name ghost-data ghost /bin/true
docker run --name ghost -p 80:2368 --volumes-from ghost-data -d ghost

Configure the persistent store

docker exec -it ghost /bin/bash
Get your node name from, under the account tab. Change config.js to point to, restart to pick up the config.
docker restart ghost

Put stuff on your website

Create your login:, your real (or pen) name.
Continue by adding new posts, etc.

Backup data from ghost-data container

It's pretty hard to get access to the host filesystem from within a container. The simplest way to deal with this is to use an external place to store the data. Accessing the local filesystem from within a container is difficult, using plain hold SCP does the trick.
docker stop ghost
docker run -it --volumes-from ghost-data ghost /bin/bash
Inside the container:
apt-get update;apt-get install -y openssh-client
tar zcf /tmp/ghost.tgz /var/lib/ghost
scp /tmp/ghost.tgz

Get data from backup and store it locally

scp .
Restart container
docker start ghost