Build Your Own Publishing Platform: Ghost on Ubuntu
Running your own blog doesn’t have to rely on managed platforms. In this guide, I’ll walk through installing Ghost CMS on Ubuntu, using a self-hosted setup that gives you full control over performance, security, and customization.
This article covers the complete installation process—from preparing the Ubuntu server and installing required dependencies, to deploying Ghost with production-ready settings.
If you’re looking to run a modern publishing platform on your own infrastructure—whether for learning, experimentation, or production use—this guide will help you get there with a clean and stable setup.
- Build a VM container
- Setup Ubuntu OS
- Create New User
- Add User to sudo
- Run as ghost Account
- Install MS Sql
sudo apt-get install mysql-server
- Edit mysql
# Enter mysql
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
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 # 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
- Create Directory and Folder Permission
# 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
- Run Install Process
ghost install
- Some Questions while installing Ghost
? Enter your blog URL: https://blog.mutiangpili.com
? Enter your MySQL hostname: localhost
? Enter your MySQL username: root
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: ghost_prod
? Do you wish to set up "ghost" mysql user? Yes
? Do you wish to set up Nginx? No
? Do you wish to set up Systemd? Yes
? Do you want to start Ghost? Yes
- Congratulations! 🥂
Ghost was installed successfully! To complete setup of your publication, visit:
https://blog.mutiangpili.com/ghost/💡
TL;DR – Key Takeaways
• Use a Ghost-supported Node.js version to avoid issues with native modules like
• Back up your database and
• Check file ownership and permissions—most upload and theme issues start there.
• Monitor disk space and Ghost logs (
• Deploy behind Nginx with HTTPS and avoid exposing the
• Restart and test incrementally after each configuration change.
• Use a Ghost-supported Node.js version to avoid issues with native modules like
sharp.• Back up your database and
content/ directory before upgrades or major changes.• Check file ownership and permissions—most upload and theme issues start there.
• Monitor disk space and Ghost logs (
ghost log) to catch silent failures early.• Deploy behind Nginx with HTTPS and avoid exposing the
/ghost admin endpoint publicly.• Restart and test incrementally after each configuration change.