Database Setup
IntuneGet uses SQLite for self-hosted deployments - a zero-configuration, embedded database that requires no external services.
Overview
The self-hosted version of IntuneGet uses SQLite, providing:
Zero Configuration
Database is created automatically on first run. No setup required.
Simple Backups
Just copy the SQLite file. No complex database dumps needed.
Full Control
All data stays on your infrastructure. No external dependencies.
No External Database Needed
Unlike the hosted version, self-hosted IntuneGet does not require any external database service. Everything is stored in a single SQLite file that is created and managed automatically.
Configuration
Configure the database using environment variables:
| Variable | Description | Default |
|---|---|---|
DATABASE_MODE | Set to "sqlite" for self-hosted mode | supabase |
DATABASE_PATH | Path to the SQLite database file | ./data/intuneget.db |
# Enable SQLite mode
DATABASE_MODE=sqlite
# Optional: Custom database path
DATABASE_PATH=/data/intuneget.dbDocker Volume Mount
When using Docker, mount a volume to persist the database:
1version: '3.8'23services:4 intuneget:5 build: .6 ports:7 - "3000:3000"8 environment:9 - DATABASE_MODE=sqlite10 - DATABASE_PATH=/data/intuneget.db11 - PACKAGER_MODE=local12 - PACKAGER_API_KEY=${PACKAGER_API_KEY}13 volumes:14 - intuneget-data:/data15 restart: unless-stopped1617volumes:18 intuneget-data:Persist Your Data
Always mount a volume for /data in Docker. Without a volume, the database will be lost when the container is recreated.
Database Schema
The database schema is created automatically. It includes these tables:
packaging_jobs
Tracks all packaging requests, their status, progress, and results. Includes job claiming for the local packager.
upload_history
Records successful deployments to Intune for reference and audit.
Backup & Recovery
Creating Backups
SQLite makes backups simple - just copy the database file:
# From Docker host
docker cp intuneget-intuneget-1:/data/intuneget.db ./backup-$(date +%Y%m%d).db
# Or if using a volume mount
cp /path/to/data/intuneget.db ./backup-$(date +%Y%m%d).dbRestoring from Backup
# Stop the container first
docker-compose down
# Replace the database file
cp ./backup-20240115.db /path/to/data/intuneget.db
# Restart
docker-compose up -dAutomated Backups
Set up a cron job or scheduled task to backup the database regularly:
# Add to crontab (daily at 2am)
0 2 * * * cp /data/intuneget.db /backups/intuneget-$(date +\%Y\%m\%d).dbViewing Data
You can inspect the database using any SQLite client:
# Using sqlite3 CLI
sqlite3 /data/intuneget.db
# Common queries
.tables # List all tables
SELECT * FROM packaging_jobs; # View all jobs
SELECT * FROM packaging_jobs WHERE status = 'failed'; # View failed jobsGUI tools like DB Browser for SQLite or TablePlus also work well.
Migration from Hosted Version
If you're migrating from the hosted version (intuneget.com), note that job history and deployment records are not transferred. The self-hosted version starts fresh with an empty database.
Next Steps
The database is configured automatically. Continue with Docker deployment to get your instance running.
Continue to Docker Deployment