FedoraRHEL Based

How To Install Ghost on Fedora 43

Install Ghost on Fedora 43

Ghost CMS has become one of the most popular open-source publishing platforms for bloggers, content creators, and developers who want complete control over their digital presence. Built on Node.js, Ghost offers a clean interface, powerful features, and blazing-fast performance that makes it an excellent choice for modern websites. Fedora 43, with its cutting-edge packages and robust security features, provides an ideal environment for hosting your Ghost blog.

This comprehensive guide walks you through every step of installing Ghost on Fedora 43, from initial server setup to final configuration. Whether you’re migrating from another platform or starting fresh, you’ll have a fully functional Ghost installation with SSL encryption by the end of this tutorial. Let’s dive in.

Understanding Ghost CMS and System Requirements

What is Ghost CMS?

Ghost is a powerful, Node.js-based content management system designed specifically for publishing. Unlike bloated alternatives, Ghost focuses on what matters: creating and distributing content. The platform offers built-in SEO optimization, membership features, newsletter functionality, and a distraction-free writing experience that professional publishers love.

Self-hosting Ghost on Fedora 43 gives you complete control over your data, customization options, and hosting costs. While Ghost(Pro) offers managed hosting, running Ghost on your own server means no recurring subscription fees and unlimited flexibility.

System Requirements for Fedora 43

Before starting your Ghost installation, ensure your system meets these specifications:

  • Memory: Minimum 1GB RAM, though 2GB or more is strongly recommended for optimal performance
  • Node.js: Version 22 LTS is required for the latest Ghost releases
  • Database: MySQL 8.0 or higher
  • Web Server: NGINX for reverse proxy configuration
  • Process Manager: Systemd handles service management
  • Storage: At least 20GB SSD storage for application files and content
  • User Permissions: A dedicated non-root user for security

Prerequisites Before Installation

Server Setup

Start with a fresh Fedora 43 installation. You’ll need root or sudo access to execute administrative commands. If you plan to use a custom domain, configure your DNS records to point to your server’s IP address before proceeding.

Firewall configuration is essential. Fedora uses firewalld by default, which we’ll configure to allow web traffic through ports 80 and 443.

Required Knowledge

This tutorial assumes basic familiarity with Linux command-line operations, SSH access, and text editors like vim or nano. Understanding systemd services will help, though we’ll explain each step clearly.

Security Preparations

SSH key-based authentication provides better security than password authentication. Configure firewalld properly and consider installing fail2ban to protect against brute-force attacks. Always keep your system updated using DNF package manager.

Step 1: Initial Server Preparation

Update System Packages

Connect to your Fedora 43 server via SSH and update all system packages:

sudo dnf update -y

This ensures you’re starting with the latest security patches and software versions. If kernel updates are installed, reboot your system:

sudo reboot

Create a Dedicated Ghost User

Running Ghost as root poses significant security risks. Create a dedicated system user:

sudo useradd --system --create-home --shell /bin/false --user-group ghost

This command creates a system user named “ghost” with its own home directory but no login shell, preventing direct access while maintaining proper process ownership.

Configure Firewall

Open the necessary ports for HTTP and HTTPS traffic:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Verify your firewall rules:

sudo firewall-cmd --list-all

Step 2: Install Required Dependencies

Install Core Packages

Ghost requires several packages to function properly. Install NGINX, Node.js, and essential development tools:

sudo dnf install nginx nodejs npm -y
sudo dnf install node-gyp gcc-c++ make -y
sudo dnf install vim curl git unzip -y

NGINX serves as the reverse proxy, forwarding requests to Ghost. Node.js and npm run the Ghost application, while development tools compile native modules.

Install and Configure MySQL 8

MySQL serves as Ghost’s production database. Install and configure it:

sudo dnf install mysql-server -y
sudo systemctl start mysqld
sudo systemctl enable mysqld

Secure your MySQL installation:

sudo mysql_secure_installation

Follow the prompts to set a root password, remove anonymous users, and disallow remote root login.

Create a database and user for Ghost:

sudo mysql -u root -p

Inside the MySQL prompt, execute:

CREATE DATABASE ghost_production CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'ghost'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON ghost_production.* TO 'ghost'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Replace your_secure_password with a strong password.

Install Certbot for SSL

SSL encryption is mandatory for modern websites. Install Certbot:

sudo dnf install certbot python3-certbot-nginx -y

We’ll obtain certificates later after configuring NGINX.

Step 3: Install Node.js 22 LTS

Check Current Node.js Version

Verify your Node.js installation:

node --version

Ghost requires Node.js 22 LTS. If Fedora’s default repositories don’t provide the correct version, use Node Version Manager (NVM) or NodeSource repository.

Install Node Version Manager (Recommended)

NVM simplifies Node.js version management. Install NVM:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

Load NVM:

source ~/.bashrc

Install Node.js 22 LTS:

nvm install 22
nvm use 22
nvm alias default 22

Verify Installation

Confirm your Node.js and npm versions:

node --version
npm --version

Both commands should return appropriate version numbers without errors.

Step 4: Install Ghost-CLI

What is Ghost-CLI?

Ghost-CLI is the official command-line tool for installing and managing Ghost installations. It automates complex setup tasks, checks system requirements, and simplifies updates.

Install Ghost-CLI Globally

Install Ghost-CLI globally using npm:

sudo npm install ghost-cli@latest -g

The -g flag installs Ghost-CLI system-wide, making it accessible from any directory.

Verify installation:

ghost --version

View available commands:

ghost help

Step 5: Create Ghost Installation Directory

Ghost requires a dedicated directory with proper permissions. Create it:

sudo mkdir -p /var/www/ghost

The /var/www/ location is standard for web applications.

Set ownership to the ghost user:

sudo chown ghost:ghost /var/www/ghost

Set appropriate permissions:

sudo chmod 775 /var/www/ghost

Navigate to the directory:

cd /var/www/ghost

Never install Ghost in /root or user home directories—Ghost-CLI requires a proper web server location.

Step 6: Download and Install Ghost

Using Ghost-CLI Installation Method (Recommended)

Ghost-CLI provides the simplest installation experience. As the ghost user, run:

sudo -u ghost ghost install

Ghost-CLI will prompt you for configuration details:

  • Blog URL: Enter your domain (e.g., https://yourdomain.com)
  • MySQL hostname: Enter localhost
  • MySQL username: Enter ghost
  • MySQL password: Enter the password you created earlier
  • MySQL database name: Enter ghost_production
  • Set up NGINX: Answer yes
  • Set up SSL: Answer yes
  • Set up systemd: Answer yes
  • Start Ghost: Answer yes

Ghost-CLI automatically configures everything, including NGINX, SSL certificates, and systemd services.

Manual Installation Method (Alternative)

If Ghost-CLI doesn’t work, download Ghost manually:

sudo -u ghost curl -L $(curl -sL https://api.github.com/repos/TryGhost/Ghost/releases/latest | jq -r '.assets[].browser_download_url') -o /tmp/ghost.zip
sudo -u ghost unzip -uo /tmp/ghost.zip -d /var/www/ghost

Install dependencies:

cd /var/www/ghost
sudo -u ghost npm install --production

Run security audits:

sudo -u ghost npm audit fix

Step 7: Configure Ghost

Blog URL Configuration

Your blog URL must be correctly configured for Ghost to function properly. Edit the configuration file:

sudo -u ghost vim /var/www/ghost/config.production.json

Ensure the url field matches your domain:

{
  "url": "https://yourdomain.com",
  ...
}

Database Configuration

Verify your MySQL connection settings in the same configuration file:

{
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "ghost",
      "password": "your_secure_password",
      "database": "ghost_production"
    }
  }
}

Mail Configuration

Configure SMTP for email delivery. Add mail settings:

{
  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Gmail",
      "auth": {
        "user": "youremail@gmail.com",
        "pass": "your-app-password"
      }
    }
  }
}

Replace with your actual SMTP credentials. Proper mail configuration enables user invitations, password resets, and newsletter functionality.

Step 8: Configure NGINX as Reverse Proxy

Create NGINX Configuration File

If Ghost-CLI didn’t configure NGINX automatically, create a server block manually:

sudo nano /etc/nginx/conf.d/ghost.conf

Add this configuration:

server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.com www.yourdomain.com;

    location / {
        proxy_pass http://localhost:2368;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Ghost runs on port 2368 by default. NGINX forwards requests from port 80 to Ghost.

Enable and Test NGINX Configuration

Test your NGINX configuration:

sudo nginx -t

If successful, reload NGINX:

sudo systemctl reload nginx
sudo systemctl enable nginx
sudo systemctl start nginx

Step 9: Configure SSL/TLS with Let’s Encrypt

Obtain SSL Certificate

Secure your Ghost blog with free SSL certificates from Let’s Encrypt:

sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Certbot automatically modifies your NGINX configuration to include SSL settings.

Configure Auto-Renewal

Let’s Encrypt certificates expire after 90 days. Certbot installs a systemd timer for automatic renewal. Verify it’s enabled:

sudo systemctl status certbot-renew.timer

Test renewal:

sudo certbot renew --dry-run

Step 10: Create Systemd Service for Ghost

If Ghost-CLI configured systemd automatically, skip this section. Otherwise, create a service file manually:

sudo nano /etc/systemd/system/ghost.service

Add this configuration:

[Unit]
Description=Ghost systemd service
After=network.target mysql.service

[Service]
Type=simple
WorkingDirectory=/var/www/ghost
User=ghost
Environment="NODE_ENV=production"
ExecStart=/usr/bin/node current/index.js
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Enable and Start Ghost Service

Reload systemd:

sudo systemctl daemon-reload

Start Ghost:

sudo systemctl start ghost
sudo systemctl enable ghost

Check status:

sudo systemctl status ghost

You should see “active (running)” in green.

Step 11: Initial Ghost Setup and Testing

Access Ghost Admin

Open your browser and navigate to your domain. You should see the default Ghost theme.

Access the admin panel at https://yourdomain.com/ghost.

Create your admin account by providing:

  • Email address
  • Full name
  • Password

Complete the setup wizard by configuring your site title and description.

Install Ghost on Fedora 43

Verify Installation

Test these components:

  • Frontend: Visit your homepage
  • Admin panel: Log in at /ghost
  • Database: Create a test post
  • Email: Test password reset functionality
  • SSL: Ensure HTTPS works without errors

Review logs if issues arise:

sudo journalctl -u ghost -n 50

Post-Installation Configuration

Ghost Settings Optimization

Navigate to Settings in your admin panel. Configure:

  • General settings: Site title, description, timezone
  • Navigation: Primary and secondary menus
  • Design: Install themes from Ghost marketplace
  • Membership: Enable subscriptions if desired
  • Integrations: Connect analytics tools

Backup Configuration

Regular backups prevent data loss. Back up critical files:

sudo cp /var/www/ghost/config.production.json ~/ghost-config-backup.json

For database backups:

mysqldump -u ghost -p ghost_production > ghost_backup_$(date +%Y%m%d).sql

Ghost also provides built-in export functionality in Settings > Labs.

Troubleshooting Common Issues

Installation Errors

Permission denied: Ensure the ghost user owns /var/www/ghost

sudo chown -R ghost:ghost /var/www/ghost

Node.js version conflicts: Verify you’re using Node.js 22 LTS

MySQL authentication errors: Check your database credentials in config.production.json

npm installation failures: Clear npm cache and retry:

npm cache clean --force

Use Ghost-CLI’s diagnostic tool:

ghost doctor

Runtime Issues

Ghost service won’t start: Check logs for specific errors:

sudo journalctl -u ghost -xe

NGINX proxy errors: Verify Ghost is listening on port 2368:

sudo ss -tulpn | grep 2368

SSL certificate issues: Ensure your domain resolves correctly and firewall allows port 80

Database connection failures: Test MySQL connectivity:

mysql -u ghost -p -h localhost ghost_production

SELinux policy issues: Fedora’s SELinux may block connections. Check audit logs:

sudo ausearch -m avc -ts recent

Maintaining Your Ghost Installation

Updating Ghost

Keep Ghost current with regular updates:

cd /var/www/ghost
sudo -u ghost ghost update

Always back up before updating.

Monitoring and Performance

Monitor Ghost service health:

sudo systemctl status ghost

Check Ghost logs:

ghost log

Optimize MySQL performance with regular maintenance:

mysqlcheck -u root -p --optimize ghost_production

Keep Fedora updated:

sudo dnf update -y

Congratulations! You have successfully installed Ghost. Thanks for using this tutorial for installing Ghost Content Management System on your Fedora 43 system. For additional help or useful information, we recommend you check the official Ghost website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button