This directory contains all the necessary files for deploying Skymmich using Docker containers.
git clone <your-repo-url>
cd skymmich
docker compose up -dNo external database or .env file required — Skymmich uses a built-in SQLite database by default.
Copy docker/.env.docker.example to .env in the project root to customize:
# Optional: Application configuration
SKYMMICH_PORT=5000
IMMICH_URL=http://your-immich-server:2283
IMMICH_API_KEY=your_immich_api_key_here
ASTROMETRY_API_KEY=your_astrometry_api_key_here
ENABLE_PLATE_SOLVING=true
PLATE_SOLVE_MAX_CONCURRENT=3Note: API keys can also be configured via the admin web interface after startup.
To use PostgreSQL instead of the built-in SQLite database, layer the postgres override:
echo "POSTGRES_PASSWORD=your_secure_password" > .env
docker compose -f docker-compose.yml -f docker-compose.postgres.yml up -dDockerfile- Multi-stage build for Skymmich applicationdocker-compose.yml- Default setup (SQLite, single container)docker-compose.postgres.yml- PostgreSQL override (layer on top)startup.sh- Container entry point script.env.docker.example- Docker environment variable template
unraid-templates/skymmich.xml- Main application template
- Go to Docker tab in UnRAID
- Click "Add Container"
- Use template URL:
https://raw.githubusercontent.com/mstelz/Skymmich/main/docker/unraid-templates/skymmich.xml - Optionally add your Immich and Astrometry.net credentials
- Apply and start container
- Open web interface:
http://your-unraid-ip:2284 - Configure admin settings
- Start syncing your astrophotography collection!
To use PostgreSQL instead of the default SQLite database, set the
DATABASE_URLfield in the template to your PostgreSQL connection string.
# Build and start services
docker compose up -d
# View logs
docker compose logs -f
# Stop services
docker compose down
# Rebuild and restart
docker compose up -d --build┌─────────────────────────────────────┐
│ Skymmich Container │
├─────────────────────────────────────┤
│ Frontend (React SPA) │
│ Backend (Hono API) │
│ Worker (Plate Solving) │ ┌─────────────────────┐
│ Real-time Updates (WebSocket) │ │ PostgreSQL │
│ SQLite Database (built-in) │◄──►│ (optional) │
└─────────────────────────────────────┘ └─────────────────────┘
- Endpoint:
http://localhost:5000/api/health - Checks database connectivity and worker status
- 30-second intervals with 40-second startup period
- Command:
pg_isready -U skymmich -d skymmich - 10-second intervals with 30-second startup period
- Skymmich Config + Database:
/app/config(includesskymmich.dbwhen using SQLite) - Logs:
/app/logs - Sidecars:
/app/sidecars - Cache:
/app/cache
SQLite (default):
# Backup database (just copy the file)
docker cp skymmich:/app/config/skymmich.db ./skymmich-backup.db
# Backup configuration
tar -czf skymmich-config-backup.tar.gz /mnt/user/appdata/skymmich/config
# Restore database
docker cp ./skymmich-backup.db skymmich:/app/config/skymmich.db
docker restart skymmichPostgreSQL (if using postgres override):
# Backup database
docker exec skymmich-db pg_dump -U skymmich skymmich > backup.sql
# Restore database
docker exec -i skymmich-db psql -U skymmich skymmich < backup.sqlA migration script is included for moving data between database engines in either direction.
Important: SQLite targets automatically run the bundled Drizzle migrations during the copy. PostgreSQL targets must still have their schema created ahead of time (start Skymmich once with the postgres override so the tables exist).
# Stop the application first
docker compose down
# Run migration inside the container
docker run --rm \
-v skymmich-config:/app/config \
--network skymmich-network \
ghcr.io/mstelz/skymmich:latest \
node /app/dist/tools/scripts/migrate-db.js \
--from postgresql://skymmich:password@skymmich-db:5432/skymmich \
--to sqlite:/app/config/skymmich.db
# Then start with the default compose (no PostgreSQL)
docker compose -f docker-compose.prod.yml up -d# Stop the application first
docker compose down
# Run migration inside the container
docker run --rm \
-v skymmich-config:/app/config \
--network skymmich-network \
ghcr.io/mstelz/skymmich:latest \
node /app/dist/tools/scripts/migrate-db.js \
--from sqlite:/app/config/skymmich.db \
--to postgresql://skymmich:password@skymmich-db:5432/skymmich
# Then start with the postgres override
docker compose -f docker-compose.prod.yml -f docker-compose.postgres.yml up -dnode tools/scripts/migrate-db.js \
--from sqlite:local.db \
--to postgresql://skymmich:password@localhost:5432/skymmichSet the AUTO_DB_MIGRATE_FROM environment variable on the Skymmich container to have the startup script run the migration automatically before the application boots. The target defaults to whichever database the container is configured to use (PostgreSQL when DATABASE_URL is set, otherwise the built-in SQLite database at /app/config/skymmich.db).
Optional environment variables:
| Variable | Default | Description |
|---|---|---|
AUTO_DB_MIGRATE_FROM |
(required) | Source connection string (e.g. postgresql://... or sqlite:/app/config/skymmich.db). |
AUTO_DB_MIGRATE_TO |
auto-detected | Override the destination connection string. |
AUTO_DB_MIGRATE_ONCE |
true |
When true, the migration runs only the first time and writes a marker file. |
AUTO_DB_MIGRATE_MARKER |
/app/config/.auto-db-migrated |
Marker file path used when AUTO_DB_MIGRATE_ONCE=true. Remove this file to re-run the automatic migration. |
AUTO_DB_MIGRATE_RESET_SQLITE |
true |
When migrating into SQLite, delete the target DB file before copying data. Set to false to keep the existing file. |
Examples:
# Migrate once from PostgreSQL back to the built-in SQLite database
AUTO_DB_MIGRATE_FROM=postgresql://skymmich:password@skymmich-db:5432/skymmich \
docker compose -f docker-compose.prod.yml up -d
# Migrate from SQLite to PostgreSQL before switching to the postgres override
AUTO_DB_MIGRATE_FROM=sqlite:/app/config/skymmich.db \
DATABASE_URL=postgresql://skymmich:password@skymmich-db:5432/skymmich \
docker compose -f docker-compose.prod.yml -f docker-compose.postgres.yml up -dAfter the automatic migration completes the container continues starting normally. Remove the environment variable (or delete the marker file) once the data has been copied.
- Check logs:
docker compose logs skymmich - Check environment variables
- Ensure ports aren't in use
- Verify volume permissions (check PUID/PGID settings)
- Check environment variable:
ENABLE_PLATE_SOLVING=true - View worker status in health endpoint
- Check Astrometry.net API key configuration
- SQLite: Check that
/app/configvolume is mounted and writable - PostgreSQL: Verify the PostgreSQL container is running and
DATABASE_URLis correct
- Monitor container resources
- Adjust
PLATE_SOLVE_MAX_CONCURRENTsetting - Check available disk space
Critical Security Notes:
- Secure API key storage - Set via environment variables or admin interface
- No secrets in images - Container images contain no embedded secrets
- Regular updates - Keep containers updated with latest security patches
- Monitor access - Review logs for unauthorized access attempts
- File permissions - Containers run as non-root user (
skymmich) - If using PostgreSQL: use a strong password and don't expose the PostgreSQL port externally
Environment Variables vs Admin Interface:
- Environment variables take precedence for initial configuration
- Admin interface settings are stored in the database
- Both methods are secure when properly configured
For development with hot reload:
# Run application locally (uses SQLite by default)
npm run dev