Install Ghost Blog on VPS Ubuntu

Install Ghost Blog on VPS Ubuntu

June 2026 · 8 min read

Ghost is a modern CMS focused on writing and newsletters — significantly faster than WordPress. It comes with built-in SEO, email newsletter, membership, and paywall features all in one platform. Ghost uses Node.js for server-side rendering, delivering extremely fast page loads. It's ideal for bloggers, journalists, and creators who want a clean platform without messy plugins.

Prepare Server (Node.js + MySQL + Nginx)

sudo apt update
sudo apt install -y nginx mysql-server curl

# Install Node.js 20 LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# Verify
node --version  # must be 20.x
npm --version

Configure MySQL for Ghost

sudo mysql -u root

CREATE DATABASE ghost_blog CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'ghost'@'localhost' IDENTIFIED BY 'ghostDbPass123';
GRANT ALL PRIVILEGES ON ghost_blog.* TO 'ghost'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Install Ghost CLI and Ghost

# Install ghost-cli
sudo npm install ghost-cli@latest -g

# Create user for Ghost (never run as root)
sudo adduser --disabled-password --gecos "" ghost-user
sudo mkdir -p /var/www/ghost
sudo chown ghost-user:ghost-user /var/www/ghost
sudo chmod 775 /var/www/ghost

# Install Ghost
sudo -u ghost-user bash -c "cd /var/www/ghost && ghost install"
# Answer prompts:
# Blog URL: https://blog.yourdomain.com
# MySQL hostname: localhost
# MySQL username: ghost
# MySQL password: ghostDbPass123
# Ghost database name: ghost_blog
# Set up Nginx? Yes
# Set up SSL? Yes (DNS must point to VPS first)
# Set up systemd? Yes

Manage Ghost with CLI

cd /var/www/ghost

# View status
ghost status

# Restart
ghost restart

# Stop/Start
ghost stop
ghost start

# Update Ghost
ghost update

# View logs
ghost log

Configure Email (Newsletter)

ghost config set mail.transport SMTP
ghost config set mail.options.host smtp.yourdomain.com
ghost config set mail.options.port 587
ghost config set mail.options.auth.user [email protected]
ghost config set mail.options.auth.pass yoursmtppass
ghost restart
Tip: Ghost Admin panel is at https://blog.yourdomain.com/ghost. Go to Staff › Invite to add other writers via email with role set to Author or Editor.

Backup and Update Ghost

Ghost stores content in MySQL and images/themes in the content/ directory. You must backup both parts regularly and apply updates to close security vulnerabilities:

# Backup database + content
mysqldump -u ghost_user -p ghost_prod > ghost-db-$(date +%F).sql
tar czf ghost-content-$(date +%F).tar.gz /var/www/ghost/content/

# Update Ghost to latest version (run in Ghost directory)
cd /var/www/ghost
ghost backup        # automatic snapshot before update
ghost update
ghost update --rollback   # revert if issues occur
Tip: Set up a cron job to run mysqldump and rsync content to another VPS or Object Storage every night — your blog content is your most valuable asset and hardest to recover without offsite backups.

Verify Ghost is Working Correctly

# Check status
cd /var/www/ghost && ghost status

# Check systemd service
sudo systemctl status ghost_blog.yourdomain.com

# Check port (Ghost runs on port 2368 by default)
ss -tlnp | grep 2368

# Test
curl -I https://blog.yourdomain.com
Tip: Ghost has built-in sitemap at /sitemap.xml and JSON Feed at /feed/, so SEO works automatically without needing to install additional plugins.

Common Issues & Troubleshooting

Error: "Ghost is not running" after install

Check logs for the actual error — usually caused by incorrect MySQL password or port 2368 being used by another process:

ghost log
ss -tlnp | grep 2368
ghost config get database.connection

SSL not configured automatically during install

DNS must point to the VPS before install. If you missed this, set up SSL afterwards:

cd /var/www/ghost
ghost setup ssl
# or
sudo certbot --nginx -d blog.yourdomain.com

Ghost Update fails (version conflict)

Ghost has version locking — you must update one major version at a time:

ghost update --v5  # update to v5 first
ghost update       # then update to latest

Image Upload fails (413 error)

Nginx has a size limit. Increase client_max_body_size in Ghost's Nginx config:

sudo nano /etc/nginx/sites-available/blog.yourdomain.com
# Add inside server block:
client_max_body_size 100m;
sudo nginx -t && sudo systemctl reload nginx

Frequently Asked Questions

How is Ghost different from WordPress?

Ghost is designed specifically for content publishing and is significantly faster than WordPress. It includes built-in newsletter and membership features, but has a much smaller plugin ecosystem than WordPress. Choose Ghost if you want a minimal, fast blog rather than a feature-heavy CMS.

Does Ghost support memberships and subscriptions?

Yes, Ghost includes a Members feature built-in. You can set up free and paid tiers, accept payments via Stripe, and send newsletters only to paid members. It's an all-in-one solution for creator economy platforms.

How do I backup Ghost?

Export content through Ghost Admin › Labs › Export Content (JSON), backup images from /var/www/ghost/content/images/, and dump the MySQL database: mysqldump ghost_blog > backup.sql