Full Steps To Install Ghost CMS on Ubuntu 22.04

In this guide, you will learn to install Ghost CMS on Ubuntu 22.04. Ghost is an open-source, free, powerful, lightweight, and modern CMS. It is used to create and publish blogs. Also, it offers a user-friendly and easy-to-use interface. Ghost CMS ships with a lot of features including:

  • Markdown-based editor to write and format content.
  • Built-in SEO tools to optimize content for search engines.
  • Responsive design.
  • Membership and subscription features.
  • Customizable themes and templates.

Here we try to provide a step-by-step guide that you can easily install Ghost CMS on Ubuntu 22.04. To do this, proceed to the rest of the article and start your Ghost CMS installation on Ubuntu 22.04.

How To Install Ghost CMS on Ubuntu 22.04?

Before you start your Ghost CMS setup, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can check the Initial Server Setup with Ubuntu 22.04.

Also, you need a valid domain name that is pointed to your server’s IP address.

The Ghost CMS setup requirements include Nginx, MySQL or MariaDB, Node.js, and Ghost user. To get the installation steps follow the rest of the article and install Ghost CMS on Ubuntu 22.04.

Step 1 – Install Nginx For Ghost CMS Setup

First, you must run the system update and upgrade by using the following command:

sudo apt update && sudo apt upgrade -y

Then, you must install the Nginx web server by using the following command:

sudo apt install nginx -y

Step 2 – Configure MariaDB Database Server For Ghost CMS

To install Ghost CMS on Ubuntu 22.04, you need a database server like MySQL or MariaDB. In this guide, we use MariaDB. To install it, you can run the command below:

sudo apt install mariadb-server -y

Start and enable the MariaDB server with the command below:

sudo systemctl enable --now mariadb

Then, secure your MariaDB installation and set a root password for it with the command below:

sudo mysql_secure_installation

At this point, you must log in to your MariaDB shell and create a database and user for Ghost CMS on Ubuntu 22.04. To do this, you can run the commands below:

# sudo mysql -u root -p
MariaDB [(none)]> CREATE DATABASE mydb;
MariaDB [(none)]> GRANT ALL ON mydb.* TO myuser@localhost IDENTIFIED BY "strongpassword";
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 3 – Create a User for Ghost CMS Administration

At this point, you must create a user that will be used for Ghost administration in the next steps. To do this, you can run the command below:

# sudo adduser ghostuser
# sudo usermod -aG sudo ghostuser

Now you need to set up node.js to install Ghost CMS on Ubuntu 22.04. To do this, follow the steps below.

Step 4 – Set up Node.js For Ghost CMS Installation

The latest version of Ghost CMS is compatible with Node.js 18. At this step, you must install Node.js on Ubuntu 22.04 before start using Ghost CMS on your server. To do this, you can use the following commands:

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

Note: If you have NMV and any node version installed on your server, you must uninstall it. To do this, you can use:

$ rm -rf $NVM_DIR ~/.npm ~/.bower
$ unset NVM_DIR;
$ which node;
$ rm -rf {path_to_node_version}

Also, you need to look in your ~/.bash_profile or ~/.bashrc and remove any nvm lines.

Step 5 – Install Ghost-CLI on Ubuntu 22.04

To access the Ghost command, you need to install the Ghost-CLI package on your server. To do this, you can use the following NPM command:

sudo npm install ghost-cli@latest -g

Verify your Ghost CLI installation by checking its version:

ghost -v
Output
Ghost-CLI version: 1.26.0

Step 6 – Create Ghost CMS Data Folder on Ubuntu 22.04

You should know that Ghost doesn’t work in the root or user home directory. You must create a new folder for your data in the /var/www directory. To do this, you can run the following command and switch to your Ghost CMS directory:

# sudo mkdir -p /var/www/ghostcms
# cd /var/www/ghostcms

At this point, you must set the correct ownership with the user you have created for Ghost CMS and set the correct permissions:

# sudo chown ghostuser:ghostuser /var/www/ghostcms
# sudo chmod 775 /var/www/ghostcms

Step 7 – Install Ghost CMS on Ubuntu 22.04 with ghost-cli

At this point, you can easily install Ghost CMS on Ubuntu 22.04 with the CLI tool. Switch to your Ghost user and run the commands below:

# sudo su - ghostuser
# cd /var/www/ghostcms
# mkdir example.com
# cd example.com

Then, use the following command to install Ghost CMS on your server:

ghost install

This will download and install Ghost CMS and its dependencies. During the installation, you will be asked some questions including entering your domain, Database credentials, your sudo password, setting up an SSL certificate, setting up systemd, etc. Answer them depending on your requirements.

Install Ghost CMS on Ubuntu 22.04 with Ghost CLI Tool
Set up SSL and Systemd for Ghost CMS

Once you are done, you will get the following output:

Completed Ghost CMS Setup

Step 8 – Access Ghost CMS Admin Dashboard

At this point, you have learned to install Ghost CMS on Ubuntu 22.04. Now you can easily use the URL you have got from the installation and access your web dashboard. First, you should create your first admin user and continue:

Welcome To Ghost Dashboard

Then, you will see your Ghost CMS dashboard on Ubuntu 22.04. From there, you can write and publish posts, customize your site, import members, and manage your site.

Ghost CMS dashboard on Ubuntu 22.04

That’s it, you are done. To get more information, you can visit the official website.

Conclusion

Ghost is an excellent choice for bloggers, writers, and publishers looking for a dedicated platform to share their ideas and stories. At this point, you have learned the full steps to install Ghost CMS on Ubuntu 22.04 by using the Ghost-CLI tool and accessing your Admin web interface.

Hope you enjoy it. Also, you may like to read the following articles:

Drupal CMS Installation with LAMP Stack on Debian / Ubuntu

Install TYPO3 CMS on Ubuntu 22.04

Install ProcessWire CMS on Ubuntu 22.04

Best Way To Install NoMachine on Ubuntu 22.04

Nginx Proxy Manager on Ubuntu 22.04

Install Zoom Client on Ubuntu Terminal

Easy Steps To Install Adminer on Debian 12

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!