Setting up Ghost revisited
A while back I have written up a brief walkthrough on setting up a NodeJS application on your own EC2 instance, or any VPS.
The link to the old post is here - Running a NodeJS Application on Ubuntu
Since then, Ghost has published Ghost-CLI which made the setting up process so much smoother on your VPS. With this package You still need Nginx and MySQL installed as prerequisites, but you no long need to configure pm2 to keep the Ghost server running anymore.
I have listed the steps below for setting up Ghost after I launched an Ubuntu 16.04 EC2 with free tier and also a free tier RDS instance.
SSH onto your instance and install Nginx
#install Nginx
sudo apt-get update
sudo apt-get install nginxInstall nvm and node, nvm gives you more freedom to hop between node versions.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 10.15Install ghost-cli
npm install ghost-cli -gCreate a new web root directory for your new Ghost blog
cd /var/www/html/
mkdir ghost
ghost installFollow the prompted options to configure
Here is a more detailed guide from ghost-cli. https://docs.ghost.org/install/ubuntu/