Introduction
Ghost is a fully open source, hackable platform for building and running a modern online publication. It is a light-weight. It is fully customizable, with many themes available. Ghost user interface is very simple and straightforward making it great for beginners as well as advanced users.
This tutorial will walk you through how to install Ghost on Ubuntu.
Requirements
Ubuntu 22.04 or Ubuntu 24.04.
NGINX (minimum of 1.9.5 for SSL).
A supported version of Node.js.
MySQL 8.
A server with at least 1GB memory.
A registered domain name.
Installation
Update packages
First things first. Like always, first of all, we recommend to update and upgrade your server.
apt-get update && apt-get upgrade -y
Create a new user
It is important to choose a DIFFERENT username than ghost. Using ghost will cause issues with the ghost system.
adduser <user>
Now, set permissions for the user:
usermod -aG sudo <user>
Switch to the created user:
su <user>
Install NGINX
Ghost uses an NGINX server and the SSL configuration requires NGINX 1.9.5 or higher.
sudo apt-get install nginx -y
Install MySQL
Next, you’ll need to install MySQL to be used as the production database.
sudo apt-get install mysql-server -y
On newer versions of Ubuntu, the root user created without a password authentication when you install MySQL. Since Ghost does not allow such authentication, give the "root" user a password:
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'CHANGE_PASSWORD_HERE';
FLUSH PRIVILEGES;
exit
Install Node.js
You will need to have a supported version of Node installed system-wide in the manner described below. If you have a different setup, you may encounter problems.
sudo apt-get update
sudo apt-get 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
# Create deb repository
NODE_MAJOR=22
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
# Run update and install
sudo apt-get update
sudo apt-get install nodejs -y
Install Ghost-CLI
Install Ghost-CLI for easier Ghost installation:
sudo npm install ghost-cli@latest -g
Install Ghost
Create a webroot directory. We use ghost, but you can choose a different one:
sudo mkdir -p /var/www/ghost
Set the owner of the directory:
sudo chown <user>:<user> /var/www/ghost
Set the 755 permissions for the directory:
sudo chmod 775 /var/www/ghost
Install Ghost:
cd /var/www/ghost
ghost install
During the installation you will be requested to enter information about your site:
Blog URL - Website address (do not use IP)
MySQL hostname - localhost
MySQL user - root
MySQL password - the one you have set during MySQL installation
Ghost database name - any name, by default it is ghost_prod. If you use root log-in to MySQL system will create the database for you.
Set up MySQL Ghost user? - yes
Set up Nginx - yes
Set up SSL - yes
Set up systemd - yes
Start Ghost - yes
To access Ghost administrator page, open a link in your browser:
https://website_address/ghost
Conclusion
Now you have installed, configured, and ready to be used Ghost application on your server. Go to your domain.tld/ghost, set up login and other details and that's it, you are ready to blog!