Instructions to Install multiple Ghost Instances on the RPI with separate domains


I’m on a Raspberry Pi 4B with 8GB of RAM. For the past 3 days, I have been trying to install multiple ghost blogs onto my RPI each with a custom domain from freenom.

I have followed these instructions here:

Which are the only ones that have worked for me out of the others on the inter web. I can get it all up an running but only on localhost. I have tried using a custom domain instead of localhost in the ghost setup but get that the domain name server is not responding when I go to type it in on the internet after the ghost installation has finished successfully.

I would really, really appreciate some step by step instructions that allow me to:

  1. Host multiple ghost blogs on a RPI 4B.
  2. Have different domain names and what to setup the DNS as.

I would really appreciate this,
If you would like more info please just ask :slight_smile:


These are the instructions that I followed, they are a collection of ones online that I have found to give the least issues; I still have the domain issue and not sure how to do multiple instances yet. Since I seemed to mess up my last setup I just reinstalled the OS and am currently trying again. I am up to the ghost install stage:

Installing Ghost Steps

# I just reinstalled OS so everything is up to date

# Install NODE
curl -sL | sudo -E bash

# NPM install
sudo apt-get install -y nodejs

# Node Update to the latest release
sudo npm cache clean -f # Clear cache, I originally forgot the force flag so just redid it
sudo npm install -g n # Helper
sudo n stable # Install Latest stable version of node.js

# Packages: Webserver database and nodejs
# -y flag is default yes for any questions asked
sudo apt install nginx mariadb-server nodejs -y

# Globally install ghost: sudo npm install ghost-cli@latest -g 

# Configure MariaDB
sudo service mariadb stop 

# Restart in safe mode: sudo mysqld_safe --skip-networking &

# Login to MariaDB
sudo mariadb -u root

# Reload GRANT tables

# Change passcode for the root user
ALTER USER 'root'@'localhost' IDENTIFIED BY 'my_new_password';


# Reboot to ensure any changes take place and get out of safe mode —> not sure this is necessary 
Sudo reboot

# Create a database and DB user for ghost
# Login using new passcode:
mariadb -uroot -p 

# Create new DB 

# Create new user and password
CREATE USER 'ghost_cms'@'localhost' IDENTIFIED BY 'my_password';

# Set permissions
GRANT ALL PRIVILEGES ON ghost_cms.* TO 'ghost_cms'@'localhost';


# Creating a system user for ghost and make it a sudo user

sudo useradd www-ghost
sudo usermod -aG sudo www-ghost

# Create a home directory for new user with correct permissions:
sudo mkdir /home/www-ghost && sudo chown www-ghost:www-ghost /home/www-ghost

# Password: sudo passwd www-ghost
# Enter password:

# Set Ghost Up
sudo mkdir -p /var/www/ghost

# Set owner of directory
sudo chown www-ghost:www-ghost /var/www/ghost && sudo chmod 775 /var/www/ghost && cd /var/www/ghost

# Switch User:
sudo su www-ghost

# Install Ghost: ghost install

# Message about compatibility: y
# Blog URL: 
# MySQL hostname: localhost
# MySQL username: ghost_cms
# MYSQL password: {from before}
# Ghost DB name: ghost_cms
# Do you wish to setup NGINX: y
# Do you wish to set up  SSL: n (for now, I’ll need to do this later)
# Do you wish to setup Systemd: y

This worked for the first ghost blog.
I’m now going to try it for another and will update here again.

I want to try and get this on SSL
so try:

ghost setup ssl

I put in my email correctly and get the error:

â Setting up SSL
One or more errors occurred.

1) ProcessError

Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#'  /etc/letsencrypt/ --issue --home /etc/letsencrypt --domain --webroot /var/www/ghost/system/nginx-root --reloadcmd "nginx -s reload" --accountemail
[Fri 16 Jul 14:52:15 BST 2021] error:No valid IP addresses found for
[Fri 16 Jul 14:52:15 BST 2021] Please add '--debug' or '--log' to check more details.
[Fri 16 Jul 14:52:15 BST 2021] See:

[Fri 16 Jul 14:52:00 BST 2021] Using CA:
[Fri 16 Jul 14:52:04 BST 2021] Create account key ok.
[Fri 16 Jul 14:52:04 BST 2021] Registering account:
[Fri 16 Jul 14:52:06 BST 2021] Registered
[Fri 16 Jul 14:52:06 BST 2021] ACCOUNT_THUMBPRINT='Cq235D4UzQTq4SGTeFryY4JwFpvMN8yUnw4aLH_TtfM'
[Fri 16 Jul 14:52:06 BST 2021] Creating domain key
[Fri 16 Jul 14:52:08 BST 2021] The domain key is here: /etc/letsencrypt/
[Fri 16 Jul 14:52:08 BST 2021] Single domain=''
[Fri 16 Jul 14:52:08 BST 2021] Getting domain auth token for each domain
[Fri 16 Jul 14:52:10 BST 2021] Getting webroot for domain=''
[Fri 16 Jul 14:52:11 BST 2021] Verifying:

Exit code: 1

Debug Information:
    OS: Raspbian GNU/Linux, v10
    Node Version: v14.17.3
    Ghost Version: 4.9.4
    Ghost-CLI Version: 1.17.3
    Environment: production
    Command: 'ghost setup ssl'

Additional log info available in: /home/www-ghost/.ghost/logs/ghost-cli-debug-2021-07-16T13_52_16_231Z.log

I checked here:

And I think it is showing that it is fine?

  1. IP-Addresses
Host Type IP-Address is auth. ∑ Queries ∑ Timeout A
No Hostname found yes 1 0
AAAA yes A
No Hostname found yes 1 0
AAAA yes
* A Name Error yes
AAAA Name Error yes
CNAME Name Error yes

But I’m not too sure, if anyone could give guidance it would be much appreciated.
I have my DNS with freenom at the moment, but will change this in the future and I have it setup like this:

Record 1:
3600 - TTL - Target

Record 2:
3600 - TTL - TARGET

I managed to get ghost working, the SSL wasn’t working since it is not visible from outside the network, this is an NGINX issue that I need to solve with port forwarding somehow. At the moment, when I port forward I just get the default NGINX site that was setup and not the GhostCMS site. So…yes.