Having run a web server for many years to host some general websites for university projects etc. I have always used some kind of hosting control panel from cPanel to zPanel and finally, I have stayed with Vesta CP for a while. Vesta CP is running well and I have not had any problems so far... Until trying to get Ghost Blog to function properly as its node.js based.

Ghost Blog

I was originally introduced to Ghost Blog through a colleague David, he blogs about useful things that could come in handy again some day down the line. Having worked with Wordpress loving all the features the come with it, the simplicity of Ghost looked very attractive, making me want to test it out for myself.


My web server is an EC2 instance running on AWS (Amazon Web Services) with a static IP address. For this installation guide, I'm going to create a Ghost Blog with the domain I'm presuming that the domain is already forwarding to the web server IP address.

Vesta CP Preparation

Load up your Vesta control panel and add a new web domain. When creating this domain do not use "Proxy Support" as we will be adding NGINX information manually. The record should look like this:

Getting Dirty on the CLI!

Once you have created the domain in Vesta CP you will now have a folder on your web server where all the files will be located for this domain. Mine for examble is /home/admin/web/

Installing Prerequisites

For Ghost to run we need to install node.js we can do this with these commands.

sudo apt-get update
sudo apt-get install nodejs

We will also need the node package manager we can do this with this command

sudo apt-get install npm

This is all we need for node.js

Setting up Ghost

By now if you navigate to your domain you will see a landing page that Vesta places in your folder. We first need to navigate the cli and bring our working directory to our public_html folder for our domain.

cd /home/admin/web/

Vesta CP will create an index page we can remove this.

rm index.html

Now to the good stuff downloading and installing Ghost.

curl -L -o
unzip -uo

Now we have downloaded the files and unzipped them we need to edit the config file

nano config.example.js

and change these lines to your domain and your Vesta CP Internal IP address your internal IP address can be found under the IP tab at the top of Vesta CP. I will also be changing the port as I have multiple Ghost blogs running but you don't need to do this.


Below is my configuration

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: '3000'

Save the file and now we can rename it to config.js

mv config.example.js config.js

We can now install the blog

npm install --production

and run the blog finally!!

npm start --production 


Navigating to does not work as vesta panel needs to know via NGINX where to redirect for this we need to add some NGINX configuration.

Navigate to your conf directory mine is /home/admin/conf/web/nginx.conf once we are in this we need to add some code to redirect the web request. Swap out the IP addresses with your IP addresses and port numbers, change the server name and root directory.

server {


    root /home/admin/web/;
    index index.js;

    location / {

restart nginx

/etc/init.d/nginx restart 

start the ghost

npm start --production 

Once we start the service again and navigate to you should be welcomed by Ghost.


I wanted to tweak some things so I can start and stop blogs easy and have the blogs start on server reboot.

Start and stop ghost easily

We can add a little code to be able to start and stop the ghost service very easily

cd /etc/init/
touch ghost_travel.conf
nano ghost_travel.conf

and use this script

description "ghost server"

start on started mountall
stop on shutdown

respawn limit 99 5

export HOME="/home/admin/web/"
cd $HOME
exec npm start --production >> /var/log/ghost.log 2>&1
end script

post-start script
end script

changing the directory and saving will allow you to use these commands

start ghost_travel
stop ghost_travel
restart ghost_travel

making it easier to manage multiple blogs.