in Information Technology ~ read.
The easy way to setup a ghost blog (behind apache server)

The easy way to setup a ghost blog (behind apache server)

Wordpress is a great tool to build websites. In my opinion, it became too powerful (= complicated) for a simple blog. Therefore, I decided to research alternatives for my new blog.

After some research, I decided to utilize Ghost. My main criteria were:

  • Minimalistic
  • Self-hosted
  • Uses modern technology
  • In active development
  • Open source

There are two options to use Ghost: 1) Ghost Pro or 2) Ghost self-hosted

In following you can find a description to create a self-hosted Ghost Blog on a Ubuntu 14.04 LTS Server.

Step 0 - Pre-Setup

Install Apache and node.js

# sudo apt-get nodejs apache2

enable proxy in apache

# sudo a2enmod proxy

Step 1 - Create and change to a folder on your Ubuntu 14.04 LTS Server

# mkdir /var/www/myghostblog
# cd /var/www/myghostblog

Step 2 - Download latest ghost blog version

# curl -LOk

Step 3 - Extract ghost blog files

# unzip

Step 4 - Configure Ghost files

# cp config.example.js config.js

Step 5 - Changes in config.js

# vi config.js

Change the following

production: {  
        url: '',

        server: {
            host: '',

Step 6 - Run as a process

# sudo curl \
  -o /etc/init.d/ghost
# sudo useradd -r ghost -U
# sudo chown -R ghost:ghost /var/www/myghostblog
# sudo chmod 755 /etc/init.d/ghost

Step 7 - Proxy Ghost blog traffic through apache

Add the following in your vhost file in apache

# vi /etc/apache2/sites-available/

and add

<VirtualHost *:80>  
     DocumentRoot /var/www/blank
     RewriteEngine On
     RewriteCond %{HTTP_HOST} !^www\. [NC]
     RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
     ProxyPass / http://localhost:2368/

enable the site, start ghost blog and restart apache

# service ghost start
# a2ensite
# service apache2 restart

Now the blog is set up and running.

Let's auto-start ghost - just in case the server gets restarted.

# update-rc.d ghost defaults
# update-rc.d ghost enable

You have a question about this post, or you would like me to write more about a similar topic? Leave a comment or E-Mail me at

comments powered by Disqus