Skip to the content.

Environment Variables

Configuration reference for environment variables across Local, Development, Test, and Production.

Environment matrix

SYS_ENV Nitro preset Data store Typical trigger
local node-server SQLite (DATABASE_URL=file:./data/local.sqlite) Developer machine
development node-server PostgreSQL Docker Compose / PR build on development
test aws_lambda DynamoDB Push to main (SAM, after CI)
production aws_lambda DynamoDB GitHub Release published or manual workflow_dispatch

Legacy SYS_ENV=remote is treated as development (.output/development and Postgres store selection). All four envs write {workspaceRoot}/.output/<sysEnv> via scripts/nitro-output-dir.mjs.

CI/CD triggers, Docker/SAM commands, and GitHub Environment secrets: docs/cicd.md.

Example templates (no secrets):

SYS_ENV

SYS_ENV=local npm run build
SYS_ENV=test npm run build   # aws_lambda preset

Database / AWS (private runtimeConfig)

These map to Nuxt runtimeConfig private keys (databaseUrl, dynamoTable, dynamoPostsTable, awsRegion). Prefer NUXT_* prefixes for runtime overrides (firstNonEmptyEnv in core/web/resolve-process-env.ts prefers NUXT_* over plain names).

Adapter selection and per-env key matrix: docs/web/data-stores.md.

DATABASE_URL

DYNAMO_TABLE

DYNAMO_POSTS_TABLE

AWS_REGION

ADMIN_TOKEN / NUXT_ADMIN_TOKEN

CORS_ALLOW_ORIGIN

CDN Configuration

NUXT_APP_CDN_URL

NUXT_APP_CDN_URL=https://cdn.example.com npm run build

Node Environment

NODE_ENV

NODE_ENV=production npm run build

Canonical runtime for CI/CD/Docker/SAM is Node.js 24 (see docs/cicd.md).

Deployment

DEPLOYMENT

DEPLOYMENT=server npm run build

Development Server

HOST

PORT

HOST=0.0.0.0 PORT=4200 npm run dev

Map tgmc-portfolio.local / tgmc-portfolio.test127.0.0.1 in the hosts file when using those names.

Nx Cloud

NX_CLOUD_ACCESS_TOKEN

Create a token in Nx Cloud → your workspace → Access Tokens. Do not commit real tokens to .env.example.

# Local (after copying token into .env or exporting)
export NX_CLOUD_ACCESS_TOKEN=your-token
npm run test
# GitHub Actions (one-time)
gh secret set NX_CLOUD_ACCESS_TOKEN --body "your-token"

HTTPS

HTTPS

HTTPS=1 npm run dev

SSL_CERT

SSL_KEY

HTTPS=1 SSL_CERT=/path/to/cert.crt SSL_KEY=/path/to/key.key npm run dev

Common Combinations

Local (SQLite)

Copy .env.example to .env (defaults: SYS_ENV=local, DATABASE_URL=file:./data/local.sqlite). The SQLite file lives under data/ (gitignored).

npm run db:migrate:local
SYS_ENV=local DATABASE_URL=file:./data/local.sqlite npm run dev

Public blog: /blog. Admin (Docker only): npm run docker:adminhttp://127.0.0.1:4400/admin.

Development (Postgres / Docker)

SYS_ENV=development DATABASE_URL=postgres://portfolio:portfolio@localhost:5432/portfolio npm run start

Test / Production build (Lambda)

SYS_ENV=test NODE_ENV=production DEPLOYMENT=server npm run build
SYS_ENV=production NODE_ENV=production DEPLOYMENT=server npm run build

Development (With CDN)

NUXT_APP_CDN_URL=https://cdn.example.com npm run dev

HTTPS Development

npm run start:ssl:4200

See Also