Ghost is a modern and completely open source publishing platform. It has gained high popularity amongst the developers since its release, in 2013. It holds an MIT license and is publicly available on GitHub. It is built on top of the Node.js platform. It is easy to use and can be customized by the ordinary users as well. Using Ghost, can allow users to publish content with almost zero learning curve.
The key features include:
- It takes 300MB of RAM.
- The content for Ghost is formatted in the Markdown language.
- You can create content using Ghost on your phone.
- It is powered by built-in support for Accelerated mobile pages (AMP) which makes its loading very fast on your mobile.
- It is Emoji supportive.
- The Ghost 3.0 is a third major stable release of the Ghost content management system (CMS).
- It is self-manageable.
This guide will help you to install Ghost CMS on Ubuntu 18.04 using Nginx as a proxy, free Let’s Encrypt SSL certificate, the latest version of node.js and MySQL/ MariaDB as the database backend server.
Before you learn how to install Ghost, you will need:
- You will need at least 16GB of RAM. If you have less than that, you can create a swap file.
- Ubuntu version 16.04 or 18.04.
- A valid domain name and configured DNS records
- Update your system using the command,
sudo apt update && sudo apt upgrade
Install the build essentials using code,
sudo apt install build-essential
How to install Ghost CMS on Ubuntu
Follow these steps to install Ghost CMS on Ubuntu.
STEP-1 Installing Nginx
You need to install Nginx as a reverse proxy server for your Ghost application. Use the code:
sudo apt install nginx
STEP-2 Installing MySQL
Ghost supports MySQL, MariaDB, and SQLite databases, MySQL is the recommended database for the Ghost production mode. Follow these steps:
Download and install MySQL, by running:
sudo apt install mysql-server
Log in the database:
Set a password for MySQL database root user using the following command. Replace
password with a strong password
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Exit the MySQL database
STEP-3 Installing Node.js and NPM
Enable the NodeSource repository for Node.js using the curl command:
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
Install Node.js by using code:
sudo apt install nodejs
STEP-4 Install and configure Ghost
Ghost-CLI or command line interface is a tool that facilitates the installation and updating of Ghost easy. It helps in completing the circuit with Nginx as the reverse proxy server, enables TLS/SSL certificate using Let’s Encrypt CA, renews your SSL, and initializes Ghost as a system service.
Follow these steps to install Ghost:
Install Ghost using code:
sudo npm install -g [email protected]
Create a document root directory
sudo mkdir -p /var/www/ghost
Change the ownership of the directory to the non- root user using sudo privileges:
sudo chown ghostexample:ghostexample /var/www/ghost sudo chmod 775 /var/www/ghost
In the above, ghost example is an the username. You can change it.
Navigate the Ghost root directory:
Make sure that the directory is empty, to avoid file conflicts
Now, install Ghost in production mode:
You will be prompted to set your blog URL and your MYSQL information. Provide the username and the password that you set up in the Installing MySQL section. Use the default database name like
Enter your blog URL: https://example.com Enter your MySQL hostname: localhost Enter your MySQL username: root Enter your MySQL password: [hidden]Enter your Ghost database name: ghost_prod
After that, you will be asked if you want to set up MySQL user, Nginx, SSL, Systemd, and then start Ghost.
Setting up "ghost" system user Do you wish to set up "ghost" mysql user? yes 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) [email protected] Do you wish to set up Systemd? yesDo you want to start Ghost? yes
After completing the installation, run
Ghost ls to view all the processes
In case, if a new Ghost version is released, run
ghost update from the
/var/www/ghost directory to update it.
STEP-5 Complete the setup
Complete the setup by navigating to the Ghost configuration page by appending
/ghost to the end of the blog’s URL.
Create your account on the welcome page
Enter details like email address, password and blog title.
Invite the additional members of your team.
Create your first post, change your site’s theme, and configure the settings
STEP-6 Troubleshooting Ghost
Troubleshoot any problems when installing or updating Ghost using code
Get all the help you need about Ghost using code,
ghost - -help
This tutorial will help you to install Ghost CMS on Ubuntu.