Self-Hosting Snipe-IT with Docker Compose
What Is Snipe-IT?
Snipe-IT is an open-source IT asset management system built on Laravel. It tracks hardware assets, software licenses, consumables, and accessories across your organization. If you’ve ever lost track of which laptop went to which employee, or which software license is about to expire, Snipe-IT solves that problem. It replaces paid services like AssetTiger, EZOfficeInventory, and ServiceNow’s CMDB module.
Official site: snipeitapp.com
Prerequisites
- A Linux server (Ubuntu 22.04+ recommended)
- Docker and Docker Compose installed (guide)
- 2 GB of free disk space
- 1 GB of RAM (minimum), 2 GB recommended
- A domain name (optional, for remote access)
Docker Compose Configuration
Create a directory for your Snipe-IT deployment:
mkdir snipeit && cd snipeit
Create a docker-compose.yml file:
services:
snipeit:
image: snipe/snipe-it:v8.4.0
container_name: snipeit
restart: unless-stopped
ports:
- "8000:80"
depends_on:
- mysql
env_file:
- .env
volumes:
- snipeit-data:/var/lib/snipeit
networks:
- snipeit-net
mysql:
image: mysql:8.4
container_name: snipeit-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-changeme_root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-snipeit}
MYSQL_USER: ${MYSQL_USER:-snipeit}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-changeme_snipeit}
volumes:
- snipeit-mysql:/var/lib/mysql
networks:
- snipeit-net
command: --sql-mode=""
volumes:
snipeit-data:
snipeit-mysql:
networks:
snipeit-net:
Create a .env file:
# Application Settings
APP_ENV=production
APP_DEBUG=false
APP_KEY= # Generate with: docker compose run --rm snipeit php artisan key:generate --show
APP_URL=http://localhost:8000
APP_TIMEZONE=UTC
APP_LOCALE=en-US
# Database
DB_CONNECTION=mysql
DB_HOST=mysql
DB_DATABASE=snipeit
DB_USERNAME=snipeit
DB_PASSWORD=changeme_snipeit # CHANGE THIS — must match MYSQL_PASSWORD above
DB_PORT=3306
DB_PREFIX=null
DB_DUMP_PATH=/usr/bin
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
# MySQL root password (used by the mysql container)
MYSQL_ROOT_PASSWORD=changeme_root # CHANGE THIS
MYSQL_DATABASE=snipeit
MYSQL_USER=snipeit
MYSQL_PASSWORD=changeme_snipeit # Must match DB_PASSWORD
# Mail (optional — for sending notifications)
MAIL_DRIVER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDR=[email protected]
MAIL_FROM_NAME=Snipe-IT
MAIL_REPLYTO_ADDR=[email protected]
MAIL_REPLYTO_NAME=Snipe-IT
MAIL_AUTO_EMBED_METHOD=attachment
# Reverse Proxy (uncomment if behind a proxy)
# APP_TRUSTED_PROXIES=172.0.0.0/8
Generate the application key before starting:
docker compose run --rm snipeit php artisan key:generate --show
Copy the output (starts with base64:) and paste it as the APP_KEY value in your .env file.
Start the stack:
docker compose up -d
Initial Setup
Access Snipe-IT at http://your-server-ip:8000. The setup wizard walks you through:
- Pre-flight check — verifies database connectivity and required PHP extensions
- Create admin account — set your admin username, email, and password
- Company settings — enter your organization name and basic preferences
After setup, log in with the admin credentials you just created.
Key Features
| Feature | Details |
|---|---|
| Asset tracking | Hardware, licenses, consumables, accessories, components |
| Check-in/check-out | Assign assets to users, locations, or other assets |
| Audit logging | Full history of every asset action |
| Barcode/QR support | Generate and scan labels for physical assets |
| Depreciation | Track asset value over time |
| Custom fields | Define custom attributes per asset model |
| API | Full REST API for integration |
| LDAP/AD | Sync users from Active Directory or LDAP |
| Reporting | Checkout history, depreciation, audit, license compliance |
| Notifications | Email alerts for expiring licenses, warranties, audits |
Configuration
LDAP Integration
Add these to your .env file to sync users from Active Directory:
LDAP_ENABLED=true
LDAP_HOST=ldap://your-dc.example.com
LDAP_PORT=389
LDAP_BASE_DN="dc=example,dc=com"
LDAP_BIND_DN="cn=admin,dc=example,dc=com"
LDAP_BIND_PASSWORD=your_ldap_password
LDAP_USERNAME_FIELD=samaccountname
LDAP_LAST_NAME_FIELD=sn
LDAP_FIRST_NAME_FIELD=givenname
LDAP_EMAIL_FIELD=mail
Adjusting the Time Zone
Set APP_TIMEZONE in your .env to your local timezone (e.g., America/New_York, Europe/London). This affects asset checkout timestamps and report dates.
Reverse Proxy
If running behind a reverse proxy, set APP_TRUSTED_PROXIES in your .env to the proxy’s network range:
APP_TRUSTED_PROXIES=172.0.0.0/8
For Nginx Proxy Manager, Traefik, or Caddy configuration, see Reverse Proxy Setup.
Backup
Back up these volumes regularly:
snipeit-data— uploaded files, generated reports, asset imagessnipeit-mysql— the MySQL database containing all asset records
Database dump:
docker compose exec mysql mysqldump -u snipeit -p snipeit > snipeit-backup-$(date +%Y%m%d).sql
For a full backup strategy, see Backup Strategy.
Troubleshooting
”No APP_KEY set” Error
Symptom: Application shows a 500 error or “No application encryption key has been specified.”
Fix: Generate the key and add it to .env:
docker compose run --rm snipeit php artisan key:generate --show
MySQL Strict Mode Errors
Symptom: Database migration failures or “SQLSTATE” errors during setup.
Fix: The --sql-mode="" flag in the MySQL command disables strict mode. Verify it’s set in your docker-compose.yml.
Permission Errors on Upload
Symptom: Cannot upload asset images, user avatars, or import CSV files.
Fix: The container runs as www-data. Ensure the data volume has correct ownership:
docker compose exec snipeit chown -R www-data:www-data /var/lib/snipeit
Assets Not Appearing After Import
Symptom: CSV import completes but assets don’t show up.
Fix: Snipe-IT requires matching asset models, categories, and status labels to exist before import. Create these in Settings → Asset Models, Categories, and Status Labels first, then re-import.
Resource Requirements
- RAM: ~200 MB idle, ~500 MB under load with 10,000+ assets
- CPU: Low — Laravel handles typical CRUD workloads efficiently
- Disk: ~500 MB for the application, plus storage for uploaded files
Verdict
Snipe-IT is the best open-source IT asset management tool available. It covers the full lifecycle — procurement, assignment, depreciation, and disposal — with an intuitive web interface and a solid API. If you manage more than a handful of devices or software licenses, Snipe-IT pays for itself in tracking clarity alone. For home use or very small setups, it’s overkill — a spreadsheet works fine. For anything beyond 50 assets or 5 users, deploy Snipe-IT.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments