Skip to main content
This page documents all environment variables available in the AdonisJS Starter Kit. These variables are defined in apps/web/.env.example and should be configured in your apps/web/.env file.

Application Settings

APP_KEY
string
required
Cryptographically secure key used for encryption and signing. Generate using node ace generate:key.
NODE_ENV
string
default:"development"
Application environment. Set to production for production deployments.Options: development, production, test
TZ
string
default:"UTC"
Timezone for the application. Used for date/time operations.
LOG_LEVEL
string
default:"info"
Logging level for the application.Options: trace, debug, info, warn, error, fatal

Server Configuration

PORT
number
default:"3333"
Port number on which the application server will listen.
HOST
string
default:"localhost"
Hostname for the application server.

Session & Storage

SESSION_DRIVER
string
default:"cookie"
Driver for session storage.Options: cookie, file, redis, memory
DRIVE_DISK
string
default:"fs"
Default disk for file storage using AdonisJS Drive.Options: fs (filesystem), s3, gcs

Database Configuration

DB_HOST
string
default:"127.0.0.1"
PostgreSQL database host address.
DB_PORT
number
default:"5432"
PostgreSQL database port.
DB_USER
string
default:"root"
PostgreSQL database username.
DB_PASSWORD
string
default:"root"
PostgreSQL database password.
DB_DATABASE
string
default:"app"
PostgreSQL database name.

Email Configuration

RESEND_API_KEY
string
API key for Resend email service. Get your key from resend.com.
EMAIL_FROM
string
Default sender email address for outgoing emails.

SMTP (Alternative)

SMTP_HOST
string
default:"localhost"
SMTP server hostname. Use localhost with Mailpit for local development.
SMTP_PORT
number
default:"1025"
SMTP server port. Mailpit uses port 1025 by default.
SMTP_USERNAME
string
SMTP authentication username.
SMTP_PASSWORD
string
SMTP authentication password.
SMTP_SECURE
boolean
default:"0"
Enable TLS/SSL for SMTP connection.Values: 0 (disabled), 1 (enabled)
SMTP_REJECTUNAUTHORIZED
boolean
default:"false"
Reject unauthorized SSL certificates.Values: true, false

Social Authentication

Google OAuth

GOOGLE_CLIENT_ID
string
Google OAuth client ID. Get from Google Cloud Console.
GOOGLE_CLIENT_SECRET
string
Google OAuth client secret. Get from Google Cloud Console.
Additional social providers can be configured using the @adonisjs/ally package.

Frontend Configuration

VITE_API_URL
string
default:"http://localhost:3333"
API URL used by the frontend Vite build. This should match your server’s address.

Rate Limiting

LIMITER_STORE
string
default:"database"
Storage backend for rate limiting.Options: database, redis, memory

Environment File Setup

Development

  1. Copy the example file:
    cp apps/web/.env.example apps/web/.env
    
  2. Generate your app key:
    node apps/web/ace generate:key
    
  3. Configure database credentials (if using Docker, defaults should work)
  4. Configure email provider (Resend or SMTP)
  5. (Optional) Set up social authentication providers

Production

For production deployments:
  • Set NODE_ENV=production
  • Use strong, randomly generated passwords
  • Configure production database credentials
  • Set up proper email service (Resend recommended)
  • Configure social auth with production OAuth credentials
  • Use HTTPS URLs for VITE_API_URL
Never commit your .env file to version control. The .env.example file should only contain placeholder values.

Build docs developers (and LLMs) love