Skip to content

Deploying an Outline App

Introduction

Outline is an open-source team knowledge base built on Node.js, PostgreSQL, and Redis. Deploying Outline with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage for uploads and cache—all configured from klutch.sh/app. This guide covers installation, repository prep, a production-ready Dockerfile, deployment steps, Nixpacks overrides, sample API usage, and production tips.


Prerequisites

  • A Klutch.sh account (sign up)
  • A GitHub repository containing your Outline Dockerfile (GitHub is the only supported git source)
  • PostgreSQL database (deploy as a Klutch.sh TCP app on port 8000; connect on 5432)
  • Redis instance (deploy as a Klutch.sh TCP app on port 8000; connect on 6379)
  • Domain and TLS for secure access

For onboarding, see the Quick Start.


Architecture and ports

  • Outline serves HTTP on internal port 3000; choose HTTP traffic.
  • Persistent storage is required for file uploads and logs.

Repository layout

outline/
├── Dockerfile # Must be at repo root for auto-detection
├── package.json
├── yarn.lock # or pnpm-lock.yaml / package-lock.json
├── .env.example # Template only; no secrets
└── public/uploads # Uploads (persist)

Keep secrets out of Git; store them in Klutch.sh environment variables.


Installation (local) and starter commands

Validate locally before pushing to GitHub:

Terminal window
yarn install --frozen-lockfile
yarn build
yarn start --port 3000

Optional helper start.sh:

#!/usr/bin/env bash
set -euo pipefail
exec yarn start --port "${PORT:-3000}"

Make it executable with chmod +x start.sh.


Dockerfile for Outline (production-ready)

Place this Dockerfile at the repo root; Klutch.sh auto-detects it (no Docker selection in the UI):

FROM node:18-alpine AS build
WORKDIR /app
COPY package.json yarn.lock* pnpm-lock.yaml* package-lock.json* ./
RUN corepack enable
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
FROM node:18-alpine
WORKDIR /app
ENV NODE_ENV=production PORT=3000
COPY --from=build /app /app
RUN corepack enable && yarn install --frozen-lockfile --production
EXPOSE 3000
CMD ["yarn", "start", "--port", "3000"]

Notes:

  • Add system deps if plugins require them (apk add --no-cache ...).
  • Ensure the public/uploads directory is writable and mounted as a volume.

Environment variables (Klutch.sh)

Set these in Klutch.sh before deploying:

  • PORT=3000
  • NODE_ENV=production
  • APP_URL=https://example-app.klutch.sh
  • DATABASE_URL=postgres://<user>:<password>@<host>:5432/<db>
  • REDIS_URL=redis://:<password>@<host>:6379/0
  • SECRET_KEY=<secure-random>
  • UTILS_SECRET=<secure-random>
  • UPLOAD_DIR=/app/public/uploads
  • SMTP (for invites/notifications): SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD, SMTP_FROM_EMAIL, SMTP_REPLY_EMAIL
  • Optional OAuth: provider-specific keys (Google, Slack, etc.) as needed

If you deploy without the Dockerfile and need Nixpacks overrides:

  • NIXPACKS_BUILD_CMD=yarn install --frozen-lockfile && yarn build
  • NIXPACKS_START_CMD=yarn start --port 3000
  • NIXPACKS_NODE_VERSION=18

Attach persistent volumes

In Klutch.sh storage settings, add mount paths and sizes (no names required):

  • /app/public/uploads — user file uploads.
  • /app/logs — optional logs if stored on disk.

Ensure these paths are writable inside the container.


Deploy Outline on Klutch.sh (Dockerfile workflow)

  1. Push your repository—with the Dockerfile at the root—to GitHub.
  2. Open klutch.sh/app, create a project, and add an app.
  3. Select HTTP traffic and set the internal port to 3000.
  4. Add the environment variables above, including Postgres, Redis, secrets, and SMTP settings.
  5. Attach persistent volumes for /app/public/uploads (and /app/logs if used) sized for your content and log retention.
  6. Deploy. Your Outline instance will be reachable at https://example-app.klutch.sh; attach a custom domain if desired.

Sample API usage

List collections (replace token with a personal access token):

Terminal window
curl -X GET "https://example-app.klutch.sh/api/collections.list" \
-H "Authorization: Bearer <token>"

Create a document:

Terminal window
curl -X POST "https://example-app.klutch.sh/api/documents.create" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"title":"Hello from Outline on Klutch.sh","text":"Welcome to your wiki","collectionId":"<collection_id>"}'

Health checks and production tips

  • Add an HTTP probe to / or /api/health for readiness.
  • Enforce HTTPS at the edge; forward internally to port 3000.
  • Keep SECRET_KEY and UTILS_SECRET in Klutch.sh secrets; rotate them regularly.
  • Monitor storage usage on /app/public/uploads; resize before it fills.
  • Pin image versions and test upgrades in staging; back up DB and uploads before updates.

Outline on Klutch.sh combines reproducible Docker builds with managed secrets, persistent storage, and flexible HTTP/TCP routing. With the Dockerfile at the repo root, port 3000 configured, and Postgres/Redis connected, you can deliver a secure, collaborative knowledge base without extra YAML or workflow overhead.