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
.└── DockerfileSample Dockerfile
FROM requarks/wiki:latest
# Default Wiki.js portENV PORT=3000EXPOSE 3000Required environment variables
DB_TYPE=postgresDB_HOST– database hostDB_PORT– e.g.,5432DB_USERDB_PASSDB_NAMEPORT=3000
Optional environment variables
APP_URL– public URL, e.g.,https://example-app.klutch.shLOG_LEVEL=infoHTTPS_PROXY/NO_PROXYif 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.shwhile Klutch.sh routes to port3000inside the container.
Health check (recommended)
curl -I http://localhost:3000Deployment on Klutch.sh
- Push your Dockerfile to GitHub.
- In klutch.sh/app, create a new app and select GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Select HTTP traffic and set the internal port to
3000. - Add environment variables for the database (
DB_TYPE,DB_HOST,DB_PORT,DB_USER,DB_PASS,DB_NAME) andAPP_URL. Mark secrets as sensitive. - Attach a persistent volume at
/var/wiki/dataif storing uploads locally. - Deploy. After first boot, complete the web installer and create your admin account.
Verification
-
UI: open
https://example-app.klutch.shand 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/datavolume. - Set up authentication providers (OAuth, SAML) in the Wiki.js admin area.
- Tune logging and proxy settings if running behind additional edge services.