Full Steps To Install Ghost CMS on Ubuntu 22.04 – OrcaCore
In this comprehensive guide, you will learn the full steps to install Ghost CMS on Ubuntu 22.04. Ghost is a modern, open-source, free, powerful, and lightweight Content Management System (CMS) specifically designed for creating and publishing blogs. Its user-friendly interface makes it accessible to both technical and non-technical users. Ghost CMS comes packed with numerous features, including:
- A clean and intuitive editor.
- Built-in SEO tools.
- Email newsletter integration.
- Membership and subscription options.
- Themes and customization options.
- A REST API for developers.
- Performance-focused architecture.
This article provides a detailed, step-by-step walkthrough to guide you through the installation process of Ghost CMS on Ubuntu 22.04. Follow along to get your Ghost blog up and running quickly. This article from Orcacore will guide you to install Ghost CMS on Ubuntu 22.04 effectively.
Before embarking on the Ghost CMS setup, ensure you are logged into your Ubuntu 22.04 server as a non-root user with sudo privileges. A basic firewall should also be configured for security. Refer to the Initial Server Setup with Ubuntu 22.04 guide for detailed instructions on completing these preliminary steps.
A valid domain name pointed to your server’s IP address is also a prerequisite.
The core requirements for a successful Ghost CMS setup are Nginx, MySQL or MariaDB, Node.js, and a dedicated Ghost user. Let’s delve into the installation steps to install Ghost CMS on Ubuntu 22.04.
Step 1 – Install Nginx For Ghost CMS Setup
First, update and upgrade your system packages using the following command:
sudo apt update && sudo apt upgrade -y
Next, install the Nginx web server with 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, either MySQL or MariaDB. This guide uses MariaDB. Install it with the command below:
sudo apt install mariadb-server -y
Start and enable the MariaDB server using the following command:
sudo systemctl enable --now mariadb
Secure your MariaDB installation and set a root password:
sudo mysql_secure_installation
Now, log in to your MariaDB shell and create a database and user specifically for Ghost CMS:
# sudo mysql -u root -p
**MariaDB [(none)]>** CREATE DATABASE <mark>mydb</mark>;
**MariaDB [(none)]>** GRANT ALL ON <mark>mydb</mark>.* TO <mark>myuser</mark>@localhost IDENTIFIED BY "<mark>strongpassword</mark>";
**MariaDB [(none)]>** FLUSH PRIVILEGES;
**MariaDB [(none)]>** EXIT;
Remember to replace <mark>mydb</mark>
, <mark>myuser</mark>
, and <mark>strongpassword</mark>
with your desired database name, username, and password, respectively.
Step 3 – Create a User for Ghost CMS Administration
Create a dedicated user for Ghost administration. This enhances security and isolates Ghost CMS processes. Run the following commands:
# sudo adduser <mark>ghostuser</mark>
# sudo usermod -aG sudo <mark>ghostuser</mark>
Replace <mark>ghostuser</mark>
with your preferred username. The second command adds the new user to the sudo
group, granting it administrative privileges.
Step 4 – Set up Node.js For Ghost CMS Installation
Ghost CMS requires Node.js to function. The latest versions are typically compatible with Node.js 18. Install Node.js on Ubuntu 22.04:
# sudo curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash
# sudo apt install nodejs -y
Note: If you have NVM (Node Version Manager) or any existing Node.js versions installed, you might encounter conflicts. Uninstall them using the following commands:
$ rm -rf $NVM_DIR ~/.npm ~/.bower
$ unset NVM_DIR;
$ which node;
$ rm -rf {path_to_node_version}
Also, remove any NVM-related lines from your ~/.bash_profile
or ~/.bashrc
file.
Step 5 – Install Ghost-CLI on Ubuntu 22.04
The Ghost-CLI (Command Line Interface) simplifies Ghost CMS installation and management. Install it globally using NPM (Node Package Manager):
sudo npm install ghost-cli@latest -g
Verify the installation by checking the Ghost-CLI version:
ghost -v
**<mark>Output</mark>**
Ghost-CLI version: 1.26.0
Step 6 – Create Ghost CMS Data Folder on Ubuntu 22.04
Ghost CMS should not be installed in the root directory or the user’s home directory. Create a dedicated directory for Ghost CMS data, typically within the /var/www
directory:
# sudo mkdir -p /var/www/ghostcms
# cd /var/www/ghostcms
Set the correct ownership and permissions for the directory:
# sudo chown ghostuser:ghostuser /var/www/ghostcms
# sudo chmod 775 /var/www/ghostcms
Ensure that the ownership is set to the Ghost user created earlier.
Step 7 – Install Ghost CMS on Ubuntu 22.04 with ghost-cli
Switch to the Ghost user and navigate to the newly created directory:
# sudo su - ghostuser
# cd /var/www/ghostcms
# mkdir example.com
# cd example.com
Replace example.com
with your desired domain name or subdirectory.
Finally, install Ghost CMS using the Ghost-CLI:
ghost install
The ghost install
command will download and install Ghost CMS and its dependencies. You will be prompted to answer several questions during the installation, including your domain name, database credentials, sudo password, SSL certificate setup, and systemd configuration. Answer these questions based on your specific requirements.

Upon completion, you should see an output similar to the following:
Step 8 – Access Ghost CMS Admin Dashboard
Now that you have learned the full steps to install Ghost CMS on Ubuntu 22.04, access your web dashboard using the URL provided during the installation process. First, create your initial admin user:
You will then be directed to your Ghost CMS dashboard on Ubuntu 22.04, where you can create and publish posts, customize your site, manage members, and more.
Congratulations! You have successfully installed Ghost CMS on Ubuntu 22.04. For further information, visit the official Ghost website.
Conclusion
Ghost is an excellent CMS for bloggers and publishers seeking a dedicated platform for sharing their content. You have now learned the full steps to install Ghost CMS on Ubuntu 22.04 using the Ghost-CLI tool and accessed the admin web interface.
We hope you found this guide helpful. You might also be interested in 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
Alternative Solutions for Installing Ghost CMS on Ubuntu 22.04
While the Ghost-CLI provides a convenient and streamlined installation process, here are two alternative approaches to installing Ghost CMS on Ubuntu 22.04:
1. Manual Installation with Docker:
Docker provides a containerized environment that simplifies application deployment. Using Docker, you can easily install and manage Ghost CMS without worrying about dependencies and configuration conflicts.
-
Explanation: Docker encapsulates Ghost CMS and its dependencies into a container, ensuring consistency across different environments. This approach simplifies updates, rollbacks, and scaling.
-
Steps:
-
Install Docker and Docker Compose:
sudo apt update sudo apt install docker.io docker-compose -y sudo systemctl start docker sudo systemctl enable docker
-
Create a
docker-compose.yml
file:version: "3.9" services: ghost: image: ghost:latest ports: - "80:2368" environment: url: http://localhost #Replace with your domain database__client: mysql database__connection__host: db database__connection__user: ghost database__connection__password: your_db_password database__connection__database: ghost volumes: - ghost_data:/var/lib/ghost/content depends_on: - db db: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: your_root_password MYSQL_DATABASE: ghost MYSQL_USER: ghost MYSQL_PASSWORD: your_db_password volumes: - db_data:/var/lib/mysql volumes: ghost_data: db_data:
Replace
http://localhost
with your actual domain, andyour_root_password
andyour_db_password
with secure passwords. -
Run Docker Compose:
docker-compose up -d
This command will download the necessary images, create containers, and start Ghost CMS.
-
Configure Nginx (Optional):
You will likely want to configure Nginx as a reverse proxy to handle SSL and route traffic to the Ghost container.
This involves creating an Nginx configuration file for your domain and pointing it to the Ghost container’s port (2368).
The Ghost documentation offers examples of nginx configurations for dockerized deployments.
-
2. Using a Pre-Built Virtual Machine Image:
Another approach is to utilize a pre-built virtual machine (VM) image containing Ghost CMS and all necessary dependencies.
-
Explanation: This method bypasses the manual installation process altogether. You simply download and import a VM image into a virtualization platform like VirtualBox or VMware.
-
Steps:
-
Download a suitable VM image:
Several cloud providers and communities offer pre-built Ghost CMS VM images. Ensure the image is compatible with Ubuntu 22.04 and the virtualization platform you intend to use. Bitnami, for example, provides virtual machine images. -
Install VirtualBox or VMware (if not already installed):
sudo apt update sudo apt install virtualbox -y
-
Import the VM image:
Using VirtualBox or VMware, import the downloaded VM image. This process typically involves selecting "File" -> "Import Appliance" and following the on-screen instructions. -
Configure the VM:
After importing the VM, adjust its settings, such as memory allocation and network configuration, according to your server’s resources. -
Start the VM:
Start the VM, and Ghost CMS should be accessible through the provided URL or IP address. -
Complete the Ghost setup:
Follow any remaining configuration steps as indicated by the image provider. This often involves setting up the initial admin user and configuring your domain.
-
These alternative solutions offer different trade-offs in terms of complexity and control. The Docker approach provides more flexibility and portability, while the VM image offers a quick and easy way to get started. Choose the method that best suits your technical expertise and project requirements to install Ghost CMS on Ubuntu 22.04.