Hostwinds Tutorials
Search results for:
Table of Contents
Tags: Ubuntu
Ghost CMS is a fast, secure, open-source platform built on Node.js that can be a good alternative to WordPress, Medium, or other blog platforms. While Ghost has built-in SEO support, member payments, and email newsletters, there is no eCommerce support yet, so it may not be right for you.
This guide will walk through the steps to install Ghost CMS on a server running Ubuntu 16.04, 18.04, or 20.04.
Install Nginx by running:
sudo apt-get install Nginx
If ufw firewall is running on the server, allow Nginx through the firewall:
sudo ufw allow 'Nginx Full.'
Next, install the MySQL server:
sudo apt-get install mysql-server
At this point, it is recommended to use the secure installation script. Follow the prompts given:
sudo mysql_secure_installation
Ubuntu 18.04 and 20.04 only:
Lastly, ensure Ghost-CLI is compatible with MySQL. Set the root password with the following:
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '**password**';
quit
End Ubuntu 18.04 and 20.04 only.
Then you will need to install Node.js with the following:
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash
sudo apt-get install -y nodejs
We will first install Ghost-CLI, a useful tool for managing Ghost on your server:
sudo npm install ghost-cli@latest -g
It is required to install Ghost in a new directory so that we will create one called ghost:
sudo mkdir -p /var/www/ghost
Define the directory owner by replacing it with your username:
sudo chown **<user>**:**<user>** /var/www/ghost
Set the permissions:
sudo chmod 775 /var/www/ghost
Then change to the new directory:
cd /var/www/ghost
Now start the installation:
ghost install
Blog URL: Enter your domain pointed to the server, including the protocol (https://your-domain-name.com).
MySQL hostname: For this installation, we should use localhost, as MySQL was installed on this server. If your database is hosted on another server, enter the hostname.
MySQL username: For new installations, use root.
MySQL password: Enter the root password.
Ghost database name: Create a name for your database.
The remaining options are recommended, and SSL will be installed using Let's Encrypt.
Now you should be able to reach your Ghost blog at https://your-domain-name.com. Start creating your blog at https://your-domain-name.com/ghost.
Written by Benjamin Bream / May 22, 2020