Deploying a Snipe-IT App
Introduction
Snipe-IT is an open-source asset management system built on Laravel. Deploying Snipe-IT 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 to verify your deployment.
Prerequisites
- A Klutch.sh account (sign up)
- A GitHub repository containing your Snipe-IT Dockerfile (GitHub is the only supported git source)
- External MySQL/MariaDB database
- Domain and TLS for secure access
For onboarding, see the Quick Start.
Architecture and ports
- Snipe-IT serves HTTP on internal port
80in the official image. Choose HTTP traffic and set the internal port to80. - Persistent storage is required for uploads, logs, and config caches; primary data resides in MySQL/MariaDB.
Repository layout
snipe-it/├── 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 MySQL is reachable):
docker build -t snipeit-local .docker run -p 8080:80 \ -e APP_URL=http://localhost:8080 \ -e DB_CONNECTION=mysql \ -e DB_HOST=localhost \ -e DB_DATABASE=snipeit \ -e DB_USERNAME=snipeit \ -e DB_PASSWORD=changeme \ snipeit-localDockerfile for Snipe-IT (production-ready)
Place this at the repo root; Klutch.sh auto-detects Dockerfiles.
FROM snipe/snipe-it:latest
ENV APP_URL=http://localhost:8080ENV DB_CONNECTION=mysql
EXPOSE 80CMD ["/bin/bash", "-lc", "apache2-foreground"]Notes:
- Pin to a specific tag (e.g.,
snipe/snipe-it:v6.1.0) for stability. - Apache serves the app on port 80 inside the container.
Environment variables (Klutch.sh)
Set these before deploying:
PORT=80APP_URL=https://example-app.klutch.sh- Database:
DB_CONNECTION=mysqlDB_HOST=<db-host>DB_PORT=3306DB_DATABASE=<db-name>DB_USERNAME=<db-user>DB_PASSWORD=<db-password>
- App settings:
APP_KEY=<secure-key>(generate viaphp artisan key:generatelocally)APP_DEBUG=false
- Optional mail settings:
MAIL_HOST,MAIL_PORT,MAIL_USERNAME,MAIL_PASSWORD,MAIL_ENCRYPTION,MAIL_FROM_ADDRESS,MAIL_FROM_NAME
If deploying without the Dockerfile and relying on Nixpacks:
NIXPACKS_START_CMD=apache2-foreground
Attach persistent volumes
Add storage in Klutch.sh (path and size only):
/var/lib/snipeit— uploads and app-generated files./var/www/html/storage— Laravel storage (logs/cache).
Ensure paths are writable inside the container.
Deploy Snipe-IT 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 the environment variables above (database, app key, mail settings as needed).
- Attach volumes at
/var/lib/snipeitand/var/www/html/storagesized for your uploads and logs. - Deploy. Access your app at
https://example-app.klutch.shand finish setup in the UI.
Sample checks
Landing page:
curl -I https://example-app.klutch.shIf a health endpoint exists (replace if different):
curl -I https://example-app.klutch.sh/healthHealth checks and production tips
- Add an HTTP readiness probe to
/or your health endpoint. - Keep DB and mail credentials plus
APP_KEYin Klutch.sh secrets; rotate regularly. - Pin image versions and test upgrades in staging before production rollout.
- Back up MySQL and the volumes
/var/lib/snipeitand/var/www/html/storageregularly.
Snipe-IT 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 asset management platform.