Skip to content

Environment Variables

ScanPick is configured entirely through environment variables. No config files, no YAML, no JSON settings.

VariableDescriptionExample
DATABASE_CONNECTION_STRINGPostgreSQL connection stringHost=localhost;Database=scanpick;Username=scanpick;Password=...
JWT_SECRETJWT signing key (64+ characters)Generated via openssl rand -base64 48 | tr -d '/+=' | head -c 64
VariableDefaultDescription
ASPNETCORE_URLShttp://+:5000API listen address
ASPNETCORE_ENVIRONMENTProductionSet to Development for detailed errors + Scalar API explorer
DISABLE_AUTO_SEEDfalseSkip automatic database seeding on first startup
SETUP_TOKEN(none)Require first-run setup page before API serves requests
Host=<host>;Port=<port>;Database=<database>;Username=<user>;Password=<password>

Examples:

Terminal window
# Local Docker PostgreSQL
DATABASE_CONNECTION_STRING="Host=localhost;Port=5432;Database=scanpick;Username=scanpick;Password=devpassword"
# Remote PostgreSQL with SSL
DATABASE_CONNECTION_STRING="Host=db.example.com;Port=5432;Database=scanpick;Username=scanpick;Password=...;SSL Mode=Require"
Terminal window
export DATABASE_CONNECTION_STRING="Host=localhost;Database=scanpick;Username=scanpick;Password=..."
export JWT_SECRET="your-64-char-secret"
./ScanPick.Api

Set variables in the .env file in the project root:

POSTGRES_PASSWORD=devpassword
JWT_SECRET=your-64-char-secret
Terminal window
docker run -e DATABASE_CONNECTION_STRING="..." -e JWT_SECRET="..." scanpick-api
  • Generate a strong JWT_SECRET (64+ random characters)
  • Set ASPNETCORE_ENVIRONMENT to Production
  • Use a dedicated PostgreSQL user (not postgres superuser)
  • Enable SSL for database connections over the network
  • Configure a reverse proxy for TLS termination
  • Set up regular PostgreSQL backups
  • Verify the API starts successfully and serves the dashboard