Learn the commands to install Ghost CMS on Ubuntu 22.04 LTS Jammy JellyFish using the command terminal for hosting your blog.
Furthermore, we can easily install Ghost locally for testing all we have to do is install Node.js and the package manager NPM, which is already integrated into Node. The CLI (Command Line Interface) of Ghost can then be downloaded from the console with a short npm command.
Apart from the subscription method, the users can self-host the Ghost just like WordPress on their cloud or hosting server, all it has to full fill the requirement of this CMS which are:
• A non-root user with sudo rights
• MySQL Database
• Server with 1GB of free Memory
- Steps to install Ghost CMS on Ubuntu 22.04 Linux Server
Steps to install Ghost CMS on Ubuntu 22.04 Linux Server
The steps are given here can be used for other versions of Ubuntu such as 18.04/20.04 including Debian.
1. Fully update Ubuntu 22.04
Let’s first run the system update and upgrade command to ensure our desktop or server is up to date. Performing this step will also rebuild the APT package index cache.
sudo apt update && sudo apt upgrade
2. Install Nginx
Ghost needs Nginx for reverse proxy and SSL configuration, hence install it using:
sudo apt install nginx
3. Install MariaDB or MySQL
We can either use MariaDB or MySQL Database Server on Ubuntu 22.04 to store the data generated by the ProcessWire CMS. Here we are using MariaDB Server.
sudo apt install mariadb-server mariadb-client
Enable, Start and check service status:
sudo systemctl enable --now mariadb
systemctl status mariadb
Ctrl+C to exit.
Secure your Database Installation:
To secure our Database instance, run the given command:
The given questions will ask by the system, the example of answers is also given below:
Enter current password for root (enter for none): Press ENTER Set root password? [Y/n]: Y New password: Set-your-new-password Re-enter new password: Set-your-new-password Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y
4. Create Database for Ghost CMS
Login to your Database server by using the password you have set for the root user of it.
sudo mysql -u root -p
Follow the command to create a new DB. However, don’t forget to replace new_user with whatever name you want to give to your Database user and in the same way- new_db with a name for Database and your_password for the password.
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'your_password';
CREATE DATABASE new_db;
GRANT ALL PRIVILEGES ON new_db.* TO 'new_user'@'localhost';
6. Install Nodejs on Ubuntu 22.04
The supported versions of NodeJS while doing this article was 14.x and 16.x, here we are installing the LTS 16.x.
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
7. Install Ghost CLI on Ubuntu 22.04
Now, we already have Nodejs and its package manager NPM that we can use to easily install the Ghost CMS on our Ubuntu 22.04 LTS server.
sudo npm install [email protected] -g
8. Create a directory for Ghost files
To install the Ghost, we will create a dedicated directory that holds all the files and scripts needed by this CMS platform to run.
sudo mkdir -p /var/www/ghost/
After that set the ownership of the created directory to the dedicated user we have created for Ghost.
sudo chown -R $USER:$USER /var/www/ghost/
Set reading and writing rights
sudo chmod 775 /var/www/ghost
9. Install Ghost CMS using its CLI tool
Now, first, switch to the user-created for the Ghost and use that to install this CMS on your system.
Switch to the directory created for Ghost:
Run Ghost CMS installation command:
The above command will ask you a couple of questions:
Enter your blog URL: your blog url Enter your MySQL hostname: localhost Enter your MySQL username: new_user Enter your MySQL password: [hidden] Enter your Ghost database name: new_db Do you wish to set up Nginx? Yes Do you wish to set up Systemd? Yes Do you want to start Ghost? (Y/n) Y
Once the installation is completed, you will have the URL to access the Ghost Interface.
10. Create Admin user
As you access the Ghost CMS, the setup wizard will appear and set your Site Title and other information it asking for. After that move forward to have the front end and admin panel of your blog.
• How to Install WordPress on Ubuntu 22.04 LTS Server
• Steps to install ProcessWire CMS on Ubuntu 22.04 LTS Linux
• How to install Backdrop CMS on Ubuntu 22.04 Jammy
• How to Install Craft CMS on Ubuntu 20.04 LTS Focal Fossa