Configuration
comprehensive guide to environment variables and runtime settings
Drivebase uses environment variables for configuration. You can set these in a .env or .env.local file in the project root, or pass them directly to your Docker container.
Environment Variables
Application
NODE_ENV: Set toproductionfor production deployments,developmentfor local work.
API Server
PORT: The port the API server listens on (default:4000).APP_URL: The full URL where the app is accessible (e.g.,http://localhost:3000).
Database & Redis
DATABASE_URL: PostgreSQL connection string (e.g.,postgres://user:pass@host:5432/db).REDIS_URL: Redis connection string (e.g.,redis://localhost:6379).
Security
JWT_SECRET: A long, random string used to sign JSON Web Tokens.ENCRYPTION_KEY: A 32-character string used to encrypt sensitive provider credentials in the database.DEFAULT_OWNER_EMAIL: (Optional) Automatically create an owner account with this email on first boot.DEFAULT_OWNER_PASSWORD: (Optional) Password for the default owner account.
Web Client
VITE_PUBLIC_BASE_URL: The public API base URL used by the browser (e.g.,http://localhost:4000). The app appends/graphqlautomatically for GraphQL.
Telemetry
DRIVEBASE_TELEMETRY: Set tofalseto disable anonymous usage telemetry (default:true). See Telemetry for details on what is collected.
Generating Secure Keys
For JWT_SECRET and ENCRYPTION_KEY, you should generate strong random strings. You can use the following command:
openssl rand -base64 32Example Configuration
NODE_ENV=production
PORT=4000
APP_URL=https://app.drivebase.io
DATABASE_URL=postgres://drivebase:securepassword@db.example.com:5432/drivebase
REDIS_URL=redis://redis.example.com:6379
JWT_SECRET=xY7z... (at least 32 characters)
ENCRYPTION_KEY=aB1c... (exactly 32 characters recommended)
VITE_PUBLIC_BASE_URL=https://api.drivebase.io