Skip to main content

SafariDesk Self-Hosted Configuration

SafariDesk self-hosting is configured through one root .env file. Start from:
Do not commit .env. Related pages:

Configuration Rules

Use these rules for production:
  • Replace every change-me-* value.
  • Keep secrets out of Git.
  • Use one public hostname unless you intentionally configure split-domain routing.
  • Keep DEBUG=false.
  • Keep PostgreSQL and Redis private inside Docker Compose.
  • Pin SAFARIDESK_IMAGE_TAG to a release tag.
  • Back up .env securely with your infrastructure secrets, not in this repository.

Minimum Production Values

At minimum, update these before public deployment:
For production image pinning:

Same-Domain URL Configuration

Same-domain deployment is the default and recommended setup. Example:
Recommended .env values:
Frontend public variables should stay path-based:
When VITE_WS_NOTIFICATIONS_URL and VITE_CHAT_WS_BASE are empty, the frontend derives WebSocket URLs from the browser origin.

Split-Domain URL Configuration

Split-domain deployment is supported for advanced deployments. Example:
Example .env values:
Use deploy/nginx/split-domain.conf as the starting point if you need this model.

App Identity

Production example:

Docker Images

Production example:
See Docker Images and Releases.

Domains and URLs

Use https:// values in production.

Frontend Public Config

These variables are passed as Docker build args to frontend/Dockerfile and are baked into the Vite frontend build. Important: changing VITE_* values requires rebuilding the frontend image.

Security

Generate secrets with your password manager or a secure random generator. Example:

Database

Do not expose PostgreSQL directly to the internet.

Redis and Celery

If you set REDIS_PASSWORD, update Celery URLs too. Example:

Email and SMTP

Use either TLS or SSL according to your provider. Do not set both to true unless your SMTP provider explicitly requires it.

Admin Bootstrap

Create the admin user with:

Mail Integrations and OAuth

Placeholder provider links:

Integrations

Leave unused integrations empty.

AI Providers

Leave GEMINI_API_KEY empty if AI features are not enabled.

Billing and Licensing

Placeholder links:

Optional Ports

Example for local testing on a busy host:
Then open:

Docker Log Container Names

The environment file includes container names used by backend admin log features:
The Docker socket is not mounted into the backend by default for security reasons. Features that require host Docker access must be treated as an explicit operational exception, not a default self-hosting requirement.

Rebuild Requirements

Changes to these variables require a frontend rebuild because they are baked into the Vite build:
  • VITE_API_URL
  • VITE_WS_NOTIFICATIONS_URL
  • VITE_CHAT_WS_BASE
  • VITE_SITE_URL
  • VITE_ALLOW_OTP
Rebuild locally:
When using published images, update these values in the image build pipeline before publishing a new frontend image. Most backend .env changes only require restarting services:
For secrets and connection strings, restart all backend runtime services: