Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

Costas Zarifis

Tutorials, code snippets, hacks and turtles... A lot of turtles... Heh.

Installing Ghost on Ubuntu

Ghost Image

So a while back I started keeping notes using the markdown format. It's without a doubt a very convenient and easy to use format and you can take notes that look magnificent without spending a huge amount of time trying to make it work. Yes I'm looking at you LaTeX.

Apart from the note-taking part I started using it to document stuff I'm doing. Installing packages, playing around with virtual machines and so on, it just made everything seem so easy, and that brings us to now. I ended up with a huge collection of markdown documents and with literally no way of quering them if I wanted to redo something that I've documented, and then it hit me.

Hmm… What if there was a blogging platform that would work natively with markdown.

No, format changes, no hassle, it would just work. Wait a minute! This thing already exists!

It's called Ghost!

Ok I'll be fair. At first I had a peak at dropplets but let's be honest, there is really no comparison.

Anyways, without any further ado here is a guide to install Ghost on your own server.

I'm assuming that you are using Ubuntu as the Operating system and that you already have an apache server installed, so if you need to do some extra steps for those, go ahead do that and get back here!

Before we start downloading Ghost let's make sure that node.js is installed as well. Try out the following:

 sudo apt-get install nodejs

If that doesn't work then you should probably do this:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Install npm:

sudo apt-get install npm

You might also need to install nodejs-legacy (I didn't have to):

 sudo apt-get install nodejs-legacy

OK, now download Ghost:

curl -L -o

Unzip it and place it on the right dir:

unzip -uo -d ghost

Install Apache2 server:

sudo apt-get update
sudo apt-get install apache2
mkdir /var/www/
reboot now

After rebooting do the following:

cp -r ghost/* /var/www/
cd /var/www/

If you don't have sqlite then you probably need to do this:

npm install sqlite3 --build-from-source

Install it:

npm install --production

copy the sample config file;

cp config.example.js config.js

Access it and change the fields that are relevant to your URL.

And start it:

npm start

This should do it! However, now Ghost runs locally and there is no way to access it from the internet. Ok let's fix that! Press ctrl+c for now.

sudo su
a2enmod proxy proxy_http
/etc/inid.d/apache2 restart
vim /etc/apache2/sites-available/    

This is the configuration file:

<VirtualHost YourIpAddress:80>
    # Indexes + Directory Root.
    DirectoryIndex index.php
    DocumentRoot /var/www/
    ProxyRequests Off
    ProxyPass /
    ProxyPassReverse /
    ProxyPreserveHost On

    <Proxy *>
            Order deny,allow
            Allow from


Ok almost done:

sudo a2ensite
/etc/init.d/apache2 restart

Cool! now there are a lot of ways to run Ghost in the background I used tmux:

sudo apt-get update
sudo apt-get install tmux
cd /var/www/
npm start
ctrl+b and then d

sudo npm install forever -g

About the author

Costas Zarifis


comments powered by Disqus