Install Ghost (CMS) Blog Publishing Platform on Ubuntu 22.04
Introduction
Ghost CMS is a user-friendly content management system designed for bloggers and publishers. With a clean and intuitive interface, it allows you to create and manage your website’s content easily. Ghost CMS focuses on simplicity, speed, and writing experience, providing powerful features like SEO optimization, custom themes, and integrations with popular tools. Whether you’re a beginner or an experienced writer, Ghost CMS empowers you to craft engaging content and enhance your online presence efficiently.
Procedure
Step 1: Check the OS version by using the below command
lsb_release -a
Step 2: Install Nginx by using the following command
apt install nginx
Step 3: Enable and Start Nginx service by using the below command
systemctl enable nginx
systemctl start nginx
Step 4: Install MySQL server by using following command
apt install mysql-server
Step 5: Start and Enable MySQL service
systemctl start mysql
systemctl enable mysql
Step 6: Login to the mysql console
mysql -u root
mysql> create user 'ghost_green'@'localhost' identified by 'Green@1234'; # Create a user on mysql by using following command
mysql> create database ghost_greencloud; # Create a database on mysql by using following command
mysql> grant all privileges on ghost_greencloud.* to 'ghost_green'@'localhost'; # Grant privileges to the user for that database
mysql> flush privileges; # Flush the privileges
Step 7: Download the nodejs package by using following command
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
Step 8: Install nodejs by using following command
apt install nodejs -y
Step 9: Create a document directory
mkdir -p /var/www/ghost/
Step 10: Change the ownership of the directory
Before, Create a user for your ghost project on your server. We will use adduser
command to do so.
adduser green usermod -aG sudo green
chown -R green: /var/www/ghost/
Step 11: Change the permission of the directory
chmod 775 /var/www/ghost/
Step 12: Change the directory to the /var/www/ghost/
cd /var/www/ghost/
Step 13: Install ghost cli latest version by using nodejs
npm install ghost-cli@latest -g
Step 14: Switch to the green user
su green
Step 15: Install ghost cms by using following command
ghost install
It will take several minutes to download and install packages. It will show you many prompts to get information in the installation once the files are downloaded.
Here are the prompts and How to provide information about your setup.
- Enter your blog URL: Enter the domain or subdomain that you want to use on your blog. Note that your URL/domain should be pointed to the IPv4 of your server. You can modify this from DNS records.
- Enter your MySQL hostname: Unless you are using different server to host your database, You can keep it default and just hit Enter.
- Enter your MySQL username: Enter the name of the user we created while creating database.
- Enter your MySQL password: Enter the password of the user we just created in previous section.
- Enter your MySQL database name: Enter the name of the database here.
- Do you wish to set up Nginx? Yes.
- Do you wish to set up SSL? Yes. It is recommended to have SSL. And Ghost CLI will install it very quickly.
- Enter your E-mail (For SSL Certificate): Enter your correct email as Let’s Encrypt will send you reminder when your SSL certificate is about to expire.
- Do you wish to set up Systemd? Yes.
- Do you want to start Ghost? Yes.
After the installation is done, You will get a message “Ghost was installed successfully! To complete setup of your publication, visit: https://yourwebsite.com/ghost”. Now, All that is remaining is creating an administrator account and start publishing!
Create an Administrator Account
It is very easy to create a first admin account in Ghost. To create one, Just navigate to the following URL.
https://yourdomain.com/ghost/
Note the /ghost
at the end. You can use this URL to access your admin panel. Once you are there, You will have to enter the Blog name, Your Full name, Email address and password. Here is how it looks like for confirmation.
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to Installation of Ghost CMS on Ubuntu 22.04. Your feedback is much welcome.