← All news

30 October 2026

How to Self-Host Ghost CMS with Docker & Coolify (Step-by-Step Guide)

Your own Ghost instance in about ten minutes: Docker Compose, Coolify, HTTPS, SMTP, and the maintenance chores nobody mentions up front.

Ghost CMS is incredibly powerful — but running it yourself doesn’t have to be complicated.

Thanks to Docker and Coolify, you can deploy your very own Ghost instance in under 10 minutes — no sysadmin experience required.

In this guide, we’ll walk through the entire process step-by-step:

  1. ✅ Prerequisites
  2. 🐳 Setting up Ghost with Docker
  3. 🚀 Deploying via Coolify
  4. 🔐 Configuring HTTPS and SMTP
  5. 🧪 Testing the setup
  6. 🛠️ Maintenance tips

1. Prerequisites

Before we begin, you’ll need:

Requirement Details
Server Linux VM (Ubuntu 22.04 recommended), at least 2GB RAM
Domain Point your domain/subdomain to the server’s IP
Coolify Access Sign up for a self-hosted or hosted account
Docker Pre-installed (Coolify handles this automatically)
(Optional) SMTP Key Required for user invites, password resets, etc. — we’ll cover this later

💡 Pro tip: If you’re unsure where to host, services like Hetzner, DigitalOcean, or AWS EC2 all work well.

2. Setting Up Ghost With Docker (Manual Method)

This section covers the classic Docker-based deployment method. If you’re using Coolify, skip ahead to Section 3.

Step 1: Create docker-compose.yml

Create a directory for your Ghost installation and add the following file inside:

# docker-compose.yml
version: '3'

services:
  ghost:
    image: ghost:5
    ports:
      - '2368:2368'
    volumes:
      - ./content:/var/lib/ghost/content
    environment:
      url: 'http://your-domain.com' # Replace with your domain

  db:
    image: mysql:8.0
    volumes:
      - ./db-data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: password123 # Change this!
      MYSQL_USER: ghost
      MYSQL_PASSWORD: password123 # Change this!
      MYSQL_DATABASE: ghost

⚠️ Never store real passwords in plain text in production configs. Use secrets or environment variables instead.

Step 2: Start Ghost

Run the stack:

docker-compose up -d

Ghost will start immediately and serve on http://localhost:2368.

Visit http://your-domain.com/ghost to complete the initial setup wizard.

3. Deploying Ghost via Coolify

Coolify simplifies self-hosting dramatically.

Step 1: Log In to Coolify

Navigate to your Coolify dashboard.

Step 2: Add a New Application

Click “New Application” → Select “Docker Compose” as deployment type.

Step 3: Choose Repository Source

Select either:

  • A public GitHub repo containing a docker-compose.yml
  • Or manually paste the YAML below into the editor field provided by Coolify.

Paste this into the docker-compose.yml editor:

version: '3'

services:
  ghost:
    image: ghost:5
    ports:
      - '2368:2368'
    volumes:
      - ghost-content:/var/lib/ghost/content
    environment:
      url: 'https://${DOMAIN}' # Filled dynamically
      database__client: 'mysql'
      database__connection__host: 'mariadb'
      database__connection__user: 'ghost'
      database__connection__password: 'changeme'
      database__connection__database: 'ghost'
    restart: unless-stopped

  mariadb:
    image: mariadb:latest
    volumes:
      - ghost-mariadb:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: 'supersecret'
      MYSQL_DATABASE: 'ghost'
      MYSQL_USER: 'ghost'
      MYSQL_PASSWORD: 'changeme'
    restart: unless-stopped

volumes:
  ghost-content:
  ghost-mariadb:

Step 4: Set Required Environment Variables

Under Environment Variables, set the following:

Name Value
DOMAIN Your domain name (e.g., https://myblog.example.com)
MYSQL_ROOT_PASSWORD Root password for MariaDB (choose securely!)
MYSQL_DATABASE ghost
MYSQL_USER ghost
MYSQL_PASSWORD Database password (same as above)

Step 5: Deploy

Click Deploy.

After ~2 minutes, your Ghost site will be live! You can access it via the assigned domain or IP address.

4. Configuring HTTPS and SMTP

By default, Ghost serves over HTTP only. For production use, you should enable HTTPS.

Enable HTTPS Using Coolify Proxy

In Coolify:

  1. Go to your application settings.
  2. Under Reverse Proxy Settings, select Enable HTTPS.
  3. Enter your domain name and verify ownership (via DNS challenge).
  4. Save and redeploy.

Coolify will issue a valid Let’s Encrypt certificate automatically.

Alternatively, if deploying manually via Docker, you can configure Let’s Encrypt with Traefik or Nginx as a proxy layer.

Configure SMTP for Email Delivery

Emails are needed for:

  • Staff invitations
  • Password reset flows
  • Member signups
  • Newsletter delivery (if enabled)

Add these to your docker-compose.yml environment section.

Example Using Gmail SMTP

environment:
  mail__transport: SMTP
  mail__options__service: Gmail
  mail__options__auth__user: [email protected]
  mail__options__auth__pass: your-app-password

🔒 Note: Use an App Password instead of your actual Gmail password.

Example Using Mailgun SMTP

environment:
  mail__transport: SMTP
  mail__options__host: smtp.mailgun.org
  mail__options__port: 587
  mail__options__auth__user: [email protected]
  mail__options__auth__pass: your-mailgun-api-key
  mail__from: "My Blog <[email protected]>"

Once configured, restart your containers:

docker-compose down && docker-compose up -d

5. Testing the Setup

After deployment completes:

  1. Visit https://your-domain.com/ghost
  2. Complete the setup form:
    • Enter an email (this becomes the admin login)
    • Choose a strong password
    • Name your site
  3. Log in to the Ghost dashboard.

✅ Success! You’re now running your own self-hosted Ghost CMS instance.

6. Maintenance Tips

Back Up Content Regularly

The most important data lives in the content/ directory. Back it up frequently.

# Manual backup (replace paths accordingly)
tar -czvf ghost-backup.tar.gz ./content/

Or automate daily backups with cron or Coolify’s built-in backup scheduler.

Update Ghost Version

To upgrade Ghost:

  1. Edit docker-compose.yml:
    image: ghost:5
    Change 5 → latest minor/patch version (e.g., ghost:5.100)
  2. Restart the container:
    docker-compose down && docker-compose up -d

Monitor Logs

Check logs in real time:

# For Docker deployments
docker-compose logs -f

# In Coolify:
# Navigate to Monitoring → Logs tab

Summary Checklist

Task Done
Create Coolify project☐
Paste docker-compose.yml☐
Configure environment variables☐
Deploy application☐
Enable HTTPS☐
Set up SMTP/email☐
Run Ghost setup wizard☐

Ready for More Sites?

Running multiple Ghost instances? Managing dozens of sites is exactly what Jamu Manajer Hantu was built for.

👉 Contact Jamu to learn about centralized monitoring and management for all your Ghost installations.

  • #ghost
  • #docker
  • #coolify
  • #self-hosting
  • #cms
  • #nodejs
  • #guide

Written by the Jamu team — builders of Jamu Manajer Hantu, a dashboard for teams that manage multiple Ghost sites.