Ghost is an open source blogging platform that helps you easily create a professional-looking online blog.

In this guide you’ll set up, deploy, and secure a Ghost CMS on a server running Ubuntu 20.04 LTS (focal fosa), using Nginx, MySQL, Node.js, npm, Ghost-CLI, and Let’s Encrypt.

Before you begin

Create/add a new non-root user account:

useradd johndoe -c "John Doe" -m -d /home/johndoe -s /bin/bash && passwd johndoe

Install Nginx

Nginx will be used as a reverse proxy for your Ghost application:

sudo apt install -y nginx

Check the Nginx version:

sudo nginx -v
# nginx version: nginx/1.17.10 (Ubuntu)

Install MySQL

Download and install MySQL:

sudo apt install -y mysql-server

Check the MySQL version:

mysql --version
# mysql  Ver 8.0.19-0ubuntu5 for Linux on x86_64 ((Ubuntu))

Run the mysql_secure_installation script to setup password for the MySQL root user:

sudo mysql_secure_installation

Run sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf and add the following to [mysqld]:


Restar MySQL:

sudo systemctl restart mysql.service

Install Node.js and npm

Ghost is built on Node.js and follows Node’s Long Term Support (LTS) plan. Ghost only supports LTS versions of Node.js.

Download and install recommended Node.js version which is 12.x (Node v12 Erbium LTS) at the time of this writing:

curl -sL | sudo -E bash -
sudo apt install -y nodejs

Check the Node.js and npm versions:

node -v && npm -v
# v12.18.2
# 6.14.5

npm is a separate project from Node.js, and tends to update more frequently. As a result, even if you’ve just downloaded Node.js (and therefore npm), you’ll probably need to update your npm. Luckily, npm knows how to update itself! To update your npm, type this into your terminal:

sudo npm install -g npm@latest

Recheck npm version:

npm -v
# 6.14.6

Install Ghost-CLI

Ghost-CLI is a command line interface (CLI) tool that makes installing and updating Ghost easy.

Install Ghost-CLI:

sudo npm install -g ghost-cli@latest

Check the Ghost-CLI version:

ghost version
# Ghost-CLI version: 1.14.1

Troubleshoot the system for any potential issues when installing or updating Ghost:

ghost doctor install
You will probably get this warning that you can ignore - "System checks failed with message: 'Linux version is not Ubuntu 16 or 18'
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using ghost install local instead.
? Continue anyway? Yes"

Get help about ghost:

ghost help

Install Ghost

Create the document root directory:

sudo mkdir -p /var/www/ghost

Change ownership of the /var/www/ghost directory to the non-root user with sudo privileges that you created. In this example, ghostexample:

sudo chown ghostexample:ghostexample /var/www/ghost

Navigate to the Ghost root directory:

cd /var/www/ghost

Ensure that the directory is empty to avoid file conflicts:

ls -a

Install Ghost in production mode:

ghost install

Answer each question as prompted. For more information about each question, visit the Ghost documentation:

? Enter your blog URL:
? Enter your MySQL hostname: localhost
? Enter your MySQL username: root
? Enter your MySQL password: areallysecurepassword
? Enter your Ghost database name: exampleGhost
? Do you wish to set up Nginx? yes
? Do you wish to set up SSL? yes
? Enter your email (used for Let's Encrypt notifications)
? Do you wish to set up "ghost" mysql user? yes
? Do you wish to set up Systemd? yes
? Do you want to start Ghost? yes

After installation is complete, run ghost ls to view running Ghost processes:

ghost ls

In the future when a newer version of Ghost is released, run ghost update from the /var/www/ghost directory to update to the newest version.

Complete the Setup

To complete the setup process, navigate to the Ghost configuration page by appending /ghost to the end of your blog’s URL or IP. This example uses

On the welcome screen, click Create your account:

Ghost Welcome Screen

Enter your email, create a user, password, and blog title:

Create Your Account Screen

Invite additional members to your team. If you’d prefer to skip this step, click I’ll do this later, take me to my blog! at the bottom of the page.

Invite Your Team Screen

Navigate the Ghost admin area to create your first post, change your site’s theme, or configure additional settings:

Ghost Admin Area