How to Install Ghost CMS on Debian 13 with Nginx and SSL

About Ghost CMS

Ghost is a modern, headless Node.js-based CMS focused on professional publishing. It is fast, secure, and optimized for SEO and email newsletters. Ghost is often used by startups, bloggers, and content creators.

Prerequisites

Before beginning the installation, ensure your server meets the following:

  • Debian 13 (Trixie) installed and updated

  • A non-root user with sudo access

  • A domain pointed to your server (e.g., dev.yourdomain.com)

  • MySQL or MariaDB installed and configured

  • Port 80 and 443 open in firewall

  • Node.js 18+ (Ghost recommends LTS)

  • At least 1 GB RAM, 1 CPU

Update Your System

Keep your system up-to-date for security and compatibility.

apt update && sudo apt upgrade -y

Install Sudo on Debian 13.

apt install sudo

Remove Apache (If Installed)

Ghost uses Nginx, not Apache. Let's remove Apache to avoid conflicts.

sudo systemctl stop apache2
sudo apt purge apache2 apache2-utils apache2-bin apache2.2-common -y
sudo apt autoremove -y

Install Nginx

Nginx is a lightweight and efficient web server recommended for Ghost.

sudo apt install nginx -y

Output:

root@server:~# sudo apt install nginx -y
Installing:                     
  nginx

Installing dependencies:
  nginx-common

Suggested packages:
  fcgiwrap  nginx-doc  ssl-cert

Summary:
  Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 0
  Download size: 718 kB
  Space needed: 1,891 kB / 92.8 GB available

Enable and start Nginx:

sudo systemctl enable nginx
sudo systemctl start nginx

Install Required Packages

These packages are needed to add repositories, manage certificates, and build Node packages.

sudo apt install -y curl wget ca-certificates gnupg lsb-release unzip curl 

Output:

root@server:~# sudo apt install -y curl wget ca-certificates gnupg lsb-release unzip curl 
curl is already the newest version (8.14.1-2).
wget is already the newest version (1.25.0-2).
ca-certificates is already the newest version (20250419).
lsb-release is already the newest version (12.1-1).
lsb-release set to manually installed.
Installing:
  gnupg  unzip

Installing dependencies:
  dirmngr     gnupg-utils  gpg-agent       gpgconf  gpgv        libgcrypt20        libgpg-error0  libnpth0t64
  gnupg-l10n  gpg          gpg-wks-client  gpgsm    libassuan9  libgpg-error-l10n  libksba8       pinentry-curses

Install Node.js (LTS)

Ghost recommends newer version 22+ Install Node.js 22 via Nodesource,

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

Verify the version.

node -v

Output:

root@server:~# node -v
v22.18.0

You will get output like below.

Output Here

Create a Sudo User

We’ll create a non-root sudo user for running Ghost.

sudo adduser ghostadmin
sudo passwd ghostadmin
sudo usermod -aG sudo ghostadmin
su - ghostadmin

Note: You can change ghostadmin to any other preferred username.

Install MariaDB (MySQL Server)

sudo apt install mariadb-server -y

Once installed, start and enable the service.

sudo systemctl enable mariadb
sudo systemctl start mariadb

Secure MariaDB,

sudo mysql_secure_installation

Login to MariaDB to set a password and prepare the DB,

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('StrongPassword');
EXIT;

Note: Replace StrongPassword with a secure/strong password.

Install Ghost CLI

Install Ghost CLI using below command,

sudo npm install -g ghost-cli@latest

Setup Directory for Ghost,

sudo mkdir -p /var/www/your_domain.com
sudo chown ghostadmin:ghostadmin /var/www/your_domain.com
sudo chmod 775 /var/www/your_domain.com
cd /var/www/your_domain.com

Note: Replace your_domain.com with actual domain name

Install Ghost

Make sure you are in the project directory.

cd /var/www/your_domain.com

Run the installer.

ghost install

During setup, Ghost will prompt for:

  • Blog URL: https://example.com
  • MySQL host: localhost
  • MySQL user: root
  • MySQL password: Your password
  • Database name: ghost_prod

Note: Replace your_domain.com with actual domain name

Ghost installer will also ask to

  • Create MySQL user
  • Setup NGINX
  • Setup SSL via Let’s Encrypt
  • Configure Systemd service

Provide a valid email for the SSL certificate when prompted.

Verify Ghost Status.

ghost ls

Output:

┌─────────────────────┬──────────────────────────────┬─────────┬──────────────────────┬─────────────────────────────┬──────┬─────────────────┐
│ Name                │ Location                     │ Version │ Status               │ URL                         │ Port │ Process Manager │
├─────────────────────┼──────────────────────────────┼─────────┼──────────────────────┼─────────────────────────────┼──────┼─────────────────┤
│ dev-domainhere-info │ /var/www/your_domain.com     │ 6.0.0   │ running (production) │ https://your_domain.com     │ 2369 │ systemd         │
└─────────────────────┴──────────────────────────────┴─────────┴──────────────────────┴─────────────────────────────┴──────┴─────────────────┘

Access Ghost Admin Panel

Open your browser and navigate to URL,

http://your_domain.com/ghost

Note: Replace your_domain.com with actual domain name

You’ll see the Ghost account creation screen. Create the first admin user and begin publishing.

images

Done!

Ghost is now running on Debian 13 with:

  • NGINX reverse proxy
  • SSL via Let’s Encrypt
  • Node.js LTS
  • MariaDB as backend
  • Systemd service for auto-start

images

Conclusion

You’ve now successfully installed Ghost CMS on Debian 13 (Trixie) with Nginx and Let's Encrypt SSL using a secure and production-ready setup. Ghost is now fully operational and accessible via your domain with HTTPS, offering a fast and clean publishing platform.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS