What is Ghost?
Ghost is a modern, open-source blogging platform which is excellent for online publishing. Ghost is very cutomizable and multiple themes that one can buy and use. You can also make your own Ghost themes. One particular example of a company using Ghost to publish their blog is Cloudflare. In fact, my own blog runs on Ghost! Ghost has a beauitiful online editor to type and publish articles, and makes use of easy-to-use Markdown language.
Where to use Ghost?
Ghost is best used to manage and publish blogs. I would personally recommend Ghost over Wordpress for blogging as Wordpress has evolved into more of a Content Management System than a simple blogging platform. I personally also think that Ghost is WAY more beautiful for publishing articles.
Assumption: You have a non-root account with root/sudo privileges. This is usually the case in Ubuntu 16.04. Ghost does not work if you run the program as root. Additionally, DO NOT create a ghost user.
First, update and upgrade your system
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
Install NGINX or Apache webserver
sudo apt-get install -y nginxor
sudo apt-get install -y apache2
I will be using Apache Web Server as I personally think it is easier to maintain for new users.
sudo apt-get install mysql-server -y
Make sure to set a good root password
(Recommended) Make your MySQL installation secure
Make sure to remove all th default users and tables
Install NodeSource APT repository
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash
WARNING: Newer versions of Nodejs (newer than 8.9) don't work as of the time of writing this article
sudo apt-get install nodejs -y
Install the Ghost-CLI
sudo npm i -g ghost-cli
Create a folder for Ghost
sudo mkdir -p /var/www/ghost
Change ownership for your Ghost folder to the user with sudo privileges
sudo chown [user]:[user] /var/www/ghost
Change the permissions of the Ghost folder
sudo chmod 755 /var/www/ghost
Navigate to the folder
Go through the prompts. For the URL, use the domain name that you want the blog to be available at. DO NOT configure NGINX if you intend to use Apache. Otherwise, select yes in the NGINX option
ghost startin the directory to start the blog if it isn't running already. By default, Ghost natively operates on port 2368
If you used Apache, create a new VirtualHost for the blog. Add the following lines to the http/https config (Assuming you have all the mods for reverse proxy enabled for Apache):
<VirtualHost *:80> #Use 443 for HTTPS config file ServerName <your-domain-name-for-blog> ServerAlias <Alternate-domain-name-for-blog> #Optional ProxyPreserveHost On ProxyPass / http://127.0.0.1:2368/ ProxyPassReverse / http://127.0.0.1:2368/ </VirtualHost>
You should be done now! You can go to http://<domain-name>/ghost to access the admin panel for ghost, tweak all of its features!