How to Install Ghost CMS on Ubuntu 24.04 VPS with MySQL 8 & Nginx (Ghost-CLI Guide)
Contabo High-Performance Cloud VPS
Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.
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:
rootand your configured password. - Database name: Press Enter to accept default
ghost_prod. - Set up Nginx? Type
Y. - Set up SSL? Type
Yand 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
Deploy Your Contabo Cloud Server
Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.
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
Hostinger vs Contabo VPS (2026): Real Benchmark Test & In-Depth Comparison
A comprehensive, benchmark-driven comparison between Hostinger and Contabo VPS. We tested Geekbench CPU scores, NVMe I/O, network latency, and hPanel vs CLI.
Hostinger Review (2026): Is It Truly the Best Web Hosting for the Price?
We stress-tested Hostinger's Premium and Cloud Startup plans across 180 days. Read our honest review covering uptime, LiteSpeed speed tests, and renewal fees.