Deploy Outline | (Just Updated) Notion Alternative Team Wiki, Admin Login Pre-Created, No S3 Needed
Outline team wiki and knowledge base, a Notion alternative, login included
Just deployed
/var/lib/outline/data
database
Just deployed
/var/lib/postgresql
cache
Just deployed
/data
Deploy and Host Outline on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the administrator login, the secrets and the database credentials are generated, a sign-in provider is already wired in, attachments are stored on a volume so no S3 bucket is needed, and nobody else can register. Outline is an open-source team knowledge base and wiki with nested collections, real-time collaboration, Markdown, search and a full API, a self-hosted alternative to Notion and Confluence.
About Hosting Outline
This template runs three services: outline, the official outlinewiki/outline image (release 1.13.0) pinned by digest through a thin wrapper, with a volume at /var/lib/outline/data for uploaded files; database, a PostgreSQL 17 instance with a volume at /var/lib/postgresql; and cache, a Redis instance with a volume at /data. One public domain serves Outline on port 8080, with an HTTP healthcheck at /_health that turns green only after the database migrations ran and both the app and its sign-in provider answer.
What the wrapper fixes. Outline has no password sign-in: it needs an OpenID Connect provider or an e-mailed magic link, so a stock deploy cannot be signed in to until someone configures one, and the most used Railway listing also leaves the S3 settings blank. The wrapper bundles Dex (release 2.46.1, pinned by digest) as the provider with one static account whose e-mail and password are ADMIN_EMAIL and ADMIN_PASSWORD (stored as a bcrypt hash computed at boot), runs the database migrations, and opens one public port: /dex goes to Dex, everything else to Outline, websockets included. Dex has no registration page, so no stranger can create an account. The first sign-in with the generated login creates the workspace and makes that account its administrator. Redeploys keep the account, the documents and the uploads.
Using it. Open your domain, press the sign-in button and enter the administrator e-mail and password. Create an API key under Settings, API, or through the API as below, and an agent can create and read documents with it. E-mail notifications, Slack and other integrations are not configured; set their variables on the outline service if you need them.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of theoutlineservice) - Private URL:
http://outline.railway.internal:8080 - Credentials: the variables
ADMIN_EMAILandADMIN_PASSWORDon theoutlineservice (plain text); the Outline API key is created after sign-in - Auth:
GET /auth/oidcleads to the Dex form, which takesloginandpasswordand ends in Outline with session cookies; on writes made with the cookie session send the__Host-csrfTokencookie value in anx-csrf-tokenheader;POST /api/apiKeys.createreturns a key to send asAuthorization: Bearer KEYon every/apicall, which answers 401 without it - Health:
GET /_healthreturns 200 without credentials
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_EMAIL, ADMIN_PASSWORD (variables of the outline service); also curl, jq.
R="https://$RAILWAY_PUBLIC_DOMAIN"; H="content-type: application/json"; JAR=$(mktemp)
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/_health")" = 200 ]; do n=$((n+1)); [ "$n" -le 90 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/_health"
# sign-in goes through the bundled Dex login: following /auth/oidc lands on the Dex form, whose URL is also where the form posts
FORM=$(curl -s -c "$JAR" -b "$JAR" -L -o /dev/null -w '%{url_effective}' "$R/auth/oidc")
# Dex has no registration: any identity other than the generated account is refused
NOPE="not-the-real-one-1"
curl -s -o /dev/null -w "public signup: %{http_code}\n" --data-urlencode "login=stranger@example.com" --data-urlencode "password=$NOPE" "$FORM"
curl -s -o /dev/null -w "wrong login: %{http_code}\n" --data-urlencode "login=$ADMIN_EMAIL" --data-urlencode "password=$NOPE" "$FORM"
# the generated login: the redirects end in Outline with a session cookie, and the first sign-in creates the workspace
curl -s -c "$JAR" -b "$JAR" -L -o /dev/null -w "login: %{http_code}\n" --data-urlencode "login=$ADMIN_EMAIL" --data-urlencode "password=$ADMIN_PASSWORD" "$FORM"
# over HTTPS the cookie is named __Host-csrfToken; its value goes back in the x-csrf-token header on writes made with the cookie session
CSRF=$(awk '$6 ~ /csrfToken$/{print $7}' "$JAR")
echo "role: $(curl -s -b "$JAR" -X POST -H "$H" -H "x-csrf-token: $CSRF" "$R/api/auth.info" | jq -r '.data.user.role')"
# an API key for the agent: Bearer KEY authenticates every /api call after this
KEY=$(curl -s -b "$JAR" -H "$H" -H "x-csrf-token: $CSRF" -d '{"name":"agent"}' "$R/api/apiKeys.create" | jq -r '.data.value')
COL=$(curl -s -H "authorization: Bearer $KEY" -H "$H" -d '{}' "$R/api/collections.list" | jq -r '.data[0].id')
BODY=$(jq -nc --arg c "$COL" '{title:"hello",text:"from an agent",collectionId:$c,publish:true}')
# write-auth: POST /api/documents.create needs the key; without it, or with a wrong one, the answer is 401
curl -s -o /dev/null -w "write with key: %{http_code}\n" -H "authorization: Bearer $KEY" -H "$H" -d "$BODY" "$R/api/documents.create"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$H" -d "$BODY" "$R/api/documents.create"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -H "authorization: Bearer ol_api_wrong" -H "$H" -d "$BODY" "$R/api/documents.create"
Expected output against a fresh deploy:
health: 200
public signup: 401
wrong login: 401
login: 200
role: admin
write with key: 200
write without key: 401
write wrong key: 401
The refusals are the contract: a request without a key is refused (write without key: 401), a stranger cannot register (public signup: 401) and a wrong password is refused (wrong login: 401).
Why Deploy Outline 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 Outline 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.
- Agent-ready - no deployer fields, a contract block, and one script that proves the app is healthy, strangers cannot register, the generated login works and the API refuses writes without a key.
- Sign-in included - a pre-wired login, so there is no OIDC provider or mail server to set up first.
- No S3 bucket - uploads live on a volume at
/var/lib/outline/data. - Data survives redeploys - documents in PostgreSQL on a volume, uploads on a volume, Redis on a volume.
- Pinned - Outline, Dex, PostgreSQL and Redis are pinned by digest, and the wrapper by tag and digest.
Common Use Cases
- Team wiki - one searchable home for runbooks, specs and meeting notes, instead of a Notion or Confluence subscription.
- Documentation for a product - collections and nested documents with a public share link per page.
- Memory for AI agents - give an agent a generated login and an API key to write and read the notes it needs between tasks.
Dependencies for Outline Hosting
- The outline service, a PostgreSQL service and a Redis service, each with its volume, created by the template.
Deployment Dependencies
Template Content
