English
Get started
← All templates

Deploy BookStack on Pethost in one click

A wiki organised as shelves, books, chapters and pages

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 [email protected] 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 [email protected] 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: