Steve's Tech Blog

Setting up Ghost in Google Compute Engine

This post will detail how to set up a new VM in google compute engine to run Ghost. I was writing this while setting up this blog's server, if I'm missing anything let me know! These steps were based on a combination of Installing Ghost Deploying Ghost and Using a custom domain.

Updated: I've created a shell script to do all of this for you. See All you need to run now is curl | sh

The steps below are roughly what the script runs.

  1. Start by making a new VM in your developer console. I chose a f1-micro instance, debian-7 as the image, and give it a new static IP address. You'll also want to check "allow HTTP" to automatically create a firewall rule for HTTP in.

  2. SSH into your new instance. You can do this either by adding a new private key when setting up the instance, or the "SSH" link in the menu.

  3. You'll need unzip, which is not installed by default. First update your packages via sudo apt-get update, then install it via sudo apt-get install unzip.

  4. From your home directory (cd ~) download the latest ghost package.
    curl -L -o

  5. Make a place for ghost, I chose /var/www/ghost since it's the default in a later step.
    sudo mkdir -p /var/www/ghost

  6. Create a new user for ghost, we'll use this later.
    sudo useradd -r ghost -U

  7. Unzip ghost into this new directory.
    sudo unzip -uo ~/ -d /var/www/ghost

  8. Change the owner of that new directory to ghost:ghost
    sudo chown -R ghost:ghost /var/www/ghost

  9. Get Node.js.
    sudo apt-get install nodejs

  10. Set up node instead of nodejs. Debian doesn't allow node by default, run this to set up a symlink.
    sudo update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100

  11. Get npm (which doesn't have a package in wheezy)
    curl | sudo sh

  12. Install build-essential package. This is needed to build sqlite3
    sudo apt-get install build-essential

  13. Set it up
    npm install --production npm start

    Now kill the server with Ctrl+C twice once the first start is complete

  14. Set up an init script for ghost
    sudo curl -o /etc/init.d/ghost sudo chmod 755 /etc/init.d/ghost

  15. Start ghost via the init script
    sudo service ghost start

  16. Set ghost to auto-start on boot
    sudo update-rc.d ghost defaults sudo update-rc.d ghost enable

  17. Install nginx and follow the instructions

At this point you should have a fully functional ghost install running on google compute engine!

Steve Niemitz