---
title: "Deploy BookStack on Pethost in one click"
description: "A wiki organised as shelves, books, chapters and pages. 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 BookStack on Pethost in one click

A wiki organised as shelves, books, chapters and pages

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

## 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. You fill in what it asks for and click Create project: **Email**, **Admin password**.
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

Sign in with the email and the admin password you gave, at least 8 characters: the template gives them to BookStack’s first admin, so the stock admin@admin.com never signs in. Uploads and settings are kept in /config.

## 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:
  bookstack:
    image: lscr.io/linuxserver/bookstack:v26.09.1-ls288
    restart: unless-stopped
    environment:
      PUID: "1000"
      PGID: "1000"
      APP_URL: ${URL}
      APP_KEY: ${APP_KEY}
      DB_HOST: mariadb
      DB_PORT: "3306"
      DB_DATABASE: bookstack
      DB_USERNAME: bookstack
      DB_PASSWORD: ${DB_PASSWORD}
      ADMIN_EMAIL: ${ADMIN_EMAIL}
      ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    # BookStack's migrations make admin@admin.com with the password "password". A script of the
    # image's custom-init step, which runs after the migrations and before the web server starts,
    # gives that account the email and password given; once it is changed, the command leaves it.
    entrypoint:
      - sh
      - -c
      - |
        mkdir -p /custom-cont-init.d
        cat > /custom-cont-init.d/10-admin <<'SH'
        #!/usr/bin/with-contenv sh
        cd /app/www && php artisan bookstack:create-admin --initial --no-interaction --name=Admin --email="$$ADMIN_EMAIL" --password="$$ADMIN_PASSWORD"
        SH
        chmod 755 /custom-cont-init.d/10-admin
        exec /init
    depends_on:
      mariadb:
        condition: service_healthy
    volumes:
      - config:/config
  mariadb:
    image: lscr.io/linuxserver/mariadb:11.8.8-r0-ls235
    restart: unless-stopped
    environment:
      PUID: "1000"
      PGID: "1000"
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      MYSQL_DATABASE: bookstack
      MYSQL_USER: bookstack
      MYSQL_PASSWORD: ${DB_PASSWORD}
    healthcheck:
      test: ["CMD-SHELL", "mariadb-admin ping -h 127.0.0.1 -u bookstack -p\"$$MYSQL_PASSWORD\" --silent"]
      interval: 5s
      retries: 30
    volumes:
      - db:/config
volumes:
  config:
  db:
```

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

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)
