Environment Variables
Complete reference of .env configuration options.
Portabase provides flexibility through environment variables. These let you customize application behavior, database connection, authentication and storage.
If you use Docker Compose, set these variables in your .env file at the root of the project.
Project
General instance configuration.
| Variable | Type | Optional | Default | Description |
|---|---|---|---|---|
PROJECT_URL | string | No | http://localhost:8887 | Public URL of your dashboard (e.g. https://backups.my-domain.com). Important for generated links. |
PROJECT_SECRET | string | No | None | Critical. Secret used to encrypt sensitive data. Generate with openssl rand -hex 32. |
PROJECT_NAME | string | Yes | Portabase | Display name in the UI (site title). |
RETENTION_CRON | string | Yes | 0 7 * * * | Schedule for automatic deletion of backups according to the retention policies. |
LOG_LEVEL | string | Yes | info | Controls minimum log level. Options: debug, info, warn, error |
AUTH_DEFAULT_USER_NAME | string | Yes | None | The default user name |
AUTH_DEFAULT_USER | string | Yes | None | The default user email |
AUTH_DEFAULT_PASSWORD | string | Yes | None | Password must contain at least 8 characters, 1 number, 1 lowercase letter, 1 uppercase letter and 1 special character |
In case you want to seed the default user using .env variables, use AUTH_DEFAULT_USER_NAME, AUTH_DEFAULT_USER, and AUTH_DEFAULT_PASSWORD. These 3 variables must be filled.
API & MCP
Controls programmatic access to your dashboard.
| Variable | Type | Optional | Default | Description |
|---|---|---|---|---|
API_ENABLED | boolean | Yes | false | Enables all REST API routes under /api/v1. Required for both OpenAPI and MCP. |
OPENAPI_ENABLED | boolean | Yes | false | Enables the OpenAPI specification and Swagger UI at /api/v1/openapi and /api/v1/docs. Requires API_ENABLED=true. |
MCP_ENABLED | boolean | Yes | false | Enables the MCP server at /api/v1/mcp for AI assistant integrations. Requires API_ENABLED=true. |
Database
Configuration for the internal Portabase PostgreSQL connection.
| Variable | Type | Optional | Default | Description |
|---|---|---|---|---|
DATABASE_URL | string | Yes | None | Database URL (e.g., postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public). If not specified, the internal database will be used. |
Email (SMTP)
Configuration for transactional email delivery (alerts, invitations).
If no configuration is provided, email-related features will be limited (no password reset, no email verification).
| Variable | Type | Default | Description |
|---|---|---|---|
SMTP_HOST | string | None | SMTP server address (e.g. smtp.resend.com). |
SMTP_PORT | string | None | SMTP server port (e.g. 587). |
SMTP_USER | string | None | SMTP username. |
SMTP_PASSWORD | string | None | SMTP password. |
SMTP_FROM | string | None | From email address (e.g. no-reply@your-domain.com). |
SMTP_SECURE | string | false |
Last updated on