---
title: "Deploy Ghost"
description: "Professional publishing platform for blogs, newsletters, and memberships."
category: "CMS"
url: https://railway.com/deploy/ghost-2
---

# Deploy Ghost

Professional publishing platform for blogs, newsletters, and memberships.

**[Deploy Ghost on Railway](https://railway.com/template/ghost-2)**

- **Creator:** Agaz Self-Host
- **Category:** CMS

## Template content

### Ghost

- **Image:** ghost:6.54.0
- **Public domain:** Yes

### MySQL

- **Image:** mysql:8.4.4

## Documentation

# Deploy and Host Ghost on Railway

Ghost is a powerful open-source publishing platform built for professional creators. It combines a fast, minimalist CMS with native memberships, paid subscriptions, newsletters, and SEO tooling, letting bloggers, journalists, and publishers run and monetize a modern publication without the bloat of traditional CMSs.

## About Hosting Ghost

Hosting Ghost means running a Node.js application that serves your site on port 2368, backed by a MySQL 8 database — the only database Ghost supports in production. Ghost needs persistent storage for uploaded images, themes, and content files, plus a canonical `url` setting so it can generate correct links, RSS feeds, and sitemaps. On Railway, Ghost runs as one service with a persistent volume at `/var/lib/ghost/content`, connected over the private network to a MySQL 8.4 service with its own volume at `/var/lib/mysql`. Configuration is done entirely through environment variables — database connection, site URL, and mail — with no config files to manage. Railway handles TLS, the public domain, scaling, and restarts, so a production-grade Ghost deploy is a one-click operation.

## Common Use Cases

- Independent blogs and editorial publications with built-in SEO and newsletters
- Membership and paid-subscription sites monetizing premium content
- Documentation, changelog, or content hub for a product or company

## Dependencies for Ghost Hosting

- MySQL 8 (this template deploys `mysql:8.4.4`; Ghost requires MySQL 8 in production)
- Persistent volumes for Ghost content (`/var/lib/ghost/content`) and MySQL data (`/var/lib/mysql`)

### Deployment Dependencies

- [Ghost self-hosting documentation](https://ghost.org/docs/)
- [Ghost configuration reference (env vars)](https://ghost.org/docs/config/)
- [Ghost on Docker Hub](https://hub.docker.com/_/ghost) — official image (`ghost:6.54.0`)
- [Ghost source repository](https://github.com/TryGhost/Ghost)

### Implementation Details

- Two services: `Ghost` (image `ghost:6.54.0`) and `MySQL` (image `mysql:8.4.4`), each with a persistent volume.
- Ghost is configured entirely via environment variables: `database__client=mysql`, `database__connection__host=${{MySQL.RAILWAY_PRIVATE_DOMAIN}}` (private networking), `database__connection__user=root`, `database__connection__password=${{MySQL.MYSQL_ROOT_PASSWORD}}`, `database__connection__database=${{MySQL.MYSQL_DATABASE}}`, `url=https://${{Ghost.RAILWAY_PUBLIC_DOMAIN}}`, `security__staffDeviceVerification=false`.
- On first deploy, set the prompted variables: `MYSQL_ROOT_PASSWORD` (any strong random string; Ghost references it automatically), `MYSQL_DATABASE` (use `ghost`), `database__client` (`mysql`), `database__connection__user` (`root`), and `security__staffDeviceVerification` (`false`).
- A Railway-provided public domain targets Ghost's port `2368`; the admin panel is served at `/ghost`.
- Optional: add `mail__transport=SMTP` plus `mail__options__host`, `mail__options__port`, `mail__options__auth__user`, `mail__options__auth__pass`, and `mail__from` on the Ghost service to enable newsletters, magic links, and staff invites. Without mail config, Ghost sends no email.

## Why Deploy Ghost on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Ghost on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [Instatic CMS - Postgres](https://railway.com/deploy/instatic-cms-postgres) — Design, build and manage powerful static sites from state-of-the-art CMS

Open this page in a browser: https://railway.com/deploy/ghost-2
