Self-hosted application management platform for homelabs. Provides a web UI for managing Docker containers, with a PostgreSQL backend.
This setup follows security best practices by using environment variables for secrets instead of hardcoding them in the compose file. This prevents sensitive credentials from being exposed in version control.
cp .env.example .envGenerate strong, random secrets for your installation:
# Generate ENCRYPTION_KEY (64 hex characters)
openssl rand -hex 32
# Generate JWT_SECRET (64 hex characters)
openssl rand -hex 32
# Generate database password (strong random password)
openssl rand -base64 32Open the .env file in your preferred editor:
nano .env # or vim, code, etc.Replace the placeholder values with the secrets you generated above.
docker compose up -d# Check container status
docker compose ps
# View logs
docker compose logs -f arcane
# Access the application
# Open http://localhost:3552 in your browserThese MUST be set in your .env file before starting:
| Variable | Description | How to Generate |
|---|---|---|
ENCRYPTION_KEY |
Used to encrypt sensitive data at rest | openssl rand -hex 32 |
JWT_SECRET |
Used to sign authentication tokens | openssl rand -hex 32 |
POSTGRES_PASSWORD |
Database password | openssl rand -base64 32 |
These have sensible defaults but can be customized:
| Variable | Default | Description |
|---|---|---|
APP_URL |
http://localhost:3552 |
External URL for the application |
PUID |
3001 |
User ID for file permissions |
PGID |
3001 |
Group ID for file permissions |
LOG_LEVEL |
info |
Logging verbosity (debug, info, warn, error) |
LOG_JSON |
false |
Output logs in JSON format |
POSTGRES_DB |
arcane |
Database name |
POSTGRES_USER |
arcane |
Database username |
OIDC_ENABLED |
false |
Enable OpenID Connect authentication |
When secrets are hardcoded in configuration files:
- ❌ They become permanently visible in Git history
- ❌ They're exposed to everyone with repository access
- ❌ Automated bots scan GitHub and harvest credentials within minutes
- ❌ You can't use different secrets for different environments (dev/staging/prod)
- ❌ Rotating secrets requires code changes and redeployment
Using environment variables for secrets provides:
- ✅ Secrets stored outside version control
- ✅ Different secrets per environment
- ✅ Easy rotation (just update
.envand restart) - ✅ Access control (only deployment systems need production secrets)
- ✅ Industry standard security practice
.envfile (gitignored) - Contains your actual secrets.env.examplefile (committed to git) - Template showing what variables are neededcompose.yamluses${VARIABLE}syntax to read from.env- Docker Compose automatically loads variables when you run
docker compose up
-
NEVER commit the .env file to version control
- It's already in
.gitignoreat the repository root - Always verify with:
git statusbefore committing - Double-check with:
git check-ignore arcane/.env(should output: arcane/.env)
- It's already in
-
Generate UNIQUE secrets for each installation
- Don't reuse secrets across different environments
- Don't copy secrets from examples or tutorials
- Use cryptographically secure random generators (like
openssl rand)
-
Use strong, random secrets
- Minimum 32 characters for passwords
- 64 hex characters for encryption keys and JWT secrets
- Never use dictionary words or predictable patterns
-
Rotate secrets regularly
- Change passwords quarterly
- Especially after team member changes
- After any suspected security incident
Protect your .env file on Linux/Unix systems:
chmod 600 .envThis ensures only the file owner can read/write it.
If you need to backup your .env file, encrypt it first:
# Encrypt with GPG
gpg --symmetric --cipher-algo AES256 .env
# This creates .env.gpg - store it in a secure location
# NEVER commit .env.gpg to version control either!To restore:
# Decrypt the backup
gpg --decrypt .env.gpg > .env
# Verify contents
cat .env
# Start services
docker compose up -dThis setup uses the .env file pattern, which is appropriate for:
- ✅ Local development
- ✅ Home lab environments
- ✅ Small teams with trusted members
- ✅ Non-critical/personal projects
For production environments or higher security requirements, consider:
Built into Docker Swarm mode, provides encrypted secret storage:
# Create a secret
echo "my_strong_password" | docker secret create postgres_password -
# Reference in compose.yaml
secrets:
- postgres_passwordFor enterprise or cloud deployments:
- AWS Secrets Manager - Automatic rotation, fine-grained access control
- Azure Key Vault - Integrated with Azure services
- Google Secret Manager - Integrated with GCP
- HashiCorp Vault - Multi-cloud, advanced features
Check if environment variables are loaded correctly:
# View the final configuration with variables substituted
docker compose config
# Look for empty or ${VARIABLE} values which indicate missing .env variablesVerify the DATABASE_URL is correctly constructed:
# Check the DATABASE_URL in your .env file
grep DATABASE_URL .env
# Should look like: postgresql://arcane:your_password@postgres:5432/arcaneMake sure the password doesn't contain special characters that need URL encoding. If it does, either:
- Generate a new password without special characters
- URL-encode the special characters
The PUID/PGID should match your user:
# Find your user ID
id -u
# Find your group ID
id -g
# Update .env if neededAlways check before committing:
# This should output: arcane/.env
git check-ignore arcane/.env
# This should NOT list .env
git statusIf .env appears in git status, check that:
.gitignoreexists in the repository root.gitignorecontains.envon its own line- You haven't accidentally staged it with
git add -f
To change your secrets (recommended quarterly):
-
Generate new secrets:
openssl rand -hex 32 # For ENCRYPTION_KEY openssl rand -hex 32 # For JWT_SECRET openssl rand -base64 32 # For POSTGRES_PASSWORD
-
Update
.envfile with new values -
Restart services:
docker compose down docker compose up -d --force-recreate
-
Verify application works:
docker compose logs -f
To update to the latest version:
# Pull the latest image
docker compose pull
# Recreate containers with new image
docker compose up -d
# Check logs for any issues
docker compose logs -f arcaneYour data is stored in:
- Arcane data:
/mnt/SSD/Containers/arcane - PostgreSQL data:
/mnt/SSD/Containers/arcane-postgres
Back these up regularly:
# Stop containers first
docker compose down
# Backup (example using tar)
tar -czf arcane-backup-$(date +%Y%m%d).tar.gz \
/mnt/SSD/Containers/arcane \
/mnt/SSD/Containers/arcane-postgres
# Restart containers
docker compose up -dDon't forget to backup your .env file securely (encrypted)!
- Arcane GitHub Repository
- Docker Compose Environment Variables Documentation
- OWASP Secrets Management Cheat Sheet
- OpenSSL Random Generation
For issues with:
- Arcane application: GitHub Issues
- This Docker Compose setup: Check the HomeLab repository
This configuration is part of the HomeLab project. See the repository LICENSE file for details.