Deploying a Jitsu App
Introduction
Jitsu is an open-source data ingestion and event collection platform that routes events to warehouses and real-time destinations. Deploying Jitsu with a Dockerfile on Klutch.sh gives you reproducible builds, managed secrets, and persistent storage for configuration—all managed from klutch.sh/app. This guide covers installation, repository prep, a production-ready Dockerfile, deployment steps, Nixpacks overrides, and best practices for reliable event delivery.
Prerequisites
- A Klutch.sh account (create one)
- A GitHub repository containing your Jitsu config/custom code (GitHub is the only supported git source)
- Docker familiarity and Node.js/Go basics (Jitsu uses both)
- Database credentials if you use Postgres for state, and credentials for downstream destinations
Review platform basics in the Quick Start.
Architecture and ports
- Jitsu serves HTTP; set the internal container port to
8001(the default Jitsu server port). - For databases (e.g., Postgres) or caches, run them as separate Klutch.sh TCP apps, exposed on port
8000and connected on native ports (5432for Postgres). - Persistent storage is recommended for configuration files, custom destinations, and local cache.
Repository layout
jitsu/├── config/ # Jitsu config files├── destinations/ # Custom destination code/configs├── Dockerfile # Must be at repo root for auto-detection├── package.json├── pnpm-lock.yaml # or yarn.lock / package-lock.json├── go.mod # If building custom Go destinations└── .env.example # Template only; no secretsKeep secrets out of Git; store them in Klutch.sh environment variables.
Installation (local) and starter commands
Install dependencies and run locally before pushing to GitHub:
pnpm installpnpm buildpnpm start -- --port 8001If you build Go-based destinations, add:
go build ./...Optional helper start.sh for portability and Nixpacks fallback:
#!/usr/bin/env bashset -euo pipefailpnpm start -- --port 8001Make it executable with chmod +x start.sh.
Dockerfile for Jitsu (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 buildWORKDIR /app
COPY package.json pnpm-lock.yaml* yarn.lock* package-lock.json* ./RUN corepack enableRUN pnpm install --frozen-lockfile
COPY . .RUN pnpm build
FROM node:18-alpineWORKDIR /appENV NODE_ENV=production PORT=8001
COPY --from=build /app /appRUN corepack enable && pnpm install --prod --frozen-lockfile
EXPOSE 8001CMD ["pnpm", "start", "--", "--port", "8001"]Notes:
- If you compile Go components, add a Go build stage and copy the binaries into the final image.
- Keep
config/anddestinations/on volumes if you edit them at runtime.
Environment variables (Klutch.sh)
Set these in the Klutch.sh app settings (Secrets tab) before deploying:
NODE_ENV=productionPORT=8001APP_BASE_URL=https://example-app.klutch.shREDIS_URL=redis://<user>:<password>@<host>:<port>(if using Redis)POSTGRES_URL=postgres://<user>:<password>@<host>:<port>/<db>(if using Postgres)- Destination-specific secrets (e.g.,
SEGMENT_WRITE_KEY,S3_ACCESS_KEY, etc.)
If you deploy without the Dockerfile and need Nixpacks overrides:
NIXPACKS_BUILD_CMD=pnpm install --frozen-lockfile && pnpm buildNIXPACKS_START_CMD=pnpm start -- --port 8001NIXPACKS_NODE_VERSION=18
These keep Jitsu compatible with Nixpacks defaults when a Dockerfile is absent.
Attach persistent volumes
In Klutch.sh storage settings, add mount paths and sizes (no names required):
/app/config— for configuration files you edit at runtime./app/destinations— for custom destination code/configs.
Ensure these paths are writable inside the container.
Deploy Jitsu on Klutch.sh (Dockerfile workflow)
- Push your repository (with the Dockerfile at the root) to GitHub.
- Open klutch.sh/app, create a project, and add an app.
- Connect the GitHub repository; Klutch.sh automatically detects the Dockerfile.
- Choose HTTP traffic for Jitsu.
- Set the internal port to
8001. - Add the environment variables above (database/cache URLs, destination secrets, and any
NIXPACKS_*overrides if you temporarily deploy without the Dockerfile). - Attach persistent volumes for
/app/configand/app/destinationsif you modify them at runtime, selecting sizes that fit your needs. - Deploy. Your Jitsu endpoint will be reachable at
https://example-app.klutch.sh; attach a custom domain if desired.
Health checks and production tips
- Add a
/healthendpoint or reuse Jitsu’s status route for monitoring. - Enforce HTTPS at the edge; forward HTTP to port 8001 internally.
- Keep lockfiles committed and Node versions pinned for reproducible builds.
- Rotate destination credentials regularly and keep them only in Klutch.sh secrets.
- Monitor disk usage on mounted paths and resize volumes before they fill.
Jitsu on Klutch.sh combines reproducible Docker builds with managed secrets, persistent configuration storage, and flexible HTTP/TCP routing. With the Dockerfile at the repo root and ports set to 8001 for the app (8000 externally for TCP databases or caches), you can deliver reliable event collection without extra YAML or workflow overhead.