How to Install Ghost CMS on a VPS

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

Browse more articles in Popular Self-Hosted Applications.

  • ghost cms, self hosted blog, newsletter platform, ghost installation
  • 0 Utilizadores acharam útil
Esta resposta foi útil?

Artigos Relacionados

How to Install Nextcloud on a VPS with Docker

Nextcloud is a self-hosted file sync, sharing, and collaboration platform — a...

How to Install GitLab CE on a VPS

GitLab Community Edition is a full-featured, self-hosted DevOps platform — Git repository...

How to Set Up a Minecraft Server on a VPS

Running your own Minecraft server gives you full control over mods, plugins, and world settings....

How to Install n8n for Workflow Automation

n8n is a self-hosted workflow automation tool — connecting apps and APIs through a visual...

How to Install Gitea (Lightweight Git Server)

Gitea is a lightweight, self-hosted Git service — a much lower-resource alternative to...