Prerequisites
Server Requirements
| Requirement | Specification |
|---|---|
| Operating System | Ubuntu 22.04 or 24.04 LTS |
| RAM | Minimum 1GB (2GB+ recommended) |
| Storage | 20GB+ SSD storage |
| Node.js | Version 22 LTS (current recommended) |
| Database | MySQL 8 |
| Web Server | NGINX 1.9.5 or higher |
Before You Begin
- A RamNode VPS with Ubuntu 22.04 or 24.04 installed
- Root or sudo access to your server
- A registered domain name with DNS A record pointing to your server's IP
- Basic familiarity with the Linux command line
Part 1: Initial Server Setup
Connect to Your Server
Connect to your RamNode VPS via SSH using the credentials provided in your welcome email:
ssh root@your_server_ipCreate a Non-Root User
For security reasons, Ghost should not be run as the root user. Create a new user with sudo privileges:
adduser ghostadminImportant: Do not use "ghost" as the username, as this conflicts with the Ghost-CLI.
Grant the new user sudo privileges and switch to that user:
usermod -aG sudo ghostadmin
su - ghostadminUpdate System Packages
Ensure your system is up to date before proceeding:
sudo apt-get update
sudo apt-get upgrade -yPart 2: Install Dependencies
Install NGINX
Ghost uses NGINX as a reverse proxy to handle incoming web requests:
sudo apt-get install nginx -yIf you have UFW firewall enabled, allow NGINX traffic:
sudo ufw allow 'Nginx Full'Install MySQL
Install MySQL 8 as the database server for Ghost:
sudo apt-get install mysql-server -yConfigure the MySQL root user with password authentication. Ghost does not support socket-based authentication:
sudo mysql
-- Run these commands in the MySQL shell:
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'your_secure_password';
FLUSH PRIVILEGES;
exitSecurity Note: Replace 'your_secure_password' with a strong, unique password. Store this password securely as you'll need it during Ghost installation.
Install Node.js
Ghost requires Node.js v22 LTS. Install it using the NodeSource repository:
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
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
sudo apt-get update
sudo apt-get install nodejs -yVerify the installation:
node --version
npm --versionPart 3: Install Ghost
Install Ghost-CLI
Ghost-CLI is the official command-line tool for installing and managing Ghost installations:
sudo npm install ghost-cli@latest -gCreate the Ghost Directory
Create a dedicated directory for your Ghost installation with proper ownership and permissions:
sudo mkdir -p /var/www/ghost
sudo chown ghostadmin:ghostadmin /var/www/ghost
sudo chmod 775 /var/www/ghost
cd /var/www/ghostRun the Ghost Installer
With all prerequisites in place, run the Ghost installation command:
ghost installThe installer will prompt you for several configuration options:
| Prompt | Recommended Response |
|---|---|
| Blog URL | Enter your full URL (e.g., https://yourdomain.com) |
| MySQL hostname | localhost (press Enter for default) |
| MySQL username | root |
| MySQL password | The password you set in Step 5 |
| Ghost database name | ghost_prod (or your preferred name) |
| Set up ghost MySQL user? | Yes (recommended for security) |
| Set up NGINX? | Yes (configures reverse proxy) |
| Set up SSL? | Yes (free Let's Encrypt certificate) |
| Set up systemd? | Yes (enables automatic startup) |
| Start Ghost? | Yes |
Part 4: Post-Installation Configuration
Complete Ghost Setup
Once installation completes, access your Ghost admin panel by navigating to:
https://yourdomain.com/ghostCreate your admin account and configure your publication settings including site title, description, and branding.
Configure Email (Optional)
For newsletter functionality and transactional emails, configure SMTP settings. Edit the Ghost configuration file:
cd /var/www/ghost
nano config.production.jsonAdd your mail configuration within the JSON structure:
"mail": {
"transport": "SMTP",
"options": {
"host": "smtp.your-email-provider.com",
"port": 587,
"secure": false,
"auth": {
"user": "your-email@example.com",
"pass": "your-smtp-password"
}
}
}Restart Ghost to apply changes:
ghost restartGhost Management Commands
| Command | Description |
|---|---|
| ghost start | Start the Ghost service |
| ghost stop | Stop the Ghost service |
| ghost restart | Restart the Ghost service |
| ghost update | Update Ghost to the latest version |
| ghost log | View Ghost logs |
| ghost config | View or modify configuration |
| ghost backup | Create a backup of your content |
| ghost doctor | Diagnose installation issues |
Troubleshooting
Best Practices
Use Ghost's built-in export feature (Settings → Labs → Export content) and maintain database backups using mysqldump.
Run 'ghost update' regularly to receive security patches and new features.
Keep an eye on server resource usage, especially RAM. Consider upgrading your VPS plan if you experience performance issues.
Keep your server's packages updated, use strong passwords, and consider implementing fail2ban for additional protection.
For high-traffic sites, consider integrating a CDN like Cloudflare to improve performance and add DDoS protection.
Additional Resources
Ready to Deploy Ghost CMS?
Get started with a RamNode Cloud VPS and have your Ghost publishing platform running in minutes.
