In today tutorial we are going to see the Installation Method for Ghost blog CMS on Ubuntu 16.04 with Free SSL.

This Tutorial is Deprecated Follow our Latest & Updated Guide to Install Ghost CMS via Ghost-CLI with Free SSL and HTTP/2 Support.

Update - How to Install Ghost on Ubuntu With Free SSL & HTTP/2

Requirements

  • SSD VPS - Minimum 1GB Ram
  • SSH Terminal and Windows OS (Use Putty)
  • OS - Ubuntu 16.04 64bit LTS

Hosting

  • Digitalocean
  • Vultr
  • Linode

Features

  • Nginx
  • Free SSL with A+ Grade
  • HTTP/2

How to Install Ghost Blog CMS on Ubuntu

Here is the Step by Step Guide to install Ghost Blog CMS on Ubuntu with Free SSL

  • Create droplet/server with 16.04 Ubuntu its Requires min 1GB Ram for Smooth running
  • Connect your Droplet/Server on SSH Terminal
  • update your packages and tools
sudo apt update && apt upgrade -y
  • install the Zip and other essential tools
sudo apt install -y zip build-essential
  • Now install Let's Encrypt
sudo apt install -y letsencrypt
  • check let's encrypt version
letsencrypt --version

install Ghost Blog CMS on Ubuntu

  • Now install Let's Encrypt Free SSL Certificate to your Domain
letsencrypt certonly -d example.com -d www.example.com --email [email protected] --agree-tos --standalone

install Ghost Blog CMS on Ubuntu

Install Node.js TLS Version

  • Install Python install python software properties
sudo apt-get install python-software-properties
  • now download node.js setup package via curl method
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  • Install Node.js and NPM
sudo apt-get install nodejs

install Ghost Blog CMS on Ubuntu

Install Nginx Server

  • Download packages and Keys
wget https://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key
rm nginx_signing.key
printf "deb https://nginx.org/packages/mainline/ubuntu/ xenial nginx \ndeb-src https://nginx.org/packages/mainline/ubuntu/ xenial nginx \n" >> /etc/apt/sources.list.d/nginx.list

install Ghost Blog CMS on Ubuntu

  • Install Nginx
sudo apt update && apt install nginx -y

install Ghost Blog CMS on Ubuntu

  • Start the Nginx
sudo service nginx start

install Ghost Blog CMS on Ubuntu

  • Now Configure Nginx as Reverse Proxy and Create ghost.conf File
nano /etc/nginx/conf.d/ghost.conf
  • Copy and paste this Below code on ghost.conf

server {  
    listen 80;
    listen [::]:80;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name example.com www.example.com;

    # Redirect HTTP to HTTPS
    if ($scheme = http) {
        return 301 https://$server_name$request_uri;
    }

    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
    ssl_stapling on; 
    ssl_stapling_verify on;

    add_header x-xss-protection "1; mode=block" always;
    add_header x-frame-options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";

    client_max_body_size 10G;

    location / {

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://127.0.0.1:2368;
        proxy_redirect off;
        proxy_hide_header X-powered-by;

    }

}

  • Replace example.com with your domain name

install Ghost Blog CMS on Ubuntu

  • CTRL + X to save the Settings
  • After that, it asks confirmation to save the settings click yes to save the settings
  • Pree Enter to Exit
  • Verify the Configuration
nginx -t
  • Restart the Nginx
sudo service nginx restart

install Ghost Blog CMS on Ubuntu

Install Ghost Blog CMS

  • First Create a Web root directory for Ghost Installation
mkdir -p /var/www/
  • Create a New User for Ghost
adduser ghost

install Ghost Blog CMS on Ubuntu

  • Now go to www folder
cd /var/www
  • Download the Latest version of Ghost Blog CMS
wget https://ghost.org/zip/ghost-latest.zip
  • unzip the package
unzip ghost-latest.zip -d ghost
  • set the permission
chown -R ghost:ghost /var/www/ghost/
  • remove the Downloaded zip pack
rm ghost-latest.zip
  • Now Open as ghost user
su - ghost
  • install NPM Modules on Ghost Blog CMS
  • Open Ghost folder
cd /var/www/ghost
  • Install NPM Production
npm install --production

install Ghost Blog CMS on Ubuntu

  • Now configure your Ghost blog
cp config.example.js config.js
  • Open config.js file
nano /var/www/ghost/config.js
  • update your Ghost blog URL

install Ghost Blog CMS on Ubuntu

  • Save the Modification and Exit
  • Now start your Ghost Blog
npm start --production
  • it will setup Everything for you :)

Run the Ghost Blog Forever

If we Close the terminal or server Our Ghost blog also automatically stopped for this we need to install Forever Node Process to live our Ghost blog For 24x7.

  • open as su user
su - ghost
  • Open ghost installed Folder
cd /var/www/ghost
  • Now Install the NPM Forever process
npm install forever
  • export the Forever Command Process to your Node Modules path
echo "export PATH=/var/www/ghost/node_modules/forever/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
  • Now start the Ghost blog for Forever
NODE_ENV=production /var/www/ghost/node_modules/forever/bin/forever start index.js
  • That's all Successfully we install Ghost Blog CMS on Ubuntu with Free SSL
  • Now open this URL & Set up your New Ghost blog

https://example.com/ghost/setup/

  • Replace example.com with your Ghost blog URL

install Ghost Blog CMS on Ubuntu

SSL with A+ Grade

install Ghost Blog CMS on Ubuntu

HTTP/2 Support

install Ghost Blog CMS on Ubuntu

Run Ghost blog as service

This one is very important on Ghost blog CMS run ghost blog as service will help us Start/stop/restart our Ghost blog.
Here are the Guide to Install and Activate ghost.service on Ubuntu

From the Editor's Desk

If you Need any Help in Ghost Blog CMS Installation Just drop your Comments here I will Guide you.