← All templates · Websites and shops
Deploy Ghost in one click
A publishing platform for blogs and newsletters
A self-hosted alternative to Substack, Medium, and Patreon.
What is Ghost?
Ghost is an open-source blog and newsletter platform, often run as an alternative to Substack. Each post can go on the site, out to members by email, or both, and one site can run several newsletters. Readers sign up as free members or pay for monthly or yearly tiers through your own Stripe account. Ghost takes no cut, so only Stripe's fees apply. The design comes from a theme, and the marketplace has hundreds.
People self-host Ghost to keep the domain, the design and the member list in their own hands. It suits a personal blog, a paid newsletter or a small publication with a few writers. The catch is email: member sign-in links and staff invitations need an SMTP service, and newsletters need a Mailgun account.
Hosting Ghost on Pethost
- You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
- New project opens at Ghost, and you click Create project.
- In a minute or two Ghost is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
- It is a project like any other: you or your agent can change it, roll it back or restore it.
Questions about Ghost
Is Ghost free and open source?
Yes. Ghost is MIT-licensed and free to self-host. Ghost(Pro) is its official managed hosting, and that revenue goes to the Ghost Foundation, which maintains the project.
How do I move from Substack to Ghost?
Ghost Admin has a Substack migrator in Settings > Advanced > Import/Export. It brings over posts and free and paid subscribers from Substack's exports; paid ones need the same Stripe account. Guides cover WordPress, Medium and Patreon too.
Can several authors write on one Ghost site?
Yes. Contributors write drafts, Authors publish their own posts, Editors edit and publish anyone's posts and invite Contributors and Authors, and Administrators manage all settings, staff and members.
How do I set up email for self-hosted Ghost?
Put Ghost's mail__ variables for any SMTP service, such as mail__transport and mail__options__host, in the project's .env, then deploy again. Newsletters are separate: Ghost cannot send them over SMTP and uses Mailgun's API instead.
Can I export my members and posts from Ghost?
Yes, at any time. Settings > Advanced > Import/Export in Ghost Admin exports members with their labels and subscription status as a CSV, and posts, pages, tags, tiers and settings as JSON.
How much memory and disk does Ghost need?
Ghost is moderate: about 800 MB with its MySQL, and years of posts and images take a few gigabytes. On Pethost the Starter plan is enough for it, with room for other apps beside it.
Ghost Docker Compose file
The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.
Containers: ghost (ghost:6-alpine), db (mysql:8.4).
Volumes, in the nightly backup: content, db.
services:
ghost:
image: ghost:6-alpine
restart: unless-stopped
depends_on:
db:
condition: service_healthy
# Mail settings (mail__transport, mail__options__host, ...) go into .env.
env_file: .env
environment:
url: ${URL}
server__host: 0.0.0.0
database__client: mysql
database__connection__host: db
database__connection__user: ghost
database__connection__password: ${DB_PASSWORD}
database__connection__database: ghost
# Ghost emails a code to every new device that signs in. Without mail
# that locks the owner out, so it is off. Remove this line once mail works.
security__staffDeviceVerification: "false"
volumes:
- content:/var/lib/ghost/content
db:
image: mysql:8.4
restart: unless-stopped
environment:
MYSQL_DATABASE: ghost
MYSQL_USER: ghost
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- db:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$$MYSQL_ROOT_PASSWORD --silent"]
interval: 5s
timeout: 5s
retries: 12
start_period: 60s
volumes:
content:
db:
More in Websites and shops
- WordPressA website and blog builder with themes and plugins
- GravA flat-file CMS: a fast website or blog with an admin panel and no database
- JoomlaThe open-source CMS for websites, with several languages, access levels and thousands of extensions
- Spree CommerceAn open-source e-commerce platform: products, orders, payments and a headless API for any storefront