Install Ghost on Ubuntu 14.04

ghostIn this blog post we will show you how to install Ghost on an Ubuntu 14.04 VPS with the latest version of Nginx. Ghost is a new exciting blogging platform built on Node.js. The Ghost user interface is very simple and straightforward making it great for beginners as well as advanced users.This guide should work on other Linux VPS systems as well but was tested and written for Ubuntu 14.04 VPS.

Log in to your VPS via SSH

ssh myUsername@myVPS_IP

Update the system and install necessary packages.

root@vps:~# sudo apt-get update && sudo apt-get -y upgrade
root@vps:~# sudo apt-get install python-software-properties unzip wget

Install Node.js

We will install the latest nodejs package from Chris Lea’s repo

root@vps:~# sudo add-apt-repository ppa:chris-lea/node.js
root@vps:~# sudo apt-get update
root@vps:~# sudo apt-get install nodejs

Download and extract the latest Ghost version

root@vps:~# mkdir ~/myGhostBlog
root@vps:~# wget
root@vps:~# unzip -d ~/myGhostBlog
root@vps:~# rm -f

Install and Configure Ghost

Change into the ~/myGhostBlog directory and install Ghost.

root@vps:~# cd ~/myGhostBlog
root@vps:~# npm install --production

When the installation is finished, run the following to start Ghost in development mode:

root@vps:~# npm start

If you see the below message, it means you’ve successfully installed Ghost.

Ghost is running in development... 
Listening on 
Url configured as:

Stop the process with Control-C and continue with the Nginx installation.

Install and Configure Nginx

The latest version of Nginx 1.6.2 is not available via the default Ubuntu repositories, so we will add the “nginx/stable” PPA, update the system and install the nginx package.

root@vps:~# sudo add-apt-repository ppa:nginx/stable
root@vps:~# sudo apt-get update
root@vps:~# sudo apt-get install nginx

Create a new Nginx server block with the following content

root@vps:~#sudo nano /etc/nginx/conf.d/
server {
    listen 80;

    access_log /var/log/nginx/myGhostBlog-access.log;
    error_log /var/log/nginx/myGhostBlog-error.log;

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;

Test the Nginx configuration and restart the server

root@vps:~# sudo nginx -t
root@vps:~# sudo /etc/init.d/nginx restart

Create an Upstart script

sudo nano /etc/init/ghost.conf
start on runlevel [2345]
stop on shutdown
respawn limit 5 60
env name=ghost
env uid=myUsername
env gid=myUsername
env daemon=/usr/bin/node
env path=/home/myUsername/ghost/index.js
export NODE_ENV=production

exec start-stop-daemon --start --make-pidfile --pidfile /var/run/$ --name $name -c $uid:$gid -x $daemon $path >> /var/log/upstart/$name.log 2>&1
end script

You can now start, stop and restart your Ghost instance with

service ghost stop 
service ghost start 
service ghost restart 

That’s it. Now open your browser, type the address of your website, e.g. and create an admin user to log in to the Ghost.

For more information about how manage your Ghost blog, please refer to the Ghost website.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

How to Open Ports in Ubuntu and CentOS using IPtables
Install MongoDB on a CentOS VPS
Install and Setup NodeBB with Redis and Nginx on Ubuntu 12.04