Environment Configuration
Environment Configuration
NuSaaS requires two files: /opt/nusaas/.env for Laravel and Compose, and /opt/nusaas/web/.env.frontend for runtime frontend configuration. The interactive installer creates both. Manual installers should download the maintained templates instead of assembling variables from snippets:
mkdir -p /opt/nusaas/web && cd /opt/nusaas
curl -fsSL https://get.nusaas.com/.env.selfhosted -o .env
curl -fsSL https://get.nusaas.com/.env.frontend -o web/.env.frontend
Required backend values
Set all CHANGE_ME values. In particular:
APP_KEY,JWT_SECRET, and the threeREVERB_APP_*values must be unique random secrets.DB_USERNAMEmust be a non-root MySQL user. Set different strong values forDB_PASSWORDandDB_ROOT_PASSWORD.- Keep the Docker service names
DB_HOST=db,REDIS_HOST=cache,MEILISEARCH_HOST=http://search:7700, andREVERB_HOST=ws. - Keep
CORS_ALLOWED_ORIGIN_PATTERNSquoted. Its leading#is part of the regex; without quotes dotenv treats it as a comment. - Set
INITIAL_ADMIN_EMAILandINITIAL_ADMIN_PASSWORDbefore runningmigrate --seed; the seeder creates the first system administrator. - For SMTP on port 587, keep
MAIL_SCHEME=nullunless your provider requires another scheme. Usesmtpsfor implicit TLS providers.
Generate secrets with:
printf 'base64:' && openssl rand -base64 32
openssl rand -hex 32
openssl rand -hex 8
openssl rand -hex 10
openssl rand -hex 32
Required frontend values
- Set both
VITE_API_URLandVITE_API_BASE_URLto the API origin, for examplehttps://api.yourdomain.com. Do not append/api. - Keep
VITE_DEPLOYMENT=self-hostedandVITE_BILLING_ENABLED=false. VITE_REVERB_APP_KEYmust exactly match backendREVERB_APP_KEY.- When Nginx exposes Reverb through the API hostname, use
VITE_REVERB_HOST=api.yourdomain.com, port443, and schemewss. - Point
VITE_DOCS_URLand the support/legal variables at your own installation. - Leave Google, Firebase, Sentry, SMS, and other integration credentials blank until you configure those services.
Validate file paths and required Compose variables without printing the resolved configuration:
docker compose config --quiet