Ghost officially recommends to use Ubuntu 16.04 with MySQL but it runs just fine on Ubuntu 18.04 and MariaDB. The following has been tested on a f1-micro Google Cloud Cloud Compute Engine.

  1. Install the latest Node LTS

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

  1. Install Nginx and MariaDB

sudo apt install nginx mariadb-server mariadb-client

  1. Secure MariaDB

sudo mysql_secure_installation

  1. Install the latest version of ghost-cli

sudo npm i -g ghost-cli@latest

  1. Create a user to run the ghost-cli

sudo adduser ghostuser
sudo usermod -aG sudo ghostuser

  1. Create a new directory for Ghost

sudo mkdir -p /var/www/ghost
sudo chown ghostuser:ghostuser /var/www/ghost

  1. Log in as the new user and go to the ghost directory

su ghostuser
cd /var/www/ghost

  1. Create a database and user for Ghost

sudo mysql -u root -p
CREATE DATABASE ghost;
CREATE USER 'ghostuser'@'localhost' IDENTIFIED BY 'your password';
GRANT ALL ON ghost.* TO 'ghostuser'@'localhost' IDENTIFIED BY 'your password' WITH GRANT OPTION;

  1. Install Ghost

ghost install