Railway

Deploy railway-ghost

Self-hosted Ghost CMS blog — powerful open-source publishing platform.

Deploy railway-ghost

railway-ghost

ghost:6-alpine

Just deployed

/var/lib/postgresql/data

Deploy and Host

Deploy on Railway

Canonical code: railway-ghost — deploy URL: https://railway.com/new/template/railway-ghost

OG Image

Deploy a self-hosted Ghost CMS blog on Railway in one click. Ghost is a powerful, open-source publishing platform used by creators and startups worldwide.

About Hosting

Ghost runs as a single container with a Railway-managed PostgreSQL database for content storage. Railway provides the compute, TLS at the edge, and a public URL. The service restarts automatically on failures via Railway's built-in health check. Content is stored in PostgreSQL — no persistent volume needed for the core deployment.

Why Deploy

  • Professional blogging platform — Ghost powers thousands of publications with a clean, fast editor and modern theme system.
  • Managed PostgreSQL — Railway handles database provisioning, backups, and connection strings automatically.
  • Built-in membership & subscriptions — Turn readers into paying members with native Stripe integration.
  • SEO optimized — Clean URLs, automatic sitemaps, structured data, and fast page loads out of the box.
  • REST API — Full content API for headless CMS use cases and custom frontends.
  • Zero-config deploy — One click and Ghost is running with sensible production defaults.

Common Use Cases

  • Personal blog — Start writing immediately with the distraction-free editor.
  • Membership site — Publish premium content behind a paywall with Stripe subscriptions.
  • Company blog — Share product updates, changelogs, and engineering posts.
  • Newsletter — Built-in email newsletter delivery to subscribers.
  • Headless CMS — Use the Content API to power a custom frontend or mobile app.

Dependencies for Ghost

Deployment Dependencies

Ghost requires a PostgreSQL database. Add a Railway PostgreSQL service to your project — the connection string is auto-injected via DATABASE_URL. For email delivery, configure SMTP via environment variables (Mailgun recommended).


Features

  • Single container — Ghost 6 Alpine image, no sidecars needed
  • Managed PostgreSQL — Railway provisions and manages your database
  • Health check endpoint/ghost/api/admin/ monitored by Railway
  • Non-root user — Runs as the node user inside the container
  • One-click deploy — No local setup required

Architecture

Railway Container
  ├── Ghost 6 (Alpine) → PORT, healthcheck
  └── PostgreSQL (Railway-managed) → content, users, settings
  1. Railway builds the Ghost image and provisions PostgreSQL
  2. Environment variables (url, database config) are injected at runtime
  3. Ghost connects to Postgres and serves on the Railway-assigned PORT
  4. Health check monitors /ghost/api/admin/

Environment Variables

VariableRequiredDefaultDescription
urlYesPublic URL of your Ghost instance
DATABASE_URLYesAutoPostgreSQL connection (Railway auto-injects)
database__clientNopostgresDatabase client type
mail__transportNodirectEmail transport: smtp, direct, mailgun
MAIL_OPTIONS_HOSTNoSMTP host (if mail__transport=smtp)
MAIL_OPTIONS_PORTNo587SMTP port
MAIL_OPTIONS_AUTH_USERNoSMTP username
MAIL_OPTIONS_AUTH_PASSNoSMTP password

Getting Started

  1. Click Deploy on Railway above.
  2. Add a PostgreSQL service from the Railway marketplace.
  3. Set url to match your Railway domain (e.g., https://your-app.up.railway.app).
  4. Deploy — Ghost starts in ~60s on first build.
  5. Visit your URL at /ghost to create your admin account.

Troubleshooting

IssueSolution
App not startingVerify DATABASE_URL is set and Postgres is running
Health check failsFirst deploy may take 2–3 minutes; retry
White screen at /ghostVerify url matches your full Railway domain
SMTP not sendingSwitch mail__transport to smtp with proper credentials

License

MIT. Ghost upstream is MIT-licensed. Template by INAPP-Mobile.


Template Content

railway-ghost

ghost:6-alpine

More templates in this category

View Template
caring-vibrancy
Deploy and Host caring-vibrancy with Railway

4
View Template
Flask WebSocket Chat
Single file, realtime multi-user websocket chat using flask-socketio

Clement Ochieng
3
View Template
all-star-fashion-template
Deploy and Host all-star-fashion-template with Railway

Mai Thành Duy An
0