Special Offers: Up to 75% OFF on Hostinger & High-RAM Contabo Cloud VPS available this month.Compare Plans

How to Install Ghost CMS on Ubuntu 24.04 VPS with MySQL 8 & Nginx (Ghost-CLI Guide)

Marcus Sterling
Marcus SterlingWordPress Core Specialist
October 18, 2026
•
15 min read
•
4.9 / 5.0
Transparency Notice: This article contains affiliate links to hosting providers like Hostinger and Contabo. If you purchase through our links, we may earn a commission at zero extra cost to you. We only recommend products we personally benchmark and test. Read full disclosure.
How to Install Ghost CMS on Ubuntu 24.04 VPS with MySQL 8 & Nginx (Ghost-CLI Guide)
Best Hardware Value for TechsNo Contract Surcharges + High RAM

Contabo High-Performance Cloud VPS

Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.

German Engineering & Data Centers
8 Strategic Global Locations
Fast NVMe Storage Array
Full Root & SSH Console Access
Starts From
$5.50 / mo
Special Affiliate Pricing
Claim Discount Now
Official Partner Link • Verified Safe

Why Modern Publishers Are Choosing Ghost Over WordPress

While WordPress remains the Swiss Army knife of web development, Ghost was engineered specifically for professional publishers, journalists, and newsletter writers. Built on Node.js, Ghost delivers sub-100ms response times out of the box, natively integrates Stripe subscription paywalls, and includes a markdown editor that eliminates content formatting friction.

Prerequisites

  • A fresh Ubuntu 22.04 or 24.04 VPS.
  • A registered domain name pointed to your VPS IP address.
  • At least 2 GB of RAM (Contabo VPS 1 provides 8GB).

Step 1: Creating a Non-Root System User

Ghost-CLI refuses to install under root for security reasons:

sudo adduser ghostuser
sudo usermod -aG sudo ghostuser
su - ghostuser

Step 2: Installing Nginx, MySQL 8, and Node.js

# Update repositories and install Nginx
sudo apt update && sudo apt upgrade -y
sudo apt install -y nginx mysql-server

# Install Node.js 20 LTS (Ghost officially requires Node 18 or 20)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# Install Ghost-CLI globally
sudo npm install -g ghost-cli@latest

Step 3: Setting Up MySQL Database

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_STRONG_ROOT_PASSWORD';
FLUSH PRIVILEGES;
EXIT;

Step 4: Installing Ghost via Ghost-CLI

# Create directory and assign permissions
sudo mkdir -p /var/www/ghost
sudo chown ghostuser:ghostuser /var/www/ghost
sudo chmod 775 /var/www/ghost
cd /var/www/ghost

# Run the automated Ghost installation
ghost install

Ghost-CLI will ask for:

  • Blog URL: https://yourdomain.com (use HTTPS directly).
  • MySQL hostname: localhost.
  • MySQL user / password: root and your configured password.
  • Database name: Press Enter to accept default ghost_prod.
  • Set up Nginx? Type Y.
  • Set up SSL? Type Y and provide an administrative email.
  • Start Ghost? Type Y.

Step 5: Completing Administrator Registration

Open your browser and navigate to https://yourdomain.com/ghost. Create your administrator account, set up your publication title, and start publishing articles instantly.

Editorial Verdict: Pros & Cons

What We Love (Pros)

  • Lightning fast publishing experience built with Node.js and Handlebars templates
  • Native support for paid subscriber memberships and email newsletters
  • Significantly less maintenance and plugin vulnerability overhead compared to WordPress

Drawbacks (Cons)

  • Requires external transactional email provider (such as Mailgun) for member newsletters
Best Hardware Value for TechsNo Contract Surcharges + High RAM

Deploy Your Contabo Cloud Server

Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.

German Engineering & Data Centers
8 Strategic Global Locations
Fast NVMe Storage Array
Full Root & SSH Console Access
Starts From
$5.50 / mo
Special Affiliate Pricing
Claim Discount Now
Official Partner Link • Verified Safe
#Ghost CMS#Ubuntu#Blogging Platform#Ghost-CLI#Node.js
Marcus Sterling

Written by Marcus Sterling

WordPress Core Specialist

Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.

Recommended Next Reads