How to self-host Ghost on a VPS: Docker, MySQL, email and backups
Self-host Ghost 6 on a VPS with the official Docker setup, MySQL, HTTPS, SMTP and Mailgun for newsletters, backups and updates, plus a ZoPanel route.

Key takeaways
- For a new blog, self-host Ghost 6; Ghost lists 5.x as end of life since January 2026.
- Ghost officially supports MySQL 8 in production, and its new Docker tooling bundles Ghost, MySQL and Caddy for HTTPS.
- SMTP sends logins, invitations and password resets, but newsletters need Mailgun.
- Back up the MySQL database and the content folder together; Ghost's JSON export does not include images or themes.
To self-host Ghost in 2026, install Ghost 6 on a VPS with at least 1 GB of RAM (2 GB is more comfortable), either with Ghost's official Docker Compose tooling, which runs Ghost, MySQL 8 and Caddy for automatic HTTPS, or with Ghost-CLI on Ubuntu with nginx and MySQL. Add an SMTP account for logins and staff invitations, and a Mailgun account if you want to send newsletters, because Ghost uses Mailgun for bulk email. ZoPanel's App Store also installs Ghost in one click, but it runs Ghost 5 on SQLite, which suits a private or small blog better than a new public publication.
This guide covers what changed in Ghost 6, what it costs compared with Ghost(Pro), the official Docker install, email, the ZoPanel route, backups and updates.
What is Ghost?
Ghost is an open-source publishing platform for blogs, magazines and newsletters, with a fast editor, themes, built-in member sign-ups and paid subscriptions. It is a Node.js application released under the MIT licence. At the time of writing (October 2026) the latest release is v6.72.0 from 20 October 2026; Ghost ships new 6.x releases roughly every week.
According to Ghost's hosting documentation, Ghost 6.0 added two major features, ActivityPub (your publication joins the social web) and web analytics, each built as a separate open-source service that self-hosters can run or connect to.
Ghost 5 or Ghost 6?
| Version | Released | End of life (per Ghost) |
|---|---|---|
| Ghost 5.x | 2022 | January 2026 |
| Ghost 6.x | 2025 | Current, not set |
Ghost's major versions page says that once a version reaches end of life "it should be considered insecure". The last 5.x release on GitHub is v5.130.6, from 8 January 2026. Start a new site on Ghost 6.
Self-hosted Ghost vs Ghost(Pro): cost
Ghost(Pro) is the managed service run by the Ghost Foundation. Prices below are from ghost.org/pricing at the time of writing (October 2026), per month and billed yearly.
| Self-hosted Ghost | Ghost(Pro) Starter | Ghost(Pro) Publisher | Ghost(Pro) Business | |
|---|---|---|---|---|
| Price | $0 software + VPS + Mailgun | $18/month | $29/month | $199/month |
| Members | Unlimited | 1,000 | 1,000 | Higher tiers, see pricing page |
| Staff users | Unlimited | 1 | 3 | 15 |
| Custom themes | Yes | No | Yes | Yes |
| Updates, backups, email delivery | You | Ghost | Ghost | Ghost |
Ghost(Pro) prices rise with your member count, while a self-hosted Ghost costs the same whether you have 100 or 10,000 members, apart from your email provider's bill. Ghost(Pro) also funds Ghost's development, includes newsletter delivery and needs no maintenance. If you are not comfortable running a server, it is a fair choice.
What do you need to self-host Ghost?
From Ghost's documentation:
- A server with at least 1 GB of memory. Ghost's Docker guide uses a 2 GB, 1 CPU droplet as its example.
- For Ghost-CLI: Ubuntu 22.04, 24.04 or 26.04, Node.js 22 LTS, MySQL 8.0 or 8.4, nginx and systemd.
- For Docker: Docker 20.10.13 or newer. Ghost calls the Docker method "brand new" and a preview, but says it is moving towards Docker Compose tooling instead of updating Ghost-CLI.
- A domain with an A record pointing to the server (how to point a domain to a VPS).
- An SMTP service for transactional email, and Mailgun for newsletters.
Option 1: Self-host Ghost 6 with the official Docker tooling
This is Ghost's own Docker install. Use a VPS without another web server on ports 80 and 443, because Caddy takes them to issue certificates.
Step 1: Get the tooling and configure it
sudo git clone https://github.com/TryGhost/ghost-docker.git /opt/ghost && cd /opt/ghost
sudo cp .env.example .env
sudo cp caddy/Caddyfile.example caddy/Caddyfile
openssl rand -hex 32 # run twice: one for each database password
sudo nano .env
In .env, set DOMAIN, DATABASE_ROOT_PASSWORD and DATABASE_PASSWORD, and fill in the SMTP block:
mail__transport=SMTP
mail__options__host=smtp.example.com
mail__options__port=465
mail__options__secure=true
mail__options__auth__user=blog@example.com
mail__options__auth__pass=your-password
mail__from="'Example Blog' <blog@example.com>"
The example file warns that database settings must not be changed once the database is initialised, so pick strong passwords now. In caddy/Caddyfile, uncomment the block that matches your setup (for example a www redirect).
Step 2: Start it
sudo docker compose pull
sudo docker compose up -d
The stack runs Ghost (image ghost:6-alpine), MySQL 8 and Caddy. Open https://your-domain/ghost straight away and create the owner account: the first person to reach that page becomes the site owner.
ActivityPub works out of the box through Ghost's hosted service, within limits of 2,000 followers, 2,000 following and 100 interactions a day. Above that, or to keep it on your server, enable the activitypub profile in .env. Web analytics need a Tinybird account and the analytics profile.
Email: SMTP for logins, Mailgun for newsletters
Ghost sends two kinds of email, and it is the most common source of confusion:
| Email type | Examples | What sends it |
|---|---|---|
| Transactional | Staff invitations, password resets, member sign-in and sign-up links | Any SMTP server you configure |
| Bulk | Newsletters to all members | Mailgun, which Ghost's mail docs call "required for bulk mail" |
Without SMTP, members cannot sign in (sign-in uses emailed links) and you cannot reset a forgotten password. Without Mailgun, you can publish but cannot send newsletters. Enter the Mailgun domain and API key under Ghost Admin's newsletter settings. For good inbox placement, set SPF, DKIM and DMARC on the sending domain; see why email goes to spam.
Option 2: Ghost with ZoPanel (one click)
ZoPanel's App Store installs Ghost in a container (full guide). Be clear about what you get: Ghost 5 (ghost:5-alpine) with a SQLite database. Ghost officially supports only MySQL 8 in production; with SQLite, the official image runs Ghost in development mode. ZoPanel uses SQLite because app containers cannot reach the server's own MySQL. It works for a single blog with moderate traffic, but given Ghost 5's end-of-life status, we suggest the Ghost 6 route above for a new public publication.
If it fits your case (an internal blog, a test site, an existing Ghost 5 site):
- Point the domain's A record to the server. If you use a mailbox on the same server, create it first under Email.
- Open App Store and click Install on the Ghost card.
- Enter the Domain and, optionally, SMTP server, SMTP port (587 or 465), SMTP user name, SMTP password and Sender address. These can only be set at install time; changing them later means reinstalling on the same domain, which keeps the content.
- Leave Free SSL (Let's Encrypt) on and click Install. The first start takes one to two minutes.
The setup lock. The first person to open Ghost's setup page becomes the owner, so ZoPanel keeps a new install private:
- Check the SSL tab: the certificate must be issued, because Ghost only works on
https://. - On the Docker tab, click Open the app (only for me).
- Go to
https://<domain>/ghostand fill in the site title, name, email and a password of at least 10 characters. - Back on the Docker tab, click Setup finished — open to everyone.
ZoPanel runs it with a 768 MB memory limit, and Update to latest stays within Ghost 5. Newsletters still need Mailgun; the container can reach Mailgun's API over the internet.
Backing up Ghost
A complete backup is the database plus the content folder (images, themes, files).
Docker install:
cd /opt/ghost
sudo docker compose exec -T db sh -c 'mysqldump -u root -p"$MYSQL_ROOT_PASSWORD" ghost' > /root/ghost-$(date +%F).sql
sudo tar czf /root/ghost-content-$(date +%F).tar.gz -C /opt/ghost/data ghost
Copy both files off the server, and keep .env somewhere safe, since it holds the database and SMTP passwords. Ghost Admin's export (Settings, JSON) is a useful second copy of posts and settings, but it does not include images or themes.
ZoPanel: Ghost's data is not part of account backups. Use the Backups card on the Docker tab (Back up now; administrators can schedule daily or weekly copies). The container is paused for a few seconds so the SQLite file is consistent. More in website backup strategy.
Updating Ghost
With the Docker tooling, Ghost's documented update is:
cd /opt/ghost
sudo git pull && sudo docker compose pull && sudo docker compose up -d
Back up first: Ghost migrates its database when it starts. Pinning GHOST_VERSION in .env is possible, but Ghost notes that the update commands then stop working until you change it.
Conclusion
Self-hosting Ghost is cheaper than Ghost(Pro) once your list grows, but you take on three jobs: running MySQL, keeping Ghost updated on its weekly cadence, and getting email right with SMTP and Mailgun. For a new public publication, start on Ghost 6 with Ghost's Docker tooling on its own VPS. If you want a blog next to other sites and apps on one server, ZoPanel's Free plan includes the App Store and WordPress hosting; compare options in our WordPress install guide and see pricing.
curl -fsSL https://get.zopanel.net | sudo bash
Frequently asked questions
Is it free to self-host Ghost?
Yes. Ghost is MIT-licensed and the self-hosted version has no licence fee or member limit. You pay for the server and for your email provider, such as Mailgun for newsletters.
Can Ghost send newsletters over SMTP?
No. Ghost uses SMTP for transactional email such as sign-in links and invitations, and its documentation says Mailgun is required for bulk mail. Self-hosted newsletters therefore need a Mailgun account.
How much RAM does Ghost need?
Ghost's documentation asks for a server with at least 1 GB of memory, and its Docker guide uses a 2 GB server as the example. With MySQL and Caddy on the same VPS, 2 GB gives more headroom.
Can I run Ghost with SQLite instead of MySQL?
Ghost supports only MySQL 8 in production. SQLite runs Ghost in development mode, which works for a small blog but is not the officially supported setup.
Ghost or WordPress?
Ghost is focused on publishing and paid newsletters, with members and subscriptions built in and fewer plugins to maintain. WordPress has a much larger plugin and theme ecosystem and fits shops, directories and complex sites. If newsletters are the core of the project, Ghost is the simpler fit.
Install ZoPanel free
One command on a fresh Ubuntu or Debian server. Up and running in minutes.
Install in 5 minutesKeep reading

How to run Docker apps securely on a VPS: 9 things to get right
Run Docker apps securely on a VPS - localhost-only ports, user namespaces, memory limits, network isolation and SSL - with sample configs and the ZoPanel way.

How to self-host Flowise on a VPS in 2026, and what its sunset means
Self-host Flowise on a VPS with Docker and HTTPS, protect API keys, back up flows, and understand the project's August 2026 end of life before you build on it.

How to self-host Metabase on a VPS: Docker, PostgreSQL and a read-only user
Self-host Metabase on a VPS with Docker, a PostgreSQL app database, HTTPS, a read-only database user, memory settings and backups, or use ZoPanel.