Skip to content

Configuration

Imprime is configured with environment variables — in .env at the repository root when using Docker Compose or running from source, or passed directly to the container.

Variable Required Default Description
MONGODB_URI ✅ — MongoDB connection string, e.g. mongodb://mongodb:27017/imprime. Used for templates and for authentication data.
BETTER_AUTH_SECRET ✅ — Secret used to sign sessions and tokens. Generate with openssl rand -base64 32; keep it stable.
PUBLIC_APP_URL ✅ — Public origin of the instance, without trailing slash (https://imprime.example.com). Used for auth callbacks, OAuth discovery and MCP download links.
PORT 3001 (3023 in Compose) HTTP port the server listens on.
NODE_ENV — Set to production to serve the editor from the same process (done by Compose).
CORS_ORIGIN http://localhost:5173 Allowed browser origin(s), comma-separated. Also used as trusted origins by authentication. * allows any origin without credentials.

Each provider is enabled only when both its client ID and secret are set. See Authentication & SSO.

Variable Default Description
GOOGLE_CLIENT_ID Google OAuth client ID
GOOGLE_CLIENT_SECRET Google OAuth client secret
MICROSOFT_CLIENT_ID Microsoft Entra ID application (client) ID
MICROSOFT_CLIENT_SECRET Microsoft client secret
MICROSOFT_TENANT_ID common common, organizations, consumers or a tenant ID
GITHUB_CLIENT_ID GitHub OAuth app client ID
GITHUB_CLIENT_SECRET GitHub OAuth app client secret
Variable Default Description
REQUIRE_EMAIL_VERIFICATION false true to require users to verify their email before signing in. Requires SMTP.
SMTP_HOST SMTP server host. Email is disabled when empty.
SMTP_PORT 587 SMTP port
SMTP_SECURE false true for implicit TLS (forced when the port is 465)
SMTP_USER SMTP username
SMTP_PASS SMTP password
SMTP_FROM SMTP_USER Sender address, e.g. Imprime <no-reply@example.com>
Variable Description
VITE_API_URL Backend origin used by the Vite dev server (http://localhost:3023). Not needed in production, where the editor uses relative URLs.
.env
# Core
MONGODB_URI=mongodb://mongodb:27017/imprime
PUBLIC_APP_URL=https://imprime.example.com
CORS_ORIGIN=https://imprime.example.com
BETTER_AUTH_SECRET=9yH0m3c…replace-me…Q=
# SSO
GOOGLE_CLIENT_ID=1234567890-abc.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-…
# Email verification
REQUIRE_EMAIL_VERIFICATION=true
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=no-reply@example.com
SMTP_PASS=…
SMTP_FROM=Imprime <no-reply@example.com>