---
title: "Deploy Ghost on Pethost in one click"
description: "A publishing platform for blogs and newsletters. A template for Pethost: in a minute or two the app is live on your machine, with HTTPS at its own address and nightly backups."
---

[← All templates](https://pethost.dev/templates/)

# Deploy Ghost on Pethost in one click

A publishing platform for blogs and newsletters

[Deploy on Pethost](https://console.pethost.dev/?template=ghost)

## What happens

1. You sign in to Pethost or make an account, with a passkey, GitHub or Google.
2. No machine yet? You pick a plan, and we prepare one for you. The link waits in your browser until it is ready.
3. New project opens at the app, and you click Create project.
4. In a minute or two the app is live at its own address with HTTPS. Its secrets are made for it at random, and its data is in the nightly backup.
5. It is a project like any other: its compose.yaml, its .env, its logs and a terminal are in the panel, and your agent can change it, roll it back or restore it.

## First steps

Create the owner account at /ghost; the first start takes about a minute. Do it right away: until then the page is open to whoever has the address. Email works after you add Ghost’s mail__ variables to the project’s .env and deploy again.

## What it runs

The template is this compose.yaml and the variables it writes into the project’s .env. Pethost runs the file as it is written.

```
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:
```

[compose.yaml](https://pethost.dev/templates/ghost/compose.yaml)[See it on GitHub](https://github.com/pethost-dev/templates/tree/main/ghost)

Pethost · Stephan Gomer · NIP 1133096755

[Templates](https://pethost.dev/templates/) [About](https://pethost.dev/about/) [Blog](https://pethost.dev/blog/) [Terms](https://pethost.dev/terms/) [Privacy](https://pethost.dev/privacy/) [Refunds](https://pethost.dev/refunds/) [API](https://pethost.dev/docs/api/) [CLI](https://pethost.dev/docs/cli/) [Plugin](https://github.com/pethost-dev/plugin) [support@pethost.dev](mailto:support@pethost.dev)
