Deploying a Repman App
Introduction
Repman is an open-source Composer repository manager for PHP packages, enabling private mirrors and package distribution. Deploying Repman with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage—all configured from klutch.sh/app. This guide covers installation, Dockerfile setup, environment variables, storage, Nixpacks overrides, and sample checks.
Prerequisites
- A Klutch.sh account (sign up)
- A GitHub repository containing your Repman Dockerfile (GitHub is the only supported git source)
- External PostgreSQL database
- Optional SMTP credentials for notifications
For onboarding, see the Quick Start.
Architecture and ports
- Repman serves HTTP on internal port
80in the official image. Choose HTTP traffic and set the internal port to80. - Persistent storage is required for package metadata and cache.
Repository layout
repman/├── Dockerfile # Must be at repo root for auto-detection└── README.mdKeep secrets out of Git; store them in Klutch.sh environment variables.
Installation (local) and starter commands
Build and run locally (ensure Postgres is reachable):
docker build -t repman-local .docker run -p 8080:80 \ -e APP_ENV=prod \ -e DATABASE_URL=postgres://user:pass@localhost:5432/repman \ -e APP_SECRET=$(openssl rand -hex 32) \ repman-localDockerfile for Repman (production-ready)
Place this at the repo root; Klutch.sh auto-detects Dockerfiles.
FROM buddy/repman:latest
ENV APP_ENV=prodENV APP_SECRET=change-me
EXPOSE 80CMD ["/entrypoint.sh"]Notes:
- Pin to a specific tag (e.g.,
buddy/repman:1.5.7) for stability. /entrypoint.shstarts the PHP-FPM/Nginx stack on port 80 inside the container.
Environment variables (Klutch.sh)
Set these before deploying:
PORT=80APP_ENV=prodAPP_SECRET=<secure-random-hex>DATABASE_URL=postgres://<user>:<password>@<host>:5432/<db>- Optional SMTP:
MAILER_DSN=smtp://user:pass@smtp-host:587
If deploying without the Dockerfile and relying on Nixpacks:
NIXPACKS_START_CMD=/entrypoint.sh
Attach persistent volumes
Add storage in Klutch.sh (path and size only):
/var/www/repman/var— cache and generated files./var/www/repman/packages— mirrored/private packages storage.
Ensure paths are writable inside the container.
Deploy Repman 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.
- Select HTTP traffic and set the internal port to
80. - Add environment variables (database URL, app secret, and optional mail settings).
- Attach volumes at
/var/www/repman/varand/var/www/repman/packagessized for your cache and packages. - Deploy. Your app will be reachable at
https://example-app.klutch.sh; complete Repman setup in the UI.
Sample checks
Landing page:
curl -I https://example-app.klutch.shIf you expose a health endpoint (replace if different):
curl -I https://example-app.klutch.sh/healthHealth checks and production tips
- Add an HTTP readiness probe to
/(or/healthif configured). - Keep DB credentials, app secret, and SMTP settings in Klutch.sh secrets; rotate regularly.
- Pin image versions and test upgrades in staging before production rollout.
- Monitor volume usage on
/var/www/repman/varand/var/www/repman/packages; resize proactively. - Back up Postgres and package storage regularly.
Repman on Klutch.sh delivers reproducible Docker builds, managed secrets, and persistent storage—without extra YAML or CI steps. Configure ports, env vars, and volumes, then launch your Composer repository.