Self-host Ghost
Publishing platform for blogs, newsletters and paid memberships, written in Node.js. Run your own Ghost on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.
Updated November 23, 2026
Running your own Ghost usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Ghost behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.
Just ask your agent
Open a Plus workspace (Ghost runs in Docker, which Plus and Pro include), tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:
Set up Ghost on this workspace and give me the link. Follow https://envhaven.com/self-host/ghost.md
Then open the link it sends and create your Ghost account straight away, before anyone else finds the address. That is the whole request: the address in it is this page’s Markdown copy, and the agent follows the instructions for it further down, with every setting Ghost’s docs require.
Or keep it private with Tailscale
The preview URL puts Ghost on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Ghost an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace’s Vars pane as TS_AUTHKEY, and ask the agent:
Set up Ghost on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/ghost.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
- A Tailscale container runs beside Ghost, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
- Anything other services have to reach, such as a webhook, still needs a public address. Keep self-hosted apps private with Tailscale covers both, and what Tailscale’s free plan includes.
| At a glance | |
|---|---|
| What it is | Sites, CRM and business |
| License | MIT |
| Runs as | Docker (ghost) |
| Memory | At least 1 GB of memory on the server (Ubuntu route); the Docker guide’s example server is 2 GB and 1 CPU (docs) |
| Plan that fits | Plus or larger |
| Web port | 2368 |
| Documentation | docs.ghost.org/install/ubuntu |
What your agent takes care of
- Installing it. Ghost runs from the official image,
ghost, with its data in folders under~/apps/ghost. - Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
- Locking it down first. What Ghost’s docs say to set before it faces the internet, below.
- Telling you what to back up: content folder: /var/lib/ghost/content in Docker (host path ./data/ghost by default), content/ in a Ghost-CLI install and MySQL data: ./data/mysql on the host in the Docker compose file (docs).
The settings it needs behind a proxy
- url (config.json, or the url environment variable): The exact public URL, with https when SSL is used; a path is allowed. IP addresses are rejected. (docs)
- DOMAIN (Docker .env): The site’s domain; Caddy uses it for routing and certificates. (docs)
ADMIN_DOMAIN(Docker .env, optional): A separate host name for the admin panel. (docs)admin.url(config.json): Different protocol or host for the admin panel; the path stays /ghost/. (docs)server.hostandserver.port(config.json): Address and port Ghost listens on; a proxy forwards to it. (docs)
Before it faces the internet
- Setup is completed in the admin panel at /ghost; open it right after the first start, before the address is shared. (docs)
- Use random database passwords. (docs)
- The root MySQL user needs a password because Ghost does not support socket authentication. (docs)
- Ghost-CLI can create a limited MySQL user. (docs)
- Run it with SSL in production. (docs)
Things to ask next
Everything after the install is one more sentence to the agent. Some that come up:
- “Set the site’s name, logo and colors from the files I dropped into the workspace.”
- “Create my first admin user and a second one with fewer rights.”
- “Move Ghost to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to
domains.envhaven.app, and the agent changes Ghost’s address settings to match. - “Update Ghost to the latest release.” It pulls the new image and recreates the container, data kept.
Instructions for the agent
The agent reads these from the page’s Markdown copy. They also work pasted on their own, if you would rather give them in your own words.
Set up Ghost on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghost, starting from the docs' compose file: https://github.com/TryGhost/ghost-docker/blob/main/compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: MySQL 8 (mysql:8.0.46 in the compose file); Caddy as web server and TLS proxy.
- Keep the compose file in ~/apps/ghost and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Ghost's port 2368.
- The preview URL terminates HTTPS in front of Ghost: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/ghost.md for the preview URL, as Ghost's docs describe for running behind a proxy; skip any that apply only when Ghost serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/ghost.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Ghost up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.
What to know
- In Docker, Ghost’s containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
- Transactional mail (staff invites, password resets, member sign-in links) needs an SMTP service configured; the Docker guide lists one as a prerequisite. (docs)
- Docker prerequisite for mail. (docs)
- Without SSL, sign-in credentials travel in plaintext. (docs)
- The Ghost-CLI install cannot self-host web analytics or the full ActivityPub service; the Docker route is needed for them. (docs)
- Web analytics needs an external Tinybird account. (docs)
- Several features contact external services by default and can be turned off. (docs)
- The Ubuntu route sets up SSL during install, so DNS must already point at the server. (docs)
- A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.
Without a workspace
The manual route, on a server you run:
- Rent a Linux VPS, secure SSH, and create a user for the app.
- Install Docker and write a compose file from the official image.
- Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
- Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
- Keep the firewall closed except for the proxy, and schedule backups and updates.
Ghost’s own documentation covers each step for its install methods.
Sources
Facts about Ghost come from its own documentation, checked on 2026-11-23: