How to install Ghost on Vps
If you have trouble or if you have questions, we can speak on Discord.
I will discribe for ubuntu OS :
# Create a new user and follow prompts
adduser <user>
# Add user to superuser group to unlock admin privileges
usermod -aG sudo <user>
# Then log in as the new user
su - <user>
Updates the packages of your vps :
sudo apt-get update & upgrade
Install Nginx
sudo apt-get install nginx
Allow Nginx in the firewall
sudo ufw allow 'Nginx Full'
Install Mysql
sudo apt-get install mysql-server
Create an user on mysql here root (I recommand to change the password):
sudo mysql
# Update permissions
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '<your-new-root-password>';
# Reread permissions
FLUSH PRIVILEGES;
# exit mysql
exit
Install Node.js (We need Node.Js 18)
# Download and import the Nodesource GPG key
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=18 # Use a supported version
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
sudo npm install ghost-cli@latest -g
We will create a folder to store our website (I recommend to change sitename by your official website
# Create directory: Change `sitename` to whatever you like
sudo mkdir -p /var/www/sitename
# Set directory owner: Replace <user> with the name of your user
sudo chown <user>:<user> /var/www/sitename
# Set the correct permissions
sudo chmod 775 /var/www/sitename
# Then navigate into it
cd /var/www/sitename
Install Ghost
ghost install
Step by step :

blog url : https://blog.domain.com (the url you want your website appear recommended to use sub domain)
hostname : press Enter if you do'nt have already one
mysql username/ password (Recommended to write somewhere)
Ghost database : It will automotically set up until your user is non-root
Access to the url for get the admin panel : https://blog.domain.com/ghost
Ghost will ask you to create an user.

If you meet error when uploading picture add in file config.production.json et faire u nghost restart :
"imageOptimization": {
"resize": false
}
Configure mail :
"mail": {
"from": "your_mail",
"transport": "SMTP",
"options": {
"service": "Gmail",
"auth": {
"user": "antoninleo1011@gmail.com",
"pass": "some password"
}
}
},
Command useful :
ghost doctor print information
ghost status
ghost restart
ghost config set url https://nouvelle-url.com
ghost setup nginx : for update nginx config
ghost setup ssl : for setup ssl on your website
Nginx useful :
sudo nginx -t
/etc/nginx/site-available
Check if ghost ru non the good port : sudo ss -tunlp | grep 2369
source : https://ghost.org/docs/install
A tutorial that helped me :