How to install Ghost publishing platform on your production server

  • Ubuntu 18.04
  • MySQL
  • nginx 1.10.3
  • systemd
  • Node v8 LTS (higher versions are not supported yet)
  • VPS: 2 CPU Core, 2GB RAM

Install nginx, MySQL

Update package list

sudo apt update

Update installed packages

sudo apt upgrade

Install nginx

sudo apt-get install nginx

Open Firewall for HTTP/HTTPS

sudo ufw allow 'Nginx Full'

Verify it works

Install MySQL

sudo apt-get install mysql-server

Install Node.js 8 LTS

Add Node.js PPA

sudo apt install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

Install Node.js

sudo apt install nodejs

Verify installed version

$ node -v
v8.11.3
$ npm -v
5.6.0

Install Ghost-CLI

sudo npm i -g ghost-cli
ghost help

Install Ghost via the CLI

sudo mkdir -p /var/www/ghost
sudo chown $USER:$USER /var/www/ghost
chmod 775 /var/www/ghost
cd /var/www/ghost
ghost install
  • This will install and start your blog in production mode using MySQL as the default database
  • If you want to install Ghost with Sqlite3, please read how here
  • Checkout our detailed prompts guide, which explains all the questions you’ll be asked during install.
http://{your-ghost-url}/ghost

When an install fails

Config file

{
"url": "http://{your-url}",
"server": {
"port": 2368,
"host": "127.0.0.1"
},
"database": {
"client": "mysql",
"connection": {
"host": "{db-host}",
"user": "db-user",
"password": "db-password",
"database": "db-name"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/www/ghost/content"
}
}

Email config

Mailgun

"mail": {
"transport": "SMTP",
"from": "no-reply@{your-domain}",
"options": {
"service": "Mailgun",
"auth": {
"user": "{mailgun-SMTP-Login}",
"pass": "{mailgun-SMTP-Password}"
}
}
},

Adding Google Analytics

  1. Find and copy your Google Analytics Tracking Code from within your Google Analytics account
  2. From within your publication, go to Settings > Code Injection from the admin menu
  3. Paste the tracking code into the Blog Header section of the Code Injection settings
  4. Click Save.

Adding Disqus comment

  1. Head over to http://disqus.com/admin/create/ and fill out the form:
  • Site Title: Enter the name of your website
  • Disqus URL: This is automatically set based on the site name but you can also customize it.
  • Category: Choose a category that best describes your website.

Maintaining and troubleshooting

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

On the Way to the Top Part 2: Staff

My Mini View

Ruby | Rspec | Mocks & Stubs

Multi Stage Docker Build

Functional Interfaces in Java

Add Data at Scale | Datamarts in Power BI

Flutter: Adding native code in Flutter

Learning How To Code Was Not Easy Until I Did It The Right Way

Learning How To Code — Tutorial Hell

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chi Thuc Nguyen

Chi Thuc Nguyen

More from Medium

Unlimited Free Email Address using Cloudflare and your Free Custom Dom

Create a URL Shortener for personal use using CloudFlare worker in 5 min.

Hosting a Secure Website on EC2 with GoDaddy Domain and SSL Certificate

Building a Nuxt.js static website with SEO meta tags