---
title: "Configure a self-hosted install"
description: "Set up email, file storage, sign-up, OAuth apps for connected accounts, the Slack app and telemetry on a self-hosted Anlyon install, in the console or in the .env file."
sidebar:
  label: Configure
---

A self-hosted install is configured in the console, under **Settings → Instance**. Only instance admins see it. The owner is one, and can make others. A change applies at once, without a restart.

The `.env` file holds only what the server needs before it can reach its database. Every other setting can also be set there, which suits installs managed by automation.

## Know where a setting comes from

Each setting is read in this order:

1. **The environment.** A variable set in `.env` wins. The console shows the value read-only, marked "set by environment".
2. **The console.** The value an instance admin saved in **Settings → Instance**.
3. **The default.**

A secret, such as the SMTP password or an OAuth client secret, is stored encrypted. The console shows only whether it is set and when it last changed, never the value.

After you edit `.env`, restart the containers so they read it. With the one-line installer:

```bash
cd /opt/anlyon
sudo docker compose up -d
```

From a clone, run `docker compose up -d` in `deploy/self-host`.

## Read the .env file

The installer writes these. Leave them as they are unless you know why you are changing them.

| Variable | What it is |
| --- | --- |
| `EDITION` | `community`, `team` or `enterprise`. Any other value stops the server at start. See [Licences](/self-hosting/licences) |
| `ANLYON_PUBLIC_URL` | The address the console and the API are served at, such as `https://anlyon.example.com` |
| `SITE_ADDRESS` | The host name Caddy serves and gets a certificate for |
| `ANLYON_PORT`, `ANLYON_HTTPS_PORT` | The ports Caddy listens on: 80 and 443 with a domain, 8080 and 8443 without one |
| `ANLYON_BIND` | The address the ports are published on: `127.0.0.1` for a `localhost` install, else every interface |
| `ANLYON_ROOT_KEY` | The one secret every other key is derived from. See [Security](/self-hosting/security#the-root-key) |
| `ANLYON_SETUP_TOKEN` | Opens the setup page once, to create the owner. Unused afterwards |
| `POSTGRES_PASSWORD`, `DATABASE_URL`, `REDIS_URL` | The bundled Postgres and Redis |

Two settings stay in the environment on purpose:

- **`EDITION`** decides which parts of the server exist when it starts, so it cannot change under a running server.
- **`ENFORCE_HTTPS`** follows the scheme of your public address. Turning it on over plain HTTP would lock you out of the console that could turn it off.

## Set up email

Email carries invitations, password resets and notifications. Set an SMTP server and a sender address, then send a test from the console.

| Setting | Variable | Value |
| --- | --- | --- |
| SMTP server | `SMTP_URL` | `smtp://user:password@host:587` or `smtps://user:password@host:465`. Unset means email is off |
| Sender address | `FROM_EMAIL` | The address email is sent from |
| Notification email alert | `NOTIFICATION_EMAIL_ALERT_THRESHOLD` | Log a warning each time one workspace's notification emails in a month pass a multiple of this number. Nothing is blocked. `0` turns it off. 10,000 by default |

Without email, Anlyon still works. Invitation links are shown in the console for you to pass on, and new accounts skip address confirmation.

## Set up file storage

File storage holds log archives. Choose none, a directory on the server, or any S3-compatible store such as AWS S3, MinIO or Ceph. The console tests a store before you rely on it.

| Setting | Variable | Value |
| --- | --- | --- |
| File storage | `STORAGE_BACKEND` | `none`, `local` or `s3` |
| Local directory | `STORAGE_LOCAL_DIR` | Where local storage writes. The bundled Compose file sets it to a directory on the `anlyon_data` volume |
| S3 endpoint | `S3_ENDPOINT` | For MinIO, Ceph and other S3-compatible stores. Empty for AWS S3 |
| S3 region | `S3_REGION` | The bucket's region. `us-east-1` by default |
| S3 bucket | `S3_BUCKET` | The bucket name |
| S3 access key id | `S3_ACCESS_KEY_ID` | The access key id |
| S3 secret access key | `S3_SECRET_ACCESS_KEY` | The secret access key |
| Path-style URLs | `S3_FORCE_PATH_STYLE` | `true` by default. MinIO and most self-hosted stores need it |
| Audit records kept in the database | `AUDIT_HOT_DAYS` | Days an audit record stays in the database before it moves to the archive. 30 to 365, 90 by default |
| Pause the audit archive | `AUDIT_ARCHIVE_PAUSED` | `true` stops moving audit records to the archive. Records stay in the database meanwhile |

## Decide who may sign up

| Value of `SIGNUP_MODE` | Who may create an account |
| --- | --- |
| `invite` | Only people holding an invitation. The default |
| `open` | Anyone who can reach the console |
| `closed` | Nobody. Accounts come from the command line; see [Locked out](/self-hosting/operate#locked-out) |

## Connected accounts

People connect their accounts at a service in two ways: by signing in, or with an API key. An API key needs nothing from you. Signing in needs an OAuth app that you register with the provider, once for the whole install. A provider without an OAuth app is not offered on your server.

1. **Register an OAuth app with the provider**

    In the provider's developer settings, create an OAuth app and set its redirect URL to your address followed by `/api/v2/connection-consent/callback`:

    ```text
    https://anlyon.example.com/api/v2/connection-consent/callback
    ```

2. **Paste its client id and secret**

    In **Settings → Instance → OAuth apps**, paste the app's client id and client secret. Or set the two variables below in `.env`.

| Provider | Variables |
| --- | --- |
| HubSpot | `HUBSPOT_OAUTH_CLIENT_ID`, `HUBSPOT_OAUTH_CLIENT_SECRET` |
| Slack, for connected accounts | `SLACK_OAUTH_CLIENT_ID`, `SLACK_OAUTH_CLIENT_SECRET` |
| Google, for Calendar and Gmail | `GOOGLE_OAUTH_CLIENT_ID`, `GOOGLE_OAUTH_CLIENT_SECRET` |
| Linear | `LINEAR_OAUTH_CLIENT_ID`, `LINEAR_OAUTH_CLIENT_SECRET` |
| Salesforce | `SALESFORCE_OAUTH_CLIENT_ID`, `SALESFORCE_OAUTH_CLIENT_SECRET` |
| GitHub, an OAuth app or a GitHub App | `GITHUB_OAUTH_CLIENT_ID`, `GITHUB_OAUTH_CLIENT_SECRET` |
| Notion, a public integration | `NOTION_OAUTH_CLIENT_ID`, `NOTION_OAUTH_CLIENT_SECRET` |

[Connected accounts](/execution/connected-accounts) covers what Anlyon asks for at each provider, and [Connect a service](/execution/connect-a-service) compares signing in, API keys and MCP servers.

## Set up the Slack app

The Slack app posts notifications and approval requests to Slack, and receives approve and deny clicks. It is separate from the Slack OAuth app for connected accounts above.

Create a Slack app and set these URLs in it. The console shows them with your address filled in.

| In the Slack app | URL |
| --- | --- |
| Redirect URL (OAuth) | `https://anlyon.example.com/api/v2/integrations/slack/callback` |
| Redirect URL (linking members) | `https://anlyon.example.com/api/slack/identity/callback` |
| Interactivity request URL | `https://anlyon.example.com/api/slack/interactions` |

Then paste its credentials in **Settings → Instance → Slack app**, or set them in `.env`:

| Setting | Variable |
| --- | --- |
| Client id | `SLACK_CLIENT_ID` |
| Client secret | `SLACK_CLIENT_SECRET` |
| Signing secret, which verifies that clicks come from Slack | `SLACK_SIGNING_SECRET` |

See [Slack approvals](/trust-control/slack-approvals) for how approvals work in Slack.

## Check MCP servers for changed tools

Anlyon lists each [governed MCP server](/execution/mcp-servers) again on a schedule, so people hear that a tool changed before an agent calls it. Every call checks its tool whatever this is set to.

| Setting | Variable | Value |
| --- | --- | --- |
| Check tools every | `MCP_TOOL_CHECK_INTERVAL_HOURS` | 1 to 168 hours, 24 by default |

## Keep private addresses out of reach

**Network** decides whether audit sinks and secret stores may reach addresses on your private network, such as an internal Splunk or a Vault at `10.0.0.5`. Private addresses are `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16` and `localhost`.

| Value of `PRIVATE_NETWORK_DESTINATIONS` | What it means |
| --- | --- |
| `workspace` | Each workspace's admins decide for their own workspace. Off until they turn it on. The default |
| `off` | No workspace may, whatever it chose. Public addresses only |

Link-local and cloud metadata addresses are never reachable.

## Telemetry

Once a day, after setup is done, the server sends one small anonymous report to `https://telemetry.anlyon.com/v1/ping`. It tells us how many installs exist and which parts are used. It holds exactly these fields:

| Field | What it is |
| --- | --- |
| `schema` | `anlyon.telemetry.v1` |
| `instanceId` | A random id made for this install on its first report. It is not derived from anything about the install |
| `version` | The build's commit |
| `edition` | `community`, `team` or `enterprise` |
| `day` | The date the counts end on |
| `counts.workspaces`, `counts.members`, `counts.actions` | How many exist |
| `counts.invocations` | Action invocations in the last 24 hours |
| `counts.effectsByGrade` | Effects in the last 24 hours, by receipt grade: confirmed, acknowledged, unknown, failed, refused, denied, pending |
| `counts.approvalsRequested`, `counts.approvalsDecided` | Approvals in the last 24 hours |

It never holds names, email addresses, host names, IP addresses, URLs, payloads, action names or licence details. **Settings → Instance → Anonymous telemetry** shows the exact next report. A report that cannot be delivered is dropped after five seconds: nothing waits for it, and nothing retries.

To turn it off, switch it off in **Settings → Instance**, or set this in `.env` and restart:

```bash
ANLYON_TELEMETRY=off
```

## Related

**[Operate](/self-hosting/operate)**

Status, logs, upgrades, backups and getting back in.

**[Licences](/self-hosting/licences)**

Activate a Team or Enterprise key.
