Zum Hauptinhalt springen
Zurück zur Kategorie

Ghost Installation: Self-Hosted Blog und Content-Plattform

Ghost Docker-Installation, Nginx Reverse Proxy, SSL-Zertifikat, Theme-Einrichtung, Mitgliedschafts- und Abonnementsystem, E-Mail-Newsletter und Production-Konfiguration.

Lesezeit: 13 dk Self-Hosting
ghostblogcmsself-hostingdockernewslettercontent-management

Inhaltsverzeichnis

Ghost Installation: Self-Hosted Blog und Content-Plattform

Ghost ist eine Open-Source-CMS-Plattform für modernes Blogging und Content-Publishing. Im Vergleich zu WordPress ist es schneller, sicherer und inhaltsorientiert. Es unterstützt auch Content-Monetarisierung mit Mitgliedschaftssystem, Newsletter und Zahlungsintegration.

Was ist Ghost?

Ghost ist ein Node.js-basiertes Headless-CMS und Publishing-Plattform. Hauptmerkmale:

  • Geschwindigkeit: Node.js-basiert, sehr schnelle Seitenladezeiten
  • SEO: Integrierte SEO-Tools und strukturierte Daten
  • Mitgliedschaft: Kostenloses und kostenpflichtiges Mitgliedschaftssystem
  • Newsletter: Integrierter E-Mail-Newsletter-Versand
  • Themes: Handlebars-basiertes Theme-System
  • API: REST-API für Headless-CMS-Nutzung

Systemanforderungen

  • Server mit Docker und Docker Compose
  • Mindestens 1 GB RAM (2 GB empfohlen)
  • MySQL 8.0 oder SQLite
  • Gültige Domain und SSL-Zertifikat

Docker-Installation

Production-Setup mit MySQL

hljs yaml
# docker-compose.yml
version: '3.8'

services:
  ghost:
    image: ghost:5-alpine
    container_name: ghost
    restart: unless-stopped
    depends_on:
      - db
    environment:
      database__client: mysql
      database__connection__host: db
      database__connection__user: ghost
      database__connection__password: starkes-passwort
      database__connection__database: ghost
      url: https://blog.example.com
      mail__transport: SMTP
      mail__options__host: smtp.mailgun.org
      mail__options__port: 587
      mail__options__auth__user: postmaster@mg.example.com
      mail__options__auth__pass: mailgun-api-key
      mail__from: noreply@example.com
    volumes:
      - ./ghost-content:/var/lib/ghost/content
    ports:
      - "127.0.0.1:2368:2368"

  db:
    image: mysql:8.0
    container_name: ghost-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: root-passwort
      MYSQL_DATABASE: ghost
      MYSQL_USER: ghost
      MYSQL_PASSWORD: starkes-passwort
    volumes:
      - mysql-data:/var/lib/mysql

volumes:
  mysql-data:
hljs bash
# Container starten
docker compose up -d

# Logs prüfen
docker logs ghost -f

Ghost erstellt die Datenbank beim ersten Start automatisch. Zugriff auf das Admin-Panel unter https://blog.example.com/ghost.

Nginx Reverse Proxy und SSL

hljs nginx
server {
    listen 80;
    server_name blog.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name blog.example.com;

    ssl_certificate /etc/letsencrypt/live/blog.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/blog.example.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1: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;
        proxy_buffering off;
    }
}

Mitgliedschaft und Abonnement

Settings → Membership
- Kostenlose Mitglieder erlauben: Aktiviert
- Bezahlte Abonnements: Über Stripe
- Standard-Beitragszugriff: Öffentlich / Nur Mitglieder / Bezahlt

Stripe-Integration

Settings → Membership → Stripe
1. Stripe-Konto erstellen
2. API-Schlüssel eingeben
3. Webhook-Endpoint hinzufügen:
   https://blog.example.com/members/webhooks/stripe

E-Mail-Newsletter

hljs yaml
environment:
  mail__transport: SMTP
  mail__options__service: Mailgun
  mail__options__host: smtp.mailgun.org
  mail__options__port: 587
  mail__options__auth__user: postmaster@mg.example.com
  mail__options__auth__pass: mailgun-smtp-password
  mail__from: "Blog Name <noreply@example.com>"

Sicherung

hljs bash
# Ghost-Inhaltsverzeichnis sichern
tar -czf ghost-backup-$(date +%Y%m%d).tar.gz ./ghost-content/

# MySQL-Datenbank-Backup
docker exec ghost-db mysqldump -u ghost -pstarkes-passwort ghost > \
  ghost-db-$(date +%Y%m%d).sql

Fazit

Ghost ist eine leistungsstarke, moderne Alternative zu WordPress für Content-Publishing. Mit Docker-Deployment auf REXE-Servern können Sie in wenigen Minuten eine produktionsreife Ghost-Instanz betreiben.