> ## Documentation Index
> Fetch the complete documentation index at: https://docs.safaridesk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Environment variables for SafariDesk self-hosting

# Configuration

SafariDesk reads configuration from the `.env` file located in `Core/`.

Tip: make a copy of `.env.example` as `.env` and edit with your editor. Keep secrets safe.

## Required settings (basic install)

Database (Postgres container in Docker Compose):

```bash theme={null}
DB_ENGINE=django.db.backends.postgresql
DB_NAME=safaridesk
DB_USER=postgres
DB_PASSWORD=your-password
DB_HOST=db
DB_PORT=5432
```

Redis and Celery (required for background jobs):

```bash theme={null}
REDIS_HOST=redis
REDIS_PORT=6379
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0
```

Superuser (used for first login):

```bash theme={null}
SUPERUSER_USERNAME=admin
SUPERUSER_PASSWORD=your-password
SUPERUSER_EMAIL=admin@yourdomain.com
```

## Recommended settings (email, URLs)

Email (required if you need outgoing mail):

```bash theme={null}
EMAIL_HOST=smtp.yourprovider.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=support@yourdomain.com
EMAIL_HOST_PASSWORD=your-password
DEFAULT_FROM_EMAIL=support@yourdomain.com
DEFAULT_FROM_NAME=SafariDesk
```

Public URLs (update when using a domain or reverse proxy):

```bash theme={null}
FRONTEND_URL=https://helpdesk.yourdomain.com
DOMAIN_NAME=yourdomain.com
VITE_API_URL=https://api.yourdomain.com/api/v1
```

## Optional: AI and embeddings

If you plan to enable AI features, set keys and models:

```bash theme={null}
GEMINI_API_KEY=your-gemini-api-key
GEMINI_MODEL=gemini-flash-latest
EMBEDDING_MODEL=gemini-embedding-001
```

## Enterprise licensing settings

If you are using the self-hosted enterprise edition, you must configure licensing during setup.

Common values required for enterprise activation:

* License key
* Stable instance ID
* Deployment type (`self_hosted`)
* Edition (`enterprise`)
* Hostname
* Response signing secret used to verify license responses

The architecture and validation flow are documented in [Architecture](./architecture).

If SafariDesk support provided specific environment variable names for your build, add them to `.env` and restart the stack:

```bash theme={null}
docker compose up -d --build
```

Then validate by checking API logs:

```bash theme={null}
docker compose logs --tail 200 api
```

## Notes

* For production, use strong random `SECRET_KEY` and secure passwords
* Keep backups of `.env` but never commit it to source control
* After changing `.env`, restart the stack: `docker compose up -d --build`
