Environment Variables

Complete reference for Supascale environment variables.

Supascale is configured through environment variables stored in .env.local. This reference covers all available options.

Required Variables

These must be set for Supascale to function:

Authentication

VariableDescriptionExample
NEXTAUTH_URLBase URL of your Supascale installationhttps://supascale.example.com
NEXTAUTH_SECRETSecret key for session encryptionopenssl rand -base64 32

Database Encryption

VariableDescriptionExample
DB_ENCRYPTION_KEY64-character hex key for encrypting stored credentialsopenssl rand -hex 32

Directory Configuration

VariableDefaultDescription
PROJECTS_BASE_DIRUser home directoryWhere Supabase projects are stored
BACKUPS_BASE_DIR~/.supascale_backupsWhere backups are stored
SUPASCALE_DATA_DIR./dataSQLite database location

Application Settings

VariableDefaultDescription
PORT3000Application port
NODE_ENVdevelopmentEnvironment mode (production or development)

Admin Account (Install Only)

Set during installation, then removed:

VariableDescription
ADMIN_USERNAMEInitial admin username
ADMIN_PASSWORDInitial admin password (immediately hashed)

Remove ADMIN_PASSWORD from environment after installation. Passwords are hashed in the database.

Email Configuration

For email notifications (optional):

VariableDefaultDescription
SMTP_HOST-SMTP server hostname
SMTP_PORT587SMTP port
SMTP_USER-SMTP username
SMTP_PASSWORD-SMTP password
SMTP_FROM-From email address
NOTIFICATION_EMAIL-Admin notification email

Example SMTP Configuration

# Gmail
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password
SMTP_FROM=your-email@gmail.com

# SendGrid
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=your-api-key
SMTP_FROM=noreply@yourdomain.com

License Configuration

VariableDescription
LICENSE_EMAILEmail associated with your license
UPDATE_TOKENToken for automatic updates

Get these from your license dashboard.

Development Options

For development only:

VariableDefaultDescription
SKIP_LICENSE_CHECKfalseSkip license validation (dev only)

Never use SKIP_LICENSE_CHECK in production. This is for development testing only.

Generating Secrets

NEXTAUTH_SECRET

openssl rand -base64 32

Output: K7gNU3sdo+OL0wNhqoVWhr3g6s1xYv72ol/pe/Unols=

DB_ENCRYPTION_KEY

openssl rand -hex 32

Output: a1b2c3d4e5f6... (64 characters)

Complete Example

# /opt/supascale-web/.env.local

# === Required ===
NEXTAUTH_URL=https://supascale.example.com
NEXTAUTH_SECRET=your-generated-secret
DB_ENCRYPTION_KEY=your-64-char-hex-key

# === Directories ===
PROJECTS_BASE_DIR=/var/supascale/projects
BACKUPS_BASE_DIR=/var/supascale/backups

# === Application ===
PORT=3000
NODE_ENV=production

# === License ===
LICENSE_EMAIL=you@example.com
UPDATE_TOKEN=your-update-token

# === Email (Optional) ===
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=your-sendgrid-key
SMTP_FROM=noreply@example.com
NOTIFICATION_EMAIL=admin@example.com

Applying Changes

After modifying environment variables:

# Restart Supascale
pm2 restart supascale-web

# Verify it's running
pm2 status

Security Best Practices

  1. Never commit .env.local to version control
  2. Use strong secrets generated with cryptographic tools
  3. Rotate secrets periodically by generating new ones
  4. Limit file permissions: chmod 600 .env.local
  5. Back up your configuration securely