Welcome to Nebutra Sailor Docs 🎉
ChangelogIntroductionLicensing
Help Center (External) ↗

Configuration Overview

How Nebutra-Sailor manages runtime configuration — validation at startup, three categories of variables, and where to set them per environment.

How configuration works

Nebutra-Sailor validates every environment variable at application startup through the @nebutra/config package. If a required variable is missing or malformed, the process exits immediately with a clear error message that names the offending variable — there is no silent fallback.

Error: [config] Missing required environment variable: DATABASE_URL
  at validateConfig (packages/platform/config/src/index.ts:42)

This fail-fast pattern means broken deployments surface in seconds rather than producing runtime errors hours later in production.

The validation source of truth lives at packages/platform/config/src/index.ts. Every app imports from this package, so config changes propagate to all apps automatically.

Three categories of variables

The application will not start without these variables. They cover core infrastructure: the database connection, authentication provider, payment processor, and transactional email.

See Environment Variables for the complete list.

These variables have sensible defaults that work for local development. In production you should override them with real service credentials.

Examples include storage provider selection, AI model keys, Redis URL, and analytics tokens.

There is no feature-flags capability in the scaffold. The old --feature-flags scaffold flag and its provider choices were removed and nothing replaces them — see Feature Flags for what to use instead.

Where to set variables

Create a .env.local file in the repo root (or per-app). This file is gitignored by default.

cp .env.example .env.local
# Fill in your values

Never commit .env, .env.local, or any file containing real secrets to git. The repo .gitignore excludes these files, but double-check before every commit.

The template doesn't bake in a deploy target — it produces portable output (a Next standalone build and Dockerfile.web + docker-compose.yml). Wherever you run that output, set the production values through that platform's own environment-variable mechanism (a dashboard, a secrets manager, --env-file, …).

Pass variables through your Docker Compose env file or Kubernetes Secret:

services:
  web:
    env_file:
      - .env.production

Or inject them directly:

docker run --env-file .env.production nebutra/web:latest

Generating secrets

For secrets that require a cryptographically random value (e.g., BETTER_AUTH_SECRET, SERVICE_SECRET, signing keys):

openssl rand -base64 32

Never reuse the same secret across environments.

Variables prefixed with NEXT_PUBLIC_ are embedded into the client bundle at build time. They are visible to end users. Never put secrets in NEXT_PUBLIC_ variables.

Related

Environment Variables

Full reference table of every variable name, its requirement level, default value, and purpose.

Feature Flags

Why the scaffold doesn't have a feature-flags capability.

Deployment

Deploying the portable Docker / standalone output wherever you want.

Troubleshooting

Common startup errors and how to resolve them.

How is this guide?

Edit on GitHub

Last updated on

On this page

How configuration works
Three categories of variables
Where to set variables
Generating secrets
Related