Deploy BookStack | (Just Updated) Wiki With REST API, Admin and API Token Generated

BookStack wiki + MariaDB, admin and API token generated, no setup needed

Deploy BookStack | (Just Updated) Wiki With REST API, Admin and API Token Generated

Just deployed

/var/lib/mysql

Just deployed

/config

Deploy and Host BookStack on Railway

BookStack is the open-source wiki that organises documentation as shelves, books, chapters and pages, with a full REST API. This template deploys BookStack with its own MariaDB database, a persistent volume, and everything an AI agent needs already generated - nothing to fill in, no browser step, no default password left behind.

Easy for an LLM agent to use. There is no manual deploy step: deploy, read the variables below, and call the API. The admin login and a working API token pair are generated at deploy time (BookStack's well-known admin@admin.com / password is replaced on first boot), the contract block below lists every URL and variable name, and one curl against /api/books works as soon as the service is healthy.

About Hosting BookStack

Two services run in one Railway project:

  • bookstack - the linuxserver/bookstack image (pinned by digest: nginx, PHP-FPM, queue worker and cron in one container). The uploads, images, themes and config live on a volume mounted at /config.
  • mariadb - the official mariadb image (pinned by digest) on its own volume. The data directory is a subfolder of the mount, so the filesystem's lost+found never lands inside it. The database password is generated and wired into BookStack over the private network.

On first boot the start command derives a valid Laravel APP_KEY (base64: plus 32 bytes) from a generated seed, waits for MariaDB, lets BookStack run its migrations, then a boot step (a) rewrites the default admin with the generated email and password and (b) creates the API token pair in the database. On every later boot the same step finds both already in place and changes nothing, so redeploys are safe.

Agent contract

  • Base URL: https:// (also in variable APP_URL)
  • Health path: GET /status - unauthenticated, returns {"database":true,"cache":true,"session":true}
  • Admin login (/login): email in BOOKSTACK_ADMIN_EMAIL, password in BOOKSTACK_ADMIN_PASSWORD
  • API token id: BOOKSTACK_API_TOKEN_ID, token secret: BOOKSTACK_API_TOKEN_SECRET (admin role, expires in 100 years)
  • API header: Authorization: Token :
  • API reference: /api/docs (after logging in)
  • Database (private network only): service mariadb, host in DB_HOST, password in DB_PASSWORD, database and user bookstack
  • Generated variables, all on the bookstack service: BOOKSTACK_KEY_SEED, BOOKSTACK_ADMIN_PASSWORD, BOOKSTACK_API_TOKEN_ID, BOOKSTACK_API_TOKEN_SECRET

One working call:

curl -s https:///api/books \
  -H "Authorization: Token $BOOKSTACK_API_TOKEN_ID:$BOOKSTACK_API_TOKEN_SECRET"
# {"data":[],"total":0}

Create a book and a page:

curl -s https:///api/books -X POST \
  -H "Authorization: Token $BOOKSTACK_API_TOKEN_ID:$BOOKSTACK_API_TOKEN_SECRET" \
  -H 'content-type: application/json' -d '{"name":"Runbooks","description":"Team runbooks"}'

Why Deploy BookStack on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying BookStack on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

  • No default credentials - the stock admin@admin.com / password account is rewritten on first boot; the generated password is in your variables.
  • API token ready - a token pair is created at boot, so an agent can read and write the wiki without opening the UI.
  • Zero configuration - no variable asks you for anything; APP_URL follows the public domain and the database is wired automatically.
  • Data survives redeploys - uploads, images and the database each sit on a volume, verified with a write, a redeploy and a read.

Common Use Cases

  • Agent memory and knowledge base - let an LLM agent write structured notes and look them up through the REST API.
  • Team documentation and runbooks - a Confluence alternative with shelves, books, chapters, search and permissions.
  • Internal handbooks and onboarding - a wiki non-technical colleagues can edit in a visual or Markdown editor.

Dependencies for BookStack Hosting

  • A volume at /config on the bookstack service and a volume at /var/lib/mysql on the mariadb service (both included in this template).

Deployment Dependencies


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
Complete self-hosted omnichannel customer support desk.

codestorm
2
View Template
Paperless-ngx
Paperless-ngx — document management with OCR and full-text search

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
170