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:

VariableDescriptionDefault
DATABASE_MODESet to "sqlite" for self-hosted modesupabase
DATABASE_PATHPath to the SQLite database file./data/intuneget.db
bash|.env.local
# Enable SQLite mode
DATABASE_MODE=sqlite

# Optional: Custom database path
DATABASE_PATH=/data/intuneget.db

Docker Volume Mount

When using Docker, mount a volume to persist the database:

yaml|docker-compose.yml
1version: '3.8'
2
3services:
4 intuneget:
5 build: .
6 ports:
7 - "3000:3000"
8 environment:
9 - DATABASE_MODE=sqlite
10 - DATABASE_PATH=/data/intuneget.db
11 - PACKAGER_MODE=local
12 - PACKAGER_API_KEY=${PACKAGER_API_KEY}
13 volumes:
14 - intuneget-data:/data
15 restart: unless-stopped
16
17volumes:
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:

bash
# 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).db

Restoring from Backup

bash
# Stop the container first
docker-compose down

# Replace the database file
cp ./backup-20240115.db /path/to/data/intuneget.db

# Restart
docker-compose up -d

Automated Backups

Set up a cron job or scheduled task to backup the database regularly:

bash
# Add to crontab (daily at 2am)
0 2 * * * cp /data/intuneget.db /backups/intuneget-$(date +\%Y\%m\%d).db

Viewing Data

You can inspect the database using any SQLite client:

bash
# 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 jobs

GUI 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.

Deploy the self-hosted version with SQLite
Configure Azure AD app registration for your new URL
Install and configure the local packager
Start fresh with new deployments

Next Steps

The database is configured automatically. Continue with Docker deployment to get your instance running.

Continue to Docker Deployment