Everyone loves software that just works !!

Last year as part of revamping our web presence, we stumbled upon Ghost a light weight publishing platform. We loved it instantly and used it to power our blogging platform that we use to share our insights with the world. We even published a step-by-step guide to get the blog up and running with Ghost.

Ghost have been through complete overhaul over the past year. Their ecosystem has grown and flourished and they've been constantly exploring new avenues to make publishing a seamless experience. A major upgrade (2.0) was launched last week which introduced a slew of features - a powerful new editor, multi-language support, custom structures and much more. We at Gleecus are excited about it and couldn't wait to upgrade our Ghost blog and use its many goodies.

Here is an article we've pulled together to get Ghost platform up and running with latest version.

NOTE: This article details fresh installation of Ghost. In case you are looking for upgrade tutorial, you can find them here.

Pre-requisites setup

For the sake of this article, we assume that you have an AWS EC2 instance (or any VPS/Server that runs Ubuntu 16.04) launched and you can SSH to that instance from your local machine.

Run the following commands on the server to setup the required libraries.

sudo apt-get update

sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev
libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
git-core curl libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev systemd
libcurl4-openssl-dev python-software-properties

Install the recommended version of NodeJS and NPM

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

node -v. ## v8.11.4
npm -v. ## v5.6.0

Install MySQL Server and Client software

sudo apt-get install mysql-server mysql-client
mysql_secure_installation

mysql -u root -p

CREATE USER ‘ghostuser’@‘localhost’ IDENTIFIED BY 'ghost123#@!';
GRANT ALL PRIVILEGES ON * . * TO ‘ghostuser’@‘localhost’;
FLUSH PRIVILEGES;

systemctl status mysql.service
sudo systemctl start mysql

Install Nginx Web server and Reverse Proxy

sudo apt-get install nginx
systemctl status nginx
sudo systemctl start nginx

Create a non-root user to run ghost commands and login as that user

sudo adduser ghostuser
sudo usermod -aG sudo ghostuser

su - ghostuser

Ghost installation

After logging as the new non-root user (ghostuser), run the following commands to create Ghost directory and manage its permissions.

sudo mkdir -p /var/www/html/ghost/
sudo chown -R ghostuser:ghostuser /var/www/html/ghost/
sudo chmod -R 755 /var/www/html/ghost/

Login to the newly created directory and run the following command to install Ghost CLI. Once installed, ghost command is available globally.

cd /var/www/html/ghost
sudo npm i -g ghost-cli

ghost help

Use the ghost command to install the latest version of Ghost platform. It creates another system user with the name ghost which is used to manage Ghost installation. The installation asks for a slew of questions with Yes/No options. Based on the answers, the installation is completed, configuration files are created, Nginx will be updated and your blog would be live (presuming DNS propagation is done already).

ghost install

ghost ls

What's Next?

Now that the blog is up and running, here are few things that you would like to do.

-- Setup Administration dashboard by accessing domain.tld/ghost

-- Setup Mail configuration

-- Add comment thread (eg: Disqus) and web analytics (eg: Google Analytics) scripts to your blog posts.