Install Ghost

Install Ghost

by John Vincent

Posted on March 1, 2017

This is part of a series of discussions regarding Deploying to a Digital Ocean Droplet. For more details, please see Overview of website

Install Ghost on Ubuntu

Useful reference

You must have set the swap for a successful installation of Ghost.

Overview of website recommends to install Ghost in var/www/ghost

sudo mkdir -p /var/www/
cd /var/www/
sudo wget

unzip it

sudo unzip -d ghost
sudo rm
cd ghost/

Now we can install the Ghost dependencies and node modules (production dependencies only):

sudo npm install --production

Setting up Ghost

cd /var/www/ghost

Copy example configuration file:

sudo cp config.example.js config.js

edit configuration file:

sudo vi config.js
var path = require('path'),

config = {
    // ### Production
    // When running Ghost in the wild, use the production environment.
    // Configure your URL and mail settings here
    production: {
        url: '',
        mail: {},
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            debug: false

        server: {
            host: '',
            port: '2368'

module.exports = config;



  • use of port: 2368
  • Nginx server block

    • proxy_pass;

The proxy allows browser to use port 80.


Change the directory ownership to your own user so that you can write to it

sudo chown -R jv:jv /var/www/ghost
cd /var/www/ghost
find . -type d -print0 | xargs -0 chmod 0755 # For directories
find . -type f -print0 | xargs -0 chmod 0644 # For files

Start Ghost

sudo npm start --production

Test Ghost

Your blog is now available on