Updated: 11 October 2026 · Applies to: Ubuntu 24.04 LTS with Ghost-CLI
Ghost is a publishing platform for blogs and newsletters. The Ghost-CLI tool installs it with Nginx, MySQL and HTTPS on Ubuntu.
Requirements
- Ubuntu 22.04 or 24.04 with at least 1 GB RAM (2 GB recommended).
- Node.js 22 or 24 LTS (Ghost 6 supports both), Nginx and MySQL 8 (Ghost does not support MariaDB in production).
- A non-root user with sudo, and a domain pointing to the server.
Install
apt install nginx mysql-server # install Node.js LTS as described in "How to install NodeJS on Ubuntu 18.04?" npm install ghost-cli@latest -g mkdir -p /var/www/ghost && chown youruser:youruser /var/www/ghost && chmod 775 /var/www/ghost cd /var/www/ghost && ghost install
Ghost-CLI asks for your URL and database details, configures Nginx and Let's Encrypt, and creates a systemd service. Then open https://example.com/ghost to create the admin account.
Manage Ghost
cd /var/www/ghost ghost ls # installed sites and their status ghost log # recent log lines ghost restart ghost update # update Ghost (take a backup first)
Ghost sends sign-in links and member emails, so set up email early: add your SMTP details to config.production.json for transactional mail. Bulk newsletters use Mailgun, configured in Settings in the Ghost admin.
Common problems
- Ghost-CLI refuses to run as root: create a normal user with sudo and run
ghost installas that user. - Node.js version error: install a Node.js version Ghost supports (22 or 24) and run the command again.
- SSL step fails: the domain must point to the server and port 80 must be open; you can rerun it with
ghost setup ssl.