Deploying an XWiki App
Introduction
XWiki is a powerful, extensible enterprise wiki. This guide shows how to containerize XWiki with a Dockerfile, connect it to PostgreSQL, persist attachments, 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 xwiki:latest
# Default XWiki portENV JETTY_PORT=8080EXPOSE 8080Required environment variables
DB_HOST– database hostDB_PORT– e.g.,5432DB_DATABASE– database nameDB_USERDB_PASSWORDJETTY_PORT=8080
Optional environment variables
XWIKI_VERSION– pin a version if neededJAVA_OPTIONS– custom JVM flags (e.g., memory tuning)DB_TYPE=postgresql
Persistence
XWiki stores attachments, extensions, and cache on disk:
- Mount path:
/var/lib/xwiki - Size: based on expected attachments, pages, and extensions
Networking
- Protocol: HTTP
- Internal port:
8080 - Users reach
https://example-app.klutch.shwhile Klutch.sh routes to port8080inside the container.
Health check (recommended)
curl -I http://localhost:8080Deployment 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
8080. - Add environment variables for the database (
DB_HOST,DB_PORT,DB_DATABASE,DB_USER,DB_PASSWORD) and any JVM tuning. Mark secrets as sensitive. - Attach a persistent volume at
/var/lib/xwikisized for attachments and extensions. - Deploy. After first boot, complete the XWiki setup wizard and create your admin account.
Verification
-
UI: open
https://example-app.klutch.shand confirm the XWiki welcome page appears. -
Quick check:
Terminal window curl -I https://example-app.klutch.sh
Next steps
- Configure LDAP/SSO or other auth methods in the admin console.
- Schedule backups for PostgreSQL and the
/var/lib/xwikivolume. - Tune JVM options and caching based on your usage.