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

# Run & maintain your node

> Operate a self-hosted Hushgard node — configuration reference, licensing states, address verification, health checks, updates, backups, calls behind NAT, moving domains and setting up AI models.

## Configuration reference

All settings live in the node's `.env` (generated by the setup script — see [Install a self-hosted node](https://docs.burakov.net/hushgard/self-hosting.md)). Restart the stack after changing them.

| Variable | Default | What it does |
| - | - | - |
| `NODE_PUBLIC_URL` | `https://DOMAIN` | The public **HTTPS** address members' apps connect to. Must be reachable from the internet. |
| `APP_WEB_ORIGINS` | The hosted web app | Browser origins of the Hushgard web app allowed to call your node. The desktop and mobile apps are always allowed. |
| `CORS_ORIGINS` | `https://DOMAIN` | Other browser origins of your own that may call the node. |
| `S3_*` | Bundled MinIO | File storage for encrypted attachments — bundled, or your own S3-compatible service. |
| `LIVEKIT_*` | Bundled LiveKit | The media server for calls. |
| `MAX_ATTACHMENT_BYTES` | 100 MiB | Largest single attachment. |
| `MESSAGE_PUSH_HIDE_METADATA` | `true` | Keep message notifications generic (no sender or chat in the push). Set `false` for named notifications. |
| `RETENTION_SWEEP_INTERVAL_SECONDS` | `21600` (6 hours) | How often expired content is deleted under the organization's [retention policy](https://docs.burakov.net/hushgard/organization-settings.md#retention). `0` turns the sweep off. |
| `LICENSE_REFRESH_INTERVAL_SECONDS` | `86400` (1 day) | How often the node refreshes its license. |
| `LICENSE_OFFLINE_GRACE_DAYS` | `14` | How long the node keeps working on an expired license while the control plane is unreachable. |
| `LICENSE_FIRST_BOOT_GRACE_MINUTES` | `30` | How long a brand-new node stays writable before it has fetched its first license. |
| `TRUST_PROXY` | `1` | The node sits behind the bundled reverse proxy. |
| `LOG_LEVEL` | `info` | Log verbosity. |
| `AI_*` | — | AI assistant models — see [below](#ai-assistant-models). |

Organization-level policy — retention, metadata-minimal mode, modules, guests — is set in the [admin panel](https://docs.burakov.net/hushgard/organization-settings.md), not here.

## Licensing states

The node runs on a signed license that it refreshes with the control plane about once a day; it can't be forged or extended on the server. Members see a banner when the organization isn't fully active.

| State | What happens |
| - | - |
| **Active** | Fully writable. Modules you add or remove reach the node at its next refresh (or at once after a restart). |
| **First boot** | A new node is writable for 30 minutes while it fetches its first license. |
| **Control plane unreachable** | The node keeps working on its current license, plus 14 days of grace once it expires — an outage never takes your team offline. |
| **Payment due** | A failed renewal keeps everything working for 7 days while the payment is retried. |
| **Read-only** | After the subscription ends, or if the organization is suspended or its secret is wrong, members can sign in and read but not send. |
| **Blocked** | 14 days into read-only, the node stops admitting sign-ins. |

**Nothing is ever deleted.** Renewing restores full use with the same organization, ID and secret. See [Plans & buying](https://docs.burakov.net/hushgard/pricing.md).

## Address verification

When the node starts — and on every license check — it registers `NODE_PUBLIC_URL` with the control plane, which checks that the address really is your node before routing members to it. If that fails, the node logs one of these reasons and retries after 1, 5, 15 and 60 minutes:

| Reason | Fix |
| - | - |
| `not_https` | `NODE_PUBLIC_URL` must start with `https://`. |
| `private_address` | The name resolves to a private IP. Point it at a public address. |
| `unresolvable` | The DNS name doesn't resolve — check the record. |
| `unreachable` | The node didn't answer from the internet within 5 seconds — check the firewall and that the stack is up. |
| `bad_response` / `mismatch` | The server at that address didn't prove it's your node — a redirect or another server answered, or the organization secret in `.env` is wrong. |
| `invalid_host` | The address isn't a valid host name. |
| `conflict` | The address conflicts with an existing registration — contact support if it's yours. |
| `throttled` | Too many attempts — it retries on its own. |

**Moving to a new domain?** Update DNS and `NODE_PUBLIC_URL`, then restart. Once the new address is verified (usually within a minute), members' apps follow it on their next refresh, with no data lost.

## Health checks

* `GET /v1/health` — the API is up.
* `GET /v1/health/ready` — the database, Redis and modules are ready (`503` when something is degraded).
* `GET /v1/license/status` — the license state.

The admin panel's footer shows a health indicator for the database, Redis and file storage.

## Updates

You're notified when a new version of the node is released. To update, pull the new image and restart the stack:

```bash theme={null}
docker compose --profile prod pull
docker compose --profile prod up -d
```

Database migrations run automatically when the node starts. When a release also changes the bundle's own files — `docker-compose.yml` or `infra/` — download the updated node bundle from [Your organizations](https://hushgard.com/account/) and apply those changes too.

## Backups

The node bundle includes **backup and restore scripts** in `scripts/`. A backup covers everything needed to bring the node back:

* a dump of the **database**,
* the **attachments** in file storage, and
* your **`.env`** file — it holds the node's secrets and your organization's credentials.

Schedule the backup script to run regularly (for example with cron) and keep copies off the server. Messages and files are stored encrypted, but the database also holds membership and metadata — keep backups as private as the server itself.

### Restore

1. Prepare the server as for a new node — DNS names, open ports and the unpacked node bundle (see [Install a self-hosted node](https://docs.burakov.net/hushgard/self-hosting.md)). Don't run the setup script: the backup brings its own `.env`.
2. Run the restore script with your backup.
3. Start the stack with `docker compose --profile prod up -d` and check that `https://DOMAIN/v1/health/ready` answers `200`.

## Rotating the organization secret

**Rotate secret** on [Your organizations](https://hushgard.com/account/) issues a new secret, and the old one stops working at once: the node turns read-only until you put the new `HUSHGARD_ORG_SECRET` in `.env` and restart.

## Calls behind NAT and firewalls

Calls use the bundled LiveKit media server at `LIVEKIT_DOMAIN`, with its built-in TURN relay on UDP `3478`, TURN over TLS on TCP `5349`, and a TCP fallback on `7881`.

* **Behind NAT**, set the server's public IP as `rtc.node_ip` in `infra/livekit.yaml`.
* **Strict networks:** TURN over TLS on TCP `5349` lets calls through networks that block UDP and the media ports.

## AI assistant models

The [AI assistant](https://docs.burakov.net/hushgard/ai-assistant.md) module needs an OpenAI-compatible model endpoint configured on the node:

| Variable | Required | What it is |
| - | - | - |
| `AI_BASE_URL` | Yes | The OpenAI-compatible API base URL — a local model server or an external provider. |
| `AI_MODEL` | Yes | The chat model that writes answers. |
| `AI_EMBED_MODEL` | Yes | The embedding model for the search index — it must return **1,536-dimensional** vectors. |
| `AI_API_KEY` | No | The key for that endpoint, if it needs one. |
| `AI_VISION_MODEL` | No | Lets the assistant understand images. |
| `AI_ASR_MODEL` | No | Lets the assistant understand voice messages. |
| `AI_EXTERNAL` | No | Set it when the endpoint is an external service — the apps then tell members their content goes to an outside provider. |

Restart the node, make sure the module is in your license, then choose **Provision AI worker** in the admin panel's **Settings**.

## What depends on the control plane

Identity (passwordless sign-in), the directory of which organizations people belong to, the public encryption-key directory, high-security device certificates, push notifications and licensing are brokered by Hushgard's control plane, so accounts work across devices and organizations. Your **content** — messages, files and calls — stays on your node. See [Privacy & your data](https://docs.burakov.net/hushgard/accounts-and-privacy.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.