Ghost is a modern, fast, purpose-built platform for blogging and newsletters — a lighter, more focused alternative to WordPress for publishers.
Prerequisites
- Ubuntu 22.04/24.04 VPS with Nginx, Node.js, and MySQL installed
- A domain name pointing to your VPS
- 2 vCPU, 2 GB RAM minimum
Step 1 — Install Node.js
See How to Install Node.js on Ubuntu & Debian (with NVM), or install the specific LTS version Ghost currently supports.
Step 2 — Install MySQL
See How to Install and Secure MySQL 8 on Ubuntu & Debian.
Step 3 — Create a Ghost Database
sudo mysql
CREATE DATABASE ghost;
CREATE USER 'ghost'@'localhost' IDENTIFIED BY 'CHANGE_ME_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON ghost.* TO 'ghost'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 4 — Install Ghost-CLI
sudo npm install ghost-cli@latest -g
Step 5 — Create the Installation Directory
sudo mkdir -p /var/www/ghost
sudo chown deploy:deploy /var/www/ghost
sudo chmod 775 /var/www/ghost
cd /var/www/ghost
Step 6 — Install Ghost
ghost install
Follow the interactive prompts: enter your domain, MySQL credentials, and choose to set up Nginx and SSL automatically when asked.
Step 7 — Verify Ghost Is Running
ghost status
Step 8 — Access the Admin Panel
https://yourdomain.com/ghost
Create your administrator account on first visit.
Managing Ghost
ghost start
ghost stop
ghost restart
ghost log
Updating Ghost
cd /var/www/ghost
ghost update
Backing Up Ghost
Ghost has a built-in export feature (JSON, content only) accessible from the admin panel, but for a complete backup also back up the database and images directory:
mysqldump -u ghost -p ghost > ghost-db-backup.sql
tar czf ghost-content-backup.tar.gz /var/www/ghost/content
Setting Up Email Newsletter Delivery
Ghost's newsletter feature requires a transactional email provider configured in config.production.json — consult Ghost's official documentation for the exact configuration matching your chosen provider.
Common Errors
"ghost install" fails with a system requirement error — Ghost-CLI checks for specific Node.js versions and system configuration; review the specific error and address the flagged requirement.
Site loads but images are broken — check file permissions on the content/images directory.
Best Practices
- Let Ghost-CLI handle Nginx and SSL configuration automatically during install for the smoothest setup
- Keep Ghost updated for security patches
- Back up both the database and content directory regularly
Continue Reading
- How to Install Node.js on Ubuntu & Debian (with NVM)
- How to Install and Secure MySQL 8 on Ubuntu & Debian
- How to Install Let's Encrypt SSL with Certbot (Nginx & Apache)
Browse more articles in Popular Self-Hosted Applications.
