How to Self-Host Ghost CMS on Contabo VPS with MySQL 8 and Let's Encrypt SSL
Contabo High-Performance Cloud VPS
Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.
Tired of Substack platform cuts and expensive Ghost Pro plans? Learn how to self-host Ghost CMS on a Contabo VPS with MySQL 8, Nginx, and Mailgun newsletter delivery.
- Keep 100% of membership revenue: bypass Substack's 10% platform fee and Ghost Pro's $29/mo starter fee
- Contabo Cloud VPS 1 ($4.95/mo for 8GB RAM) easily handles hundreds of thousands of monthly pageviews
- Native Mailgun integration delivers tens of thousands of newsletter emails with verified inbox placement
The Financial Trap of Commercial Publishing Platforms
Content creators, journalists, and technical bloggers face severe monetization friction on mainstream publishing platforms. Substack takes a massive 10% cut of every paid subscriber transaction on top of Stripe processing fees. Meanwhile, Ghost Pro managed cloud starts at $29/month and rapidly escalates to $199+/month as your subscriber roster crosses 10,000 readers.
Ghost CMS is a headless, Markdown-first publishing platform built on Node.js and MySQL. By deploying the open-source version of Ghost on a Contabo Cloud VPS 1 ($4.95/month for 4 vCPU cores, 8 GB RAM, and 200 GB NVMe storage), you maintain 100% ownership of your subscriber data, zero platform revenue cuts, and unmetered traffic capacity.
Server Prerequisites on Ubuntu 24.04 LTS
Ghost officially requires Ubuntu LTS, Node.js LTS, MySQL 8, Nginx, and systemd. Connect to your Contabo VPS via SSH:
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
apt install -y curl ufw git nginx
Critical Ghost Requirement: Non-Root User
Ghost CLI strictly refuses to install or run under the root account for security isolation. Create a dedicated administrative user with sudo privileges:
adduser ghostadmin
usermod -aG sudo ghostadmin
su - ghostadmin
Step 1: Install Node.js 20 LTS & Ghost-CLI
Ghost 5.x and 6.x require Node.js 18 or 20 LTS. Install Node.js 20 and the official Ghost command-line orchestrator:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g ghost-cli@latest
ghost version
Step 2: Install and Secure MySQL 8 Database
Ghost requires a production-grade relational database. Install MySQL Server 8:
sudo apt install -y mysql-server
sudo mysql_secure_installation
Log in to MySQL as root and create a dedicated database and user for Ghost:
sudo mysql -u root -p
CREATE DATABASE ghost_production DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'ghostuser'@'localhost' IDENTIFIED BY 'StrongDatabasePassword_8832!';
GRANT ALL PRIVILEGES ON ghost_production.* TO 'ghostuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 3: Automated Installation with Ghost-CLI
Create a directory for your Ghost blog and assign ownership to your ghostadmin user:
sudo mkdir -p /var/www/ghost
sudo chown ghostadmin:ghostadmin /var/www/ghost
sudo chmod 775 /var/www/ghost
cd /var/www/ghost
Run the interactive Ghost installer:
ghost install
The installer will prompt you for configuration details:
- Blog URL: Enter your custom domain with HTTPS (e.g.,
https://blog.yourdomain.com). - MySQL Hostname: Press Enter for
localhost. - MySQL Username:
ghostuser - MySQL Password: Enter the strong password created in Step 2.
- Ghost Database Name:
ghost_production - Set up "ghost" system user? Yes
- Set up Nginx? Yes (Ghost-CLI configures virtual host blocks automatically)
- Set up SSL? Yes (Ghost-CLI provisions Let's Encrypt certificates automatically)
- Set up systemd service? Yes
- Start Ghost? Yes
Step 4: Configuring Mailgun for Email Newsletters
To send broadcast newsletters to your subscriber list, Ghost integrates natively with Mailgun. In your Mailgun dashboard, add your sending domain (e.g., mg.yourdomain.com) and copy your SMTP credentials.
Edit your Ghost production configuration file:
nano /var/www/ghost/config.production.json
Update the mail block:
"mail": {
"transport": "SMTP",
"options": {
"service": "Mailgun",
"host": "smtp.mailgun.org",
"port": 587,
"secure": false,
"auth": {
"user": "postmaster@mg.yourdomain.com",
"pass": "your_mailgun_smtp_password"
}
}
}
Restart Ghost to apply the changes:
ghost restart
Step 5: Accessing the Ghost Admin Cockpit
Visit https://blog.yourdomain.com/ghost/ to complete the administrator setup. Create your author profile, set your publication name, and connect Stripe for membership subscriptions.
Recommended Reading & Related Guides
Summary: The Pure Economics of Self-Hosting
Running Ghost CMS on a Contabo Cloud VPS costs just $4.95/month. For a creator with 5,000 paid subscribers generating $25,000/month in memberships, self-hosting saves over $30,000 per year compared to Substack's 10% platform tax.
Video Walkthrough & Official References
Linux Nginx Reverse Proxy & SSL: Full Tutorial for Beginners • Cloud Explainers
Editorial Verdict: Pros & Cons
What We Love (Pros)
- Keep 100% of membership revenue: bypass Substack's 10% platform fee and Ghost Pro's $29/mo starter fee
- Contabo Cloud VPS 1 ($4.95/mo for 8GB RAM) easily handles hundreds of thousands of monthly pageviews
- Native Mailgun integration delivers tens of thousands of newsletter emails with verified inbox placement
Drawbacks (Cons)
- Self-hosted Ghost requires managing periodic Node.js LTS upgrades and database backups via CLI
Deploy Your Contabo Cloud Server
Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.
Written by Marcus Vance
Full-Stack Cloud Engineer
Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.
Recommended Next Reads
How to Build a Private Cloud with Nextcloud on Contabo VPS (Complete Guide)
Replace Google Drive and Dropbox with a self-hosted Nextcloud server on a Contabo high-storage VPS. Full guide with Docker, PostgreSQL, Redis caching, and Let's Encrypt SSL.
How to Set Up Mailcow: Dockerized Email Server on Contabo VPS (Self-Hosted Guide)
Stop paying per-inbox fees to Google Workspace or Microsoft 365. Learn how to deploy Mailcow Dockerized on a Contabo VPS with SOGo webmail, rDNS, SPF, DKIM, and DMARC.
How to Deploy Strapi Headless CMS on Ubuntu 24.04 VPS with PostgreSQL & PM2
A complete production blueprint to self-host Strapi v5 Headless CMS on an Ubuntu cloud VPS. Includes PostgreSQL database tuning, PM2 process management, and Nginx reverse proxy with SSL.