How Do I Install Ghost on My VPS?

Back to VPS

How Do I Install Ghost on My VPS?

Ghost is blogging and CMS software. For a production installation, you need a domain name that points to your VPS.

In this article, we explain how to install Ghost on an Ubuntu VPS with Nginx, MySQL, Node.js, and Ghost-CLI.

Ghost is blogging and CMS software. For a production installation, you need a domain name that points to your VPS.

Note: This guide is meant for customers who are comfortable using SSH and Linux commands. Make a backup first if the VPS already contains important data.

What do you need?

  • An Etheron VPS running Ubuntu 22.04 or Ubuntu 24.04
  • SSH access to the VPS
  • A domain name or subdomain with an A record pointing to your VPS IP address
  • At least 1 GB RAM

Step 1: connect to your VPS

Log in through SSH. Replace your-vps-ip with the IP address of your VPS:

ssh root@your-vps-ip

Step 2: create a separate user

Do not use ghost as the username. This can conflict with Ghost-CLI.

Replace adminuser with the username you want to use:

adduser adminuser
usermod -aG sudo adminuser
su - adminuser

Step 3: update the server

sudo apt update
sudo apt upgrade -y

Step 4: install Nginx

Ghost uses Nginx to make the website available over HTTP and HTTPS.

sudo apt install nginx -y

If you use the UFW firewall, allow Nginx:

sudo ufw allow 'Nginx Full'

Step 5: install MySQL

sudo apt install mysql-server -y

Then set a password for the MySQL root user. Choose a strong password and store it safely, because Ghost-CLI will ask for it later.

sudo mysql

Run this inside the MySQL console. Replace STRONG_PASSWORD_HERE with your own strong password:

ALTER USER 'root'@'localhost' IDENTIFIED WITH 'caching_sha2_password' BY 'STRONG_PASSWORD_HERE';
FLUSH PRIVILEGES;
EXIT;

Step 6: install Node.js 22

Ghost supports Node.js 22 for Ubuntu installations. Install Node.js through NodeSource:

sudo apt install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo 'deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main' | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt update
sudo apt install nodejs -y
node -v
npm -v

Step 7: install Ghost-CLI

sudo npm install ghost-cli@latest -g

Check whether Ghost-CLI works:

ghost --version

Step 8: create a directory for Ghost

Replace mysite with a recognizable directory name:

sudo mkdir -p /var/www/mysite
sudo chown adminuser:adminuser /var/www/mysite
sudo chmod 775 /var/www/mysite
cd /var/www/mysite

If you used a different username than adminuser, update the chown command accordingly.

Step 9: install Ghost

Start the installation:

ghost install

Ghost-CLI will ask several questions:

  • Blog URL: enter your domain, for example https://blog.yourdomain.com
  • MySQL hostname: usually localhost
  • MySQL username: usually root
  • MySQL password: the password you set earlier
  • Set up Nginx: choose Yes
  • Set up SSL: choose Yes if your domain already points to the VPS
  • Set up systemd: choose Yes
  • Start Ghost: choose Yes

Important: Use a domain name for a production installation, not just an IP address. SSL only works properly when your domain already points to the VPS.

Step 10: open Ghost

After the installation, open Ghost through:

https://yourdomain.com/ghost

There you can create the first admin account.

Useful Ghost commands

Run these commands inside the directory where Ghost is installed:

ghost status
ghost restart
ghost update
ghost doctor

Installation failed?

First, check the following:

  • your domain points to the IP address of your VPS;
  • ports 80 and 443 are reachable;
  • the VPS has enough RAM and disk space;
  • you are running the command as a normal sudo user, not as root;
  • MySQL is working and the password is correct.

If you need help, feel free to reach out via Discord or create a support ticket.

Lars
Updated on: 09/09/2026
Was this article helpful?