Setup your blog with Ghost in 5 minutes
What? Why would I setup my blog with the help of a supernatural spirit? I am afraid of them. Ain’t any human here to help me out with my blog?
No need to be afraid of this Ghost. Ghost is an open-source software which you can install on your server to setup a fast, secure and clean blog. To see what your website will look after you deploy Ghost on your server, you can check out this Ghost demo. It is one of the best alternatives of Wordpress out there and very fast, secure, easy to setup, mobile first, clean UI and excellent for blogging and reading, rather than creating full-fledged websites. New to blogging? You can read about ways to start blogging.

Since Ghost is built on NodeJS and node applications mostly run behind web server proxy, we will need one and will be using Nginx as a web server for our application. Ghost node app runs on port 2368 by default and a web server will reverse proxy it to your website that is myawesomeblog.com. And to run our Node application we will use pm2 software. Pm2 is a node process manager and will keep our application running, monitor it and keep a log of things.
Now it’s time to setup your blog. You will need a linux server, using the Ubuntu 16.04 LTS will be your best bet as it is well supported by community and you will not encounter any hiccups. ssh into your server and perform the following steps
- First install NodeJS version 6, the latest LTS version. Installing Node is very easy, just input the following commands on your server console. For more information you can check out NodeJS website.
> curl -L https://deb.nodesource.com/setup_6.x | sudo -E bash -
> sudo apt-get install -y nodejs2. Now install Nginx web server and pm2 app server.
> sudo apt-get install nginx
> sudo npm install -g pm23. Download ghost in your home directory and unzip it to your blog folder. You will need unzip software for that. After that you should install the Ghost’s npm dependencies.
> cd
> curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
> sudo apt-get install unzip
> unzip ghost.zip -d myawesomeblog.com
> cd myawesomeblog.com
> npm install --production4. Now you will need to configure Ghost. A file named config.js controls the basic configuration of your blog. You need to create one in your blog folder. An example file config.example.js is provided which you can duplicate to config.js to create yours.
> cp config.example.js config.jsYou will only need to change the url for the production environment of the blog. Open config.js with your favourite text editor and change the url. The production url should now say:
url: 'http://myawesomeblog.com'5. Now we have to create an Nginx config file to serve your website. Go to Nginx config folder, create a config file for your website and activate it.
> cd /etc/nginx/sites-available
> sudo touch myawesomeblog.com
> sudo ln -s ../sites-available/myawesomeblog.com ../sites-enabled6. Now open the file in your favourite editor and save the following config into it.
server {
# domain name of your website
server_name myawesomeblog.com; access_log /var/log/nginx/myawesomeblog.com.access.log;
error_log /var/log/nginx/myawesomeblog.com.error.log; # proxy pass the requests to node
location / {
proxy_pass http://localhost:2368;
}
}
7. After that verify the config with the below command, if all is ok, restart the nginx server and start ghost with pm2.
> sudo nginx -t
> sudo service nginx restart
> cd ~/myawesomeblog.com
> pm2 start index.jsYou should now have a running Ghost website at myawesomeblog.com. Visit the url and you will be shown the Ghost setup page and you are all set to start publishing your posts.
To know more about other blogging software available, you can check out my post here. And if you are so inclined to use Wordpress only for your blog, you can check How to deploy Wordpress.
