Skip to content

Environment Variables

All configuration is done via environment variables. For Docker Compose deployments, copy apps/web/.env.example to .env in the repo root and edit it.

These variables are required for TheTerms to start.

VariableRequiredDescriptionExample
DATABASE_URLYesPostgreSQL connection string. Set automatically by Docker Compose.postgresql://postgres:password@localhost:5432/theterms
REDIS_URLYesRedis connection string. Set automatically by Docker Compose.redis://localhost:6379
NEXTAUTH_URLYesFull public URL of the app, including protocol. Must match your domain exactly.https://your-domain.com
NEXTAUTH_SECRETYesRandom secret for signing JWT session tokens. Generate with openssl rand -base64 32.your-secret-here
NEXT_PUBLIC_APP_URLYesSame value as NEXTAUTH_URL. Used in client-side code.https://your-domain.com

Required for sending signing invitations and team invitations.

VariableRequiredDescriptionExample
RESEND_API_KEYFor emailsResend API key. Without this, emails won’t send.re_your_key_here
EMAIL_FROMFor emailsSender address shown in emails.TheTerms <noreply@yourdomain.com>

Optional. Required only if you want Google or Microsoft sign-in.

VariableRequiredDescription
GOOGLE_CLIENT_IDNoGoogle OAuth 2.0 client ID
GOOGLE_CLIENT_SECRETNoGoogle OAuth 2.0 client secret
MICROSOFT_CLIENT_IDNoMicrosoft Azure AD application (client) ID
MICROSOFT_CLIENT_SECRETNoMicrosoft Azure AD client secret

To enable Google OAuth, create credentials at console.cloud.google.com. Set the authorized redirect URI to https://your-domain.com/api/auth/callback/google.

To enable Microsoft OAuth, register an app at portal.azure.com. Set the redirect URI to https://your-domain.com/api/auth/callback/azure-ad.

Optional. Required only if you use Supabase Storage for file attachments.

VariableRequiredDescription
NEXT_PUBLIC_SUPABASE_URLNoYour Supabase project URL
SUPABASE_SERVICE_ROLE_KEYNoSupabase service role key (server-side only)

These variables are read by docker-compose.yml to configure the stack. Set them in your .env file in the repo root.

VariableDefaultDescription
PORT3000Host port to expose the app on
POSTGRES_PASSWORDpasswordPassword for the postgres database user