How to Install Ghost on Ubuntu 26.04

How to Install Ghost on Ubuntu 26.04

Bitnesia Software Aug 14, 2026 44 ID

Ghost is a publishing platform designed specifically for writing, publishing, and managing content quickly. Unlike WordPress, which is an all‑in‑one solution, Ghost is intentionally lean because its sole focus is professional blogging. As a result, the dashboard feels light, the editor is comfortable to use, and page performance is significantly faster on the frontend.

This guide is based on the official Ghost documentation and hands‑on practice when installing it on a production Ubuntu 26.04 server. Every command has been tested, so you just need to follow the steps in order. Once this tutorial is complete, you will have a Ghost blog running over HTTPS, automatically starting when the server reboots, and ready for your first piece of content.

What is Ghost?

Ghost is an open‑source content management system (CMS) focused on professional publishing. The platform was created in 2013 by John O'Nolan through a Kickstarter campaign, with a simple initial goal: to deliver a modern and fast blogging experience without the burden of unnecessary features.

Several reasons why Ghost has become popular among writers, independent media, and companies:

  • Fast: Ghost is built on Node.js and is performance‑oriented. Blog pages load much lighter than monolithic CMSs.
  • Focused on publishing: The built‑in editor feels like writing in a dedicated app, complete with Markdown and dynamic content cards.
  • SEO‑friendly: Sitemaps, Open Graph metadata, canonical URLs, and page structure are already optimised without needing extra plugins.
  • Built‑in membership and newsletters: Membership and email newsletter features are available directly without third‑party integrations.

System Prerequisites

Ghost runs smoothly on a server with fairly modest resources. Here are the official recommendations:

ComponentMinimum RequirementRecommendation
RAM1 GB2 GB or more
CPU1 core2 cores
Storage20 GB40 GB SSD (for content and backups)
Operating SystemUbuntu 24.04 LTSUbuntu 26.04 LTS 

Step 1: Update Server and Create a New User

Updating System Packages

The first step, which is always mandatory, is to update the package list and installed applications. This is important so that your server is always up‑to‑date and secure against vulnerabilities.

sudo apt update
sudo apt upgrade -y

Creating a Non‑Root User

Ghost‑CLI cannot be run using root access. You must create a new non‑root user that will be responsible for managing the directory and running the Ghost process. 

# Create a new user (follow the prompts for name and password)
sudo adduser ghostuser

# Add the user to the sudo group
sudo usermod -aG sudo ghostuser

# Switch to the new user
su - ghostuser

Important point: Never use the name ghost as your new user name. That name will definitely cause conflicts with Ghost‑CLI's internal system. You can choose another safe name such as ghostuser, penulis, or deploy.

Step 2: Install Nginx Web Server and Firewall

Installing Nginx

Ghost uses Nginx as a reverse proxy that handles incoming requests from the internet and forwards them to the Ghost process. 

sudo apt install nginx -y

Configuring the UFW Firewall

Open HTTP (80) and HTTPS (443) ports if the UFW firewall is active on your server. The Nginx Full profile already covers both ports. Make sure you also allow SSH access so that your terminal login session does not get cut off midway.

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable

Finally, check the firewall rules that have been applied using the following command:

sudo ufw status

Step 3: Install MySQL Database

Installing MySQL Server

Ghost stores all content, user accounts, and system configuration in a MySQL database. Install MySQL server version 8.4, which is already available directly in the official Ubuntu 26.04 repository.

sudo apt install mysql-server -y

Securing the Database Installation

Run this built‑in script to tighten the security of your database. This step helps remove anonymous user accounts and clean up the default test database.

sudo mysql_secure_installation

Setting the MySQL Root Password

The Ubuntu system automatically configures the MySQL root user to use socket‑based authentication (auth_socket). Ghost does not yet support that method, so the MySQL root user needs to be changed to use a regular password. Log into the MySQL console and update the authentication method.

# Enter the MySQL console
sudo mysql

# Change root authentication to password
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'caching_sha2_password' BY 'your-root-password';

# Reload privileges
FLUSH PRIVILEGES;

# Exit the MySQL console
exit

Creating a Dedicated Database and User for Ghost

Ghost‑CLI can actually create the database automatically if you provide the MySQL root user credentials during installation. However, a much safer approach is to prepare a dedicated database and user beforehand so that Ghost does not need to hold the root credentials.

sudo mysql
CREATE DATABASE ghost_prod;
CREATE USER 'ghostdbuser'@'localhost' IDENTIFIED BY 'your-ghost-password';
GRANT ALL PRIVILEGES ON ghost_prod.* TO 'ghostdbuser'@'localhost';
FLUSH PRIVILEGES;
exit

Step 4: Install Node.js and npm

Ghost is an application that runs on Node.js, so using the correct Node version is an absolute prerequisite. Ubuntu's default repository often lags behind the versions supported by Ghost. The safest approach is to add the official NodeSource repository and install the supported LTS version, which is Node.js 22.

Adding the NodeSource Repository

# Prepare dependencies and keyring
sudo apt update
sudo apt install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

# Add the Node.js 22 repository
NODE_MAJOR=22
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

# Update package list and install Node.js
sudo apt update
sudo apt install nodejs -y

Verify the Versions

Make sure Node.js and npm are installed with the correct versions using the following commands:

node --version
# Output: v22.x.x

npm --version
# Output: 10.x.x or newer

Step 5: Install Ghost‑CLI

Ghost‑CLI is the official command‑line tool for installing, configuring, and maintaining Ghost. It automates tasks that would otherwise take a long time, such as creating Nginx configuration, obtaining SSL certificates, setting up systemd units, and updating Ghost versions. Most Ghost administrative tasks can be done via the ghost command.

Install Ghost‑CLI globally so that it can be invoked from any directory on your server:

sudo npm install ghost-cli@latest -g

Verify the installation with this command:

ghost --version

The ghost help command will show a complete list of available commands. You will find options such as ghost install, ghost update, ghost backup, and ghost doctor to check the health of your Ghost installation.

Step 6: Ghost Installation Process

Creating the Installation Directory

Ghost must be installed in its own directory with the correct owner and permissions. Create the directory, change its ownership to the non‑root user you created in Step 1, and then move into it.

# Create the installation directory
sudo mkdir -p /var/www/ghost

# Change ownership to your non‑root user
sudo chown ghostuser:ghostuser /var/www/ghost

# Set permissions
sudo chmod 775 /var/www/ghost

# Move into the directory
cd /var/www/ghost

Running ghost install

Make sure you are logged in as the non‑root user (not root), then run the installation command from inside the /var/www/ghost directory.

ghost install

Filling in the Interactive Configuration

Ghost‑CLI will ask a series of interactive configuration questions. Fill them in according to your needs, following the guidance below:

QuestionAnswer
Blog URLhttps://yourdomain.com
MySQL hostnamelocalhost (press Enter for default)
MySQL usernameroot or ghostdbuser if using a dedicated user
MySQL passwordThe password of the MySQL user you are using
Ghost database nameghost_prod
Set up a ghost MySQL user?Yes (if using root)
Set up NGINX?Yes
Set up SSL?Yes
Enter your email (SSL)[email protected]
Set up systemd?Yes
Start Ghost?Yes

Here is a brief explanation for each option above:

  • Blog URL: The public address of your blog, including the protocol. Use https:// so that Ghost‑CLI automatically offers SSL setup.
  • MySQL hostname: localhost is correct because the MySQL database is on the same server.
  • Set up a ghost MySQL user: Ghost‑CLI will create a separate MySQL user that can only access the Ghost database. This keeps root credentials out of the application configuration.
  • Set up NGINX: Ghost‑CLI automatically creates and enables the Nginx server block for you.
  • Set up SSL: Ghost‑CLI obtains a free certificate from Let's Encrypt and also sets up automatic renewal.
  • Set up systemd: Ghost will be registered as a service so that it starts automatically when the server is restarted.

Important warning: The SSL creation process will only succeed if your domain's A Record already points correctly to the server's IP. If this process fails, you can rerun the SSL setup after DNS propagation is complete using the command ghost setup ssl.

If the installation is successful, you will see a message like:

Ghost was installed successfully! To complete setup of your publication, visit: 

    https://yourdomain.com/ghost/

Once the whole process is finished, verify the status of your Ghost installation to ensure the service is running normally:

ghost ls
sudo systemctl status ghost_yourdomain-com

Step 7: Set Up the Ghost Admin Account

Accessing the Setup Page

Open your favourite browser and go to the Ghost admin page at the following URL (remember to replace the domain with your own):

https://yourdomain.com/ghost

The first page you will see is the administrator account creation form. Simply fill in the four main fields provided:

  • Site title: The title of your publication that will appear on the front page of your blog.
  • Full name: Your full name as the site owner.
  • Email address: An active email address that will be used for login and receiving important notifications.
  • Password: A strong password of at least 10 characters, using a combination of uppercase, lowercase, numbers, and symbols.

After you click the Create account & start publishing button, the system will immediately direct you into the Ghost admin dashboard.

A Quick Tour of the Admin Dashboard

Here are some key areas in the Ghost dashboard that you should familiarise yourself with:

  • Posts: The main place to write and manage articles, including drafts and scheduling content.
  • Pages: The menu for creating static pages such as About, Contact, or Privacy Policy.
  • Tags: A category feature to group your blog content for better organisation.
  • Members: A dedicated area for managing members and newsletters if you enable the membership feature.
  • Settings: The central configuration hub for your site, theme settings, third‑party integrations, and SEO metadata optimisation.

Security tip: Immediately enable two‑factor authentication (2FA) through your profile menu after logging in for the first time. The admin dashboard is the main entry point to your site, so this extra layer of security is highly recommended.

Conclusion

Congratulations, Ghost CMS is now running smoothly on your Ubuntu 26.04 server! To summarise, you have successfully completed several important tasks: creating a safe non‑root user, installing Nginx and MySQL, setting up the correct Node.js version, installing Ghost via Ghost‑CLI, and securing the site with Let's Encrypt SSL and systemd.

Your future maintenance tasks will be much easier thanks to Ghost‑CLI. You can use the ghost update command to update the application version, ghost backup to back up all content, and ghost doctor if you want to check the health of your installation. Now it's time to start writing your first article from the Posts menu and share it with your loyal readers!

I love keeping these tutorials free for everyone. If you've saved time or learned something new today, consider making a small donation to keep this site ad-free.

Support Free Content

Related Posts