This guide uses Docker Compose to run InvenTree. The current stable version is 1.2.0, released February 12, 2026.
For Docker installation, see Docker.
For a quick evaluation of InvenTree, you can run it directly with Docker:
# Pull and run the latest stable version
docker run -it --rm \
-v inventree-media:/home/inventree/.local/share/inventree/media \
-v inventree-static:/home/inventree/.local/share/inventree/static \
-p 8000:8000 \
ghcr.io/inventree/inventree:stable
Then navigate to http://localhost:8000 in your browser.
For production deployments, use the following Docker Compose setup with a proper database backend:
mkdir inventree && cd inventree
Create a docker-compose.yml file with the following content:
version: '3.8'
services:
db:
image: postgres:15
restart: always
environment:
POSTGRES_DB: inventree
POSTGRES_USER: inventree
POSTGRES_PASSWORD: inventree123 # Change this password!
volumes:
- inventree-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U inventree -d inventree"]
interval: 30s
timeout: 10s
retries: 5
redis:
image: redis:alpine
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 5
inventree-server:
image: ghcr.io/inventree/inventree:stable # Use 'latest' for development
restart: always
depends_on:
- db
- redis
ports:
- "8000:8000"
environment:
- INVENTREE_DB_ENGINE=postgresql
- INVENTREE_DB_NAME=inventree
- INVENTREE_DB_USER=inventree
- INVENTREE_DB_PASSWORD=inventree123 # Match the DB password
- INVENTREE_DB_HOST=db
- INVENTREE_REDIS_URL=redis://redis:6379
- INVENTREE_MEDIA_ROOT=/media
- INVENTREE_STATIC_ROOT=/static
- INVENTREE_SECRET_KEY=change-this-to-a-very-long-random-string
- INVENTREE_ALLOWED_HOSTS=* # Configure properly for production
volumes:
- inventree-media-data:/media
- inventree-static-data:/static
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --no-input &&
python manage.py check --deploy &&
gunicorn InvenTree.wsgi:application --bind 0.0.0.0:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/"]
interval: 30s
timeout: 10s
retries: 5
volumes:
inventree-db-data:
inventree-media-data:
inventree-static-data:
docker compose up -d
After the services start, navigate to http://your-server-ip:8000 and create your first superuser account:
# Create a superuser account (optional if you prefer the web interface)
docker compose exec inventree-server python manage.py createsuperuser
For production deployments, create a .env file to store sensitive information:
# .env file
POSTGRES_PASSWORD=your_secure_postgres_password
INVENTREE_SECRET_KEY=your_very_long_random_secret_key
INVENTREE_ALLOWED_HOSTS=your-domain.com,www.your-domain.com
INVENTREE_BASE_URL=https://your-domain.com
Then reference these in your docker-compose.yml:
services:
db:
# ...
environment:
POSTGRES_DB: inventree
POSTGRES_USER: inventree
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
inventree-server:
# ...
environment:
- INVENTREE_DB_PASSWORD=${POSTGRES_PASSWORD}
- INVENTREE_SECRET_KEY=${INVENTREE_SECRET_KEY}
- INVENTREE_ALLOWED_HOSTS=${INVENTREE_ALLOWED_HOSTS}
- INVENTREE_BASE_URL=${INVENTREE_BASE_URL}
For production, set up a reverse proxy with SSL termination:
inventree-server:
# ... other config
ports:
- "127.0.0.1:8000:8000" # Only accessible locally
Then configure nginx or Apache to proxy requests to port 8000 with SSL.
stable tag for production environments (recommended)image: ghcr.io/inventree/inventree:stable
latest tag for development/testing to access newest featuresimage: ghcr.io/inventree/inventree:latest
1.2.0 for pinned deploymentsimage: ghcr.io/inventree/inventree:1.2.0
To update to a newer version:
# Pull the latest image
docker compose pull
# Stop the current services
docker compose down
# Start with the new image
docker compose up -d
# Run any necessary database migrations
docker compose exec inventree-server python manage.py migrate
# Backup the database
docker compose exec db pg_dump -U inventree inventree > inventree_backup_$(date +%Y%m%d_%H%M%S).sql
# Create a backup of media files
docker run --rm -v inventree-media-data:/data -v $(pwd):/backup alpine tar czf /backup/media_$(date +%Y%m%d_%H%M%S).tar.gz -C /data .
# Collect static files (after updates)
docker compose exec inventree-server python manage.py collectstatic --no-input
# Check for any issues
docker compose exec inventree-server python manage.py check --deploy
# Cleanup Docker system (periodically)
docker system prune -f
docker compose ps# View logs
docker compose logs -f
# Check service status
docker compose ps
# Execute commands in containers
docker compose exec inventree-server bash
# Scale services (if needed)
docker compose up -d --scale inventree-server=2
Any questions?
Feel free to contact us. Find all contact information on our contact page.