Deploy railway-ghost
Self-hosted Ghost CMS blog — powerful open-source publishing platform.
railway-ghost
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host
Canonical code:
railway-ghost— deploy URL: https://railway.com/new/template/railway-ghost
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
nodeuser inside the container - One-click deploy — No local setup required
Architecture
Railway Container
├── Ghost 6 (Alpine) → PORT, healthcheck
└── PostgreSQL (Railway-managed) → content, users, settings
- Railway builds the Ghost image and provisions PostgreSQL
- Environment variables (url, database config) are injected at runtime
- Ghost connects to Postgres and serves on the Railway-assigned PORT
- Health check monitors
/ghost/api/admin/
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
url | Yes | — | Public URL of your Ghost instance |
DATABASE_URL | Yes | Auto | PostgreSQL connection (Railway auto-injects) |
database__client | No | postgres | Database client type |
mail__transport | No | direct | Email transport: smtp, direct, mailgun |
MAIL_OPTIONS_HOST | No | — | SMTP host (if mail__transport=smtp) |
MAIL_OPTIONS_PORT | No | 587 | SMTP port |
MAIL_OPTIONS_AUTH_USER | No | — | SMTP username |
MAIL_OPTIONS_AUTH_PASS | No | — | SMTP password |
Getting Started
- Click Deploy on Railway above.
- Add a PostgreSQL service from the Railway marketplace.
- Set
urlto match your Railway domain (e.g.,https://your-app.up.railway.app). - Deploy — Ghost starts in ~60s on first build.
- Visit your URL at
/ghostto create your admin account.
Troubleshooting
| Issue | Solution |
|---|---|
| App not starting | Verify DATABASE_URL is set and Postgres is running |
| Health check fails | First deploy may take 2–3 minutes; retry |
White screen at /ghost | Verify url matches your full Railway domain |
| SMTP not sending | Switch mail__transport to smtp with proper credentials |
License
MIT. Ghost upstream is MIT-licensed. Template by INAPP-Mobile.
Template Content
railway-ghost
ghost:6-alpinePGDATA
PGPORT
POSTGRES_DB
POSTGRES_USER
SSL_CERT_DAYS
RAILWAY_DEPLOYMENT_DRAINING_SECONDS