India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Türkiye Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Canada English
Canada Français
Somalia English
Netherlands Nederlands

How to Self-Host Ghost on a VPS

To self-host Ghost, you need a Virtual Private Server (VPS), a domain name, and a few software components to install and run the publishing platform.

Ghost is an open-source content management system (CMS) designed for blogs, newsletters, and membership websites. Instead of relying on managed hosting, you can install Ghost on your own server and manage its operation.

A VPS gives you dedicated server resources and the freedom to configure your hosting environment. 

For publishers in Uganda, our Truehost VPS Hosting plans provide an option for getting the server space, storage, and root access needed to run Ghost.

Before getting started with how to self-host Ghost, you’ll need:

  • A VPS: Choose an Ubuntu 24 server with at least 1 GB RAM. I recommend starting with 2 GB RAM for more room during installation and normal operation.
  • A domain name: Register a domain, such as yourpublication.ug or yourpublication.com, that readers will use to access your website.
  • SSH access: You’ll need your VPS IP address, username, and authentication details to connect to the server remotely.
  • Basic Linux knowledge: Familiarity with terminal commands will help, but I’ll explain the important commands as we go.
  • An email service: Ghost needs an external email provider to reliably deliver newsletters, member notifications, and password-reset messages.

Once you have these in place, you can prepare your server, install Ghost, connect your domain, and configure your website.

Steps to Self-Host Ghost on a VPS

1) Prepare Your VPS

Start by provisioning a VPS running Ubuntu 24.04. Once your server is ready, you’ll receive its public IP address and login credentials.

How to Self Host Ghost: Prerequisites

You’ll use SSH (Secure Shell) to connect to the VPS. SSH allows you to access your server and run commands remotely from your computer.

Open your terminal and enter:

ssh username@your_server_ip

Replace username with your VPS username and your_server_ip with your server’s public IP address.

For example:

ssh [email protected]

If this is your first connection, you’ll be asked to verify the server’s host key. Accept it, then authenticate using your password or SSH key.

Once connected, update Ubuntu’s software packages:

sudo apt update && sudo apt upgrade -y

This command retrieves information about available package updates and installs them. Keeping your server updated helps address known security issues before installing Ghost.

Next, create a non-root user with administrative privileges if your VPS provider hasn’t already supplied one. Ghost’s traditional production installation should run under a dedicated non-root account.

Run:

sudo adduser ghostadmin
sudo usermod -aG sudo ghostadmin

Replace ghostadmin with your preferred username. The first command creates the account, while the second adds it to the sudo group so it can perform administrative tasks.

Important: Avoid using ghost as your Linux username because it can conflict with Ghost-CLI’s user configuration.

Switch to the new account:

su - ghostadmin

Your VPS is now ready for the software installation.

2) Install Ghost’s Required Software

Ghost needs a few software components to run correctly on a VPS. For the traditional Ghost-CLI production installation, these include Node.js, MySQL, Nginx, and Systemd.

Here’s what each component does:

  • Node.js 22 LTS: Provides the runtime environment Ghost needs to execute its application code.
  • MySQL 8.0 or 8.4: Stores your website’s content, member information, settings, and other database records.
  • Nginx: Receives incoming website requests and directs them to the Ghost application.
  • Systemd: Runs Ghost as a background service and manages its startup and restarts.

These components form part of Ghost’s recommended production setup.

Install Node.js

First, add the NodeSource repository for Node.js 22:

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

Then install Node.js:

sudo apt install -y nodejs

Check that the installation was successful:

node -v
npm -v

The first command displays your Node.js version, while the second checks npm, the package manager used to install JavaScript tools such as Ghost-CLI.

Install MySQL

How to Self Host Ghost: MySQL

Run:

sudo apt install -y mysql-server

Once installed, start the MySQL service and configure it to launch automatically whenever your VPS reboots:

sudo systemctl enable --now mysql

Next, run the MySQL security configuration tool:

sudo mysql_secure_installation

Follow the prompts to review the database’s security settings. Use strong credentials and avoid leaving unnecessary default accounts or access settings in place.

Install Nginx

Install Nginx using:

sudo apt install -y nginx

Enable and start the service:

sudo systemctl enable --now nginx

You can check if the services are running with:

sudo systemctl status mysql
sudo systemctl status nginx
How to Self Host Ghost: Nginx

At this point, your VPS has the main software components required for a traditional Ghost production installation.

3) Point Your Domain to Your VPS

Before installing Ghost, connect your domain name to the VPS. This allows visitors to access your publication through its domain rather than having to enter the server’s IP address.

Log in to the account where you manage your domain’s DNS settings. Find the DNS management section and create an A record using these details:

DNS fieldValue
TypeA
Host/Name@
Points to/ValueYour VPS public IP
TTLDefault or Auto

An A record connects your domain to the VPS’s IPv4 address.

If you also want visitors to access your website using the www version, create a CNAME record:

DNS fieldValue
TypeCNAME
Host/Namewww
Points toyourpublication.com

Replace yourpublication.com with your actual domain name.

DNS changes can take some time to propagate across different networks. You can check if your domain resolves to the correct server IP using:

dig +short yourpublication.com

If the command returns your VPS public IP address, the DNS record is resolving correctly.

Once your domain points to the server, you can proceed with the Ghost installation.

4) Install Ghost Using Ghost-CLI

Ghost-CLI is a command-line tool that automates much of the traditional Ghost installation and server configuration process.

It handles tasks such as preparing the database, configuring Nginx, and setting up the application as a background service.

This method applies to Ghost 6.x. Ghost-CLI is being phased out in favor of Docker Compose for Ghost 7.0, so check the recommended deployment method for your intended Ghost version before proceeding.

Install Ghost-CLI

How to Self Host Ghost: Install Ghost

Run:

sudo npm install -g ghost-cli@latest

This installs Ghost-CLI globally, making the ghost command available from your terminal.

Next, create a directory for your Ghost installation:

sudo mkdir -p /var/www/ghost

Assign ownership of the directory to your non-root user:

sudo chown ghostadmin:ghostadmin /var/www/ghost

Now move into the installation directory:

cd /var/www/ghost

Start the Installation

Run:

ghost install

Ghost-CLI will check your server configuration and guide you through several setup questions.

How to Self Host Ghost: Ghost Install

You’ll normally need to provide the following details:

  1. Blog URL: Enter your domain, such as https://yourpublication.com.
  2. MySQL hostname: Use localhost if MySQL is installed on the same VPS.
  3. Database credentials: Provide the MySQL username and password. Ghost-CLI can guide you through creating the database user.
  4. Database name: Enter a name for your Ghost database, such as ghost_prod.
  5. Nginx configuration: Allow Ghost-CLI to configure Nginx to direct website traffic to your Ghost application.
  6. SSL configuration: Allow it to set up a free Let’s Encrypt certificate, provided your domain already points to the VPS and the required ports are accessible.
  7. Systemd configuration: Allow Ghost-CLI to create a service that manages Ghost in the background.

Ghost-CLI handles several installation tasks, including preparing the database, configuring Nginx, setting up HTTPS, and creating the Systemd service.

Once the installation finishes, check its status using:

ghost ls

This command displays information about your Ghost installation, including its version, website URL, and running status.

5) Secure Your Website with SSL

SSL certificates enable HTTPS connections between your website and visitors’ browsers. HTTPS encrypts information exchanged between them, helping protect login sessions and other sensitive data.

During the Ghost-CLI installation, you can allow the tool to configure a free Let’s Encrypt certificate automatically.

Once the installation is complete, open your website:

https://yourpublication.com

Check that it loads over HTTPS without certificate warnings.

If HTTPS doesn’t work, check the following:

  • Your domain points to the correct VPS IP address.
  • Ports 80 and 443 are accessible through your server firewall and provider network.
  • Nginx is running correctly.
  • Your DNS records are resolving to the correct server.

You can also review the Ghost and Nginx logs to identify errors that may have interrupted the SSL configuration.

6) Configure Your Ghost Website

With Ghost installed and running, you can access its administration dashboard by visiting:

https://yourpublication.com/ghost

You’ll be prompted to create your administrator account. Enter your name, email address, and a strong password.

How to Self-Host Ghost: Admin

After logging in, you can start configuring your publication.

Here are a few things to complete:

  1. Publication details: Add your website name, description, logo, and other branding details.
  2. Theme: Choose an existing Ghost theme or upload a custom one to determine how your homepage, articles, and other pages appear.
  3. Membership: Configure free or paid memberships if you plan to offer subscriptions or exclusive content to readers.
  4. Email delivery: Connect an external email provider, such as Mailgun or another supported SMTP service, for newsletters and transactional messages.
  5. First post: Create a test article, add images, preview it, and publish it once you’re satisfied with the layout.

Before announcing your publication, test the website from different devices and browsers. Check that the homepage, articles, navigation, membership features, and contact details work as expected.

7) Secure and Maintain Your Ghost Installation

Getting Ghost online is a good start, but your work doesn’t end with the installation. You’ll also need to protect your server, back up your publication, and keep its software updated.

Here are some maintenance tasks to include in your routine.

Configure a Firewall

A firewall controls which network connections can reach your VPS. Ubuntu includes UFW (Uncomplicated Firewall), which allows you to restrict incoming connections to the services your website needs.

First, allow SSH connections:

sudo ufw allow OpenSSH

Next, allow web traffic through Nginx:

sudo ufw allow 'Nginx Full'

Enable the firewall:

sudo ufw enable

Check the active firewall rules:

sudo ufw status

These settings allow SSH connections and normal HTTP and HTTPS traffic while blocking other incoming connections by default.

Important: Always allow SSH before enabling UFW. Otherwise, you could lock yourself out of your VPS.

Create Regular Backups

Your Ghost website contains valuable information, including published articles, images, member records, and website settings. Losing these files could disrupt your publication.

How to Self-Host Ghost: Backup

To protect your content:

  • Back up your Ghost database and content directory regularly.
  • Store backup copies outside your VPS, such as in secure cloud storage.
  • Test your backups periodically to confirm that the files can be restored.

Keeping an external backup gives you a recovery option if your VPS experiences a hardware failure, data loss, or another problem.

Keep Ghost and Ubuntu Updated

Software updates fix security vulnerabilities, improve performance, and introduce new features. Keeping your installation updated helps protect your website from known issues.

For a Ghost-CLI installation, you can check for and install available Ghost updates using:

cd /var/www/ghost
ghost update

Before running an update, back up your website and check the release notes for compatibility requirements.

You should also update Ubuntu packages regularly:

sudo apt update && sudo apt upgrade -y

Monitor Server Resources

Keep an eye on your VPS’s RAM, CPU usage, storage space, and network activity. These resources affect how well your Ghost website runs, particularly as your readership increases.

If your publication starts experiencing slow loading times or frequent resource shortages, you may need a VPS with more RAM or CPU capacity.

Our Truehost VPS Hosting plans offer different resource configurations, allowing you to select a suitable server and upgrade as your website grows.

8) Can You Self-Host Ghost Using Docker?

Yes. Docker provides another way to deploy Ghost on a VPS.

Instead of installing Ghost and its dependencies directly on Ubuntu, Docker runs the application inside containers. These containers package the software and its required components, making deployment and maintenance easier to manage.

Ghost is also transitioning towards Docker Compose as its official self-hosting approach.

The Ghost team has announced that Ghost 7.0 will be the last major version supported by Ghost-CLI, with Docker Compose becoming the recommended deployment method.

As of November 2026, Ghost’s new Docker setup is available for beta testing. Its installer uses a command similar to:

curl -fsSL https://docker.ghost.org/install.sh | bash -s -- install --domain yourpublication.com

Replace yourpublication.com with your actual domain.

The installer prepares the Docker Compose configuration for your publication. Ghost also provides a ghost-docker helper for maintenance tasks such as updating, backing up, and restoring your installation.

Before choosing this method, keep the following points in mind:

  • Check the official Ghost Docker guide for the latest installation requirements and instructions.
  • The new Docker setup is still in beta, so review its current limitations before using it for a production publication.
  • Back up your website before changing deployment methods.
  • If you’re running Ghost 6.x, the traditional Ghost-CLI method remains a documented installation option.

The choice between Ghost-CLI and Docker Compose depends on the Ghost version you’re installing and the deployment method supported by that release.

Host Your Ghost Publication on a Truehost VPS

Self-hosting Ghost gives you control over your blog, newsletter, membership features, and server configuration. You can manage your publishing environment while running your website on your own VPS.

The installation involves preparing Ubuntu, installing the required software, connecting your domain, configuring HTTPS, and maintaining the server.

Although some steps require terminal commands, you can complete the setup by following the installation instructions carefully.

If you’re planning to launch a Ghost publication in Uganda, our Truehost VPS Hosting plans give you access to virtual server resources, Linux operating systems, and root access to configure your hosting environment.

You can choose a suitable VPS configuration for your publication and upgrade your resources as your readership and website requirements grow.

Ready to launch your own Ghost publication? Check out our Truehost VPS Hosting plans and get started.

Author

Leave a comment

Your email address will not be published. Required fields are marked *