1 min read

How to install Ghost CMS on Ubuntu 20.04 LTS

How to install Ghost CMS on Ubuntu 20.04 LTS

Today I will be showing you how you can install the Ghost CMS on a fresh Ubuntu 20.04 installation. Let's get straight into it.

  1. Connect to your server with Ubuntu 20.04 (fresh installation)
  2. add your user (the one that will be used to install and control Ghost) to sudoers
sudo usermode -aG sudo <your_user_name>
su - <your_user_name>
  1. Update system
sudo apt update && sudo apt upgrade -y
  1. Install NGINX and curl
sudo apt install nginx curl -y
  1. Install MySQL or mariadb
sudo apt install mysql-server -y

OR

sudo apt install mariadb-server -y

Preform all relevant configurations on MySQL, including creating your user (if you are not using the root user).
If you decided to use MySQL, you will need to amend the password type for the user that will be used by Ghost, below is an example how do to so with the root user:

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
quit
  1. Now we will need to install Node.JS
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash
sudo apt-get install -y nodejs
  1. Let get the Ghost-CLI
sudo npm install ghost-cli@latest -g

So, we have all the packages that where required for Ghost. To install the Ghost CMS you just need a place for it now.
Create a folder in a location that you want to store the Ghost CMS files, example:

sudo mkdir -p /var/www/sitename

sudo chown <your_user_name>:<your_user_name> /var/www/sitename

sudo chmod 775 /var/www/sitename

cd /var/www/sitename
  1. Now (in the created folder) just RUN the installation process for Ghost CMS
ghost install

Enjoy!