Skip to content

Deploying a Wiki.js App

Introduction

Wiki.js is a modern, extensible wiki platform powered by Node.js. This guide shows how to containerize Wiki.js with a Dockerfile, connect it to PostgreSQL, persist uploads, and deploy it to Klutch.sh over HTTP.

Prerequisites

  • GitHub repository containing your Dockerfile.
  • PostgreSQL database (managed or deployed separately).
  • Klutch.sh project ready in klutch.sh/app.

Project structure

.
└── Dockerfile

Sample Dockerfile

FROM requarks/wiki:latest
# Default Wiki.js port
ENV PORT=3000
EXPOSE 3000

Required environment variables

  • DB_TYPE=postgres
  • DB_HOST – database host
  • DB_PORT – e.g., 5432
  • DB_USER
  • DB_PASS
  • DB_NAME
  • PORT=3000

Optional environment variables

  • APP_URL – public URL, e.g., https://example-app.klutch.sh
  • LOG_LEVEL=info
  • HTTPS_PROXY / NO_PROXY if behind proxies

Persistence

If you store uploads locally, attach a volume:

  • Mount path: /var/wiki/data
  • Size: based on expected attachments and backups

Networking

  • Protocol: HTTP
  • Internal port: 3000
  • Users reach https://example-app.klutch.sh while Klutch.sh routes to port 3000 inside the container.
Terminal window
curl -I http://localhost:3000

Deployment on Klutch.sh

  1. Push your Dockerfile to GitHub.
  2. In klutch.sh/app, create a new app and select GitHub as the source.
  3. Klutch.sh automatically detects the Dockerfile in the repository root.
  4. Select HTTP traffic and set the internal port to 3000.
  5. Add environment variables for the database (DB_TYPE, DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME) and APP_URL. Mark secrets as sensitive.
  6. Attach a persistent volume at /var/wiki/data if storing uploads locally.
  7. Deploy. After first boot, complete the web installer and create your admin account.

Verification

  • UI: open https://example-app.klutch.sh and confirm the setup wizard or login page appears.

  • Quick check:

    Terminal window
    curl -I https://example-app.klutch.sh

Next steps

  • Configure backups for PostgreSQL and the /var/wiki/data volume.
  • Set up authentication providers (OAuth, SAML) in the Wiki.js admin area.
  • Tune logging and proxy settings if running behind additional edge services.