> For the complete documentation index, see [llms.txt](https://adatrack.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adatrack.gitbook.io/docs/documentation/administration/licensing.md).

# Licensing (Self-Hosted)

AdaTrack self-hosted deployments use a **license-based** system to manage resource limits and feature access. Every installation starts as a free **Community Edition** with generous defaults, and paid licenses unlock higher limits.

### How It Works

When you run AdaTrack in `SELF_HOSTED` mode, the server checks for a license key on startup. If no license is provided, the platform runs in **Community Edition** mode with a fixed set of resource limits. To unlock higher limits, you purchase a license from AdaTrack and configure it on your server.

Licenses are **fully offline** — there are no call-home checks or internet requirements. Your license is verified locally by the server binary using cryptographic signatures.

***

### License Tiers

| Resource                                | Community (Free)       | Standard  | Enterprise         |
| --------------------------------------- | ---------------------- | --------- | ------------------ |
| **Devices**                             | 5                      | 250       | Unlimited          |
| **Device Profiles**                     | 3                      | 50        | Unlimited          |
| **Geofences**                           | 5                      | 150       | Unlimited          |
| **Alert Channels**                      | 3                      | 20        | Unlimited          |
| **Alert Rules**                         | 10                     | 100       | Unlimited          |
| **Report Configs**                      | 1                      | 25        | Unlimited          |
| **Dashboards**                          | 3                      | 50        | Unlimited          |
| **Workflows**                           | 5                      | 50        | Unlimited          |
| **Saved Queries**                       | 20                     | 200       | Unlimited          |
| **Chart Configs**                       | 50                     | 500       | Unlimited          |
| **Requests / month**                    | 50,000                 | 2,000,000 | Unlimited          |
| **Report Generations / month**          | 5                      | 200       | Unlimited          |
| **Workflow Executions / month**         | 500                    | 20,000    | Unlimited          |
| **Stats Queries / month**               | 2,000                  | 50,000    | Unlimited          |
| **AI Tokens / month**                   | 0 (requires Standard+) | 300,000   | Unlimited          |
| **Data Retention**                      | 30 days                | 2 years   | Custom / Unlimited |
| **Travel Log — Trace Points / Request** | 500                    | 5,000     | Unlimited          |
| **Travel Log — Max Points per Trip**    | 10,000                 | Unlimited | Unlimited          |
| **Travel Log — Bulk Export (trips)**    | 100                    | 1,000     | Unlimited          |
| **Travel Log — Custom Detector Config** | No                     | Yes       | Yes                |
| **Support**                             | Community forums       | Email     | SLA                |

***

### Setting Up a License

There are two ways to provide your license key to AdaTrack. You only need to use one method.

#### Option 1: Environment Variable (Recommended)

Set the `ADATRACK_LICENSE_KEY` environment variable to the contents of your license token:

```yaml
# docker-compose.yml
services:
  adatrack:
    image: ghcr.io/AdaTrack/adatrack:latest
    environment:
      - ADATRACK_RUN_MODE=SELF_HOSTED
      - ADATRACK_DB_URL=postgres://user:pass@db:5432/adatrack?sslmode=disable
      - JWT_SECRET=your-secure-secret
      - ADATRACK_LICENSE_KEY=eyJhbGciOiJFZERTQSIs...your-license-token
```

#### Option 2: License File

Place your `.adatrack.lic` file on the server and point to it with the `ADATRACK_LICENSE_FILE` environment variable:

```yaml
# docker-compose.yml
services:
  adatrack:
    image: ghcr.io/AdaTrack/adatrack:latest
    volumes:
      - ./my-license.adatrack.lic:/etc/adatrack/license.lic:ro
    environment:
      - ADATRACK_RUN_MODE=SELF_HOSTED
      - ADATRACK_DB_URL=postgres://user:pass@db:5432/adatrack?sslmode=disable
      - JWT_SECRET=your-secure-secret
      - ADATRACK_LICENSE_FILE=/etc/adatrack/license.lic
```

> **Note:** If both `ADATRACK_LICENSE_KEY` and `ADATRACK_LICENSE_FILE` are set, the inline key takes precedence.

***

### Verifying Your License

Once your server is running, you can verify the license status in two ways:

#### Admin Dashboard

Navigate to **Settings > License** in the AdaTrack dashboard. This page displays:

* Current license tier (Community, Standard, or Enterprise)
* Licensee name
* Expiry date and days remaining
* A full breakdown of active resource limits

#### Admin API

Administrators can query the license status programmatically:

```
GET /api/v1/admin/license
```

This returns the current tier, limits, expiry information, and validation status.

***

### License Renewal

Licenses have an expiry date set at the time of purchase. When your license is approaching expiry:

1. **30-day warning:** A banner appears in the admin dashboard reminding you to renew.
2. **Grace period:** After expiry, AdaTrack provides a **7-day grace period** during which your existing limits remain active. This gives you time to apply a renewed license without service disruption.
3. **After grace period:** The server automatically falls back to **Community Edition** limits. No data is lost — you simply cannot create resources beyond the Community limits until a valid license is applied.

To renew, purchase a new license from AdaTrack and replace the old key or file using the same configuration method described above. The server picks up the new license automatically within one hour — no restart required.

***

### Instance-Bound Licenses

Some licenses are bound to a specific AdaTrack installation. If your license requires instance binding, you will need to provide your **Instance ID** when purchasing.

To find your Instance ID:

1. Go to **Settings > License** in the admin dashboard, or
2. Call the API endpoint:

   ```
   GET /api/v1/admin/instance
   ```

   This returns your unique installation identifier.

Provide this ID to AdaTrack when requesting your license. An instance-bound license will only work on the installation it was issued for.

***

### Running Without a License

AdaTrack works out of the box without any license key. The Community Edition is fully functional and includes all platform features — geofencing, alerting, workflows, reporting, dashboards, and real-time tracking. The only difference is the resource limits listed in the tier table above.

This makes it easy to evaluate the platform before purchasing a license.

***

### Upgrading from Community Edition

To upgrade from the free Community Edition:

1. **Purchase a license** at [adatrack.io](https://adatrack.io) or contact our sales team for Enterprise pricing.
2. **Configure the license** on your server using one of the two methods above.
3. **Verify** the new tier is active via the admin dashboard or API.

Your existing data, devices, and configurations are preserved. The new limits take effect immediately.

***

### Frequently Asked Questions

#### Does the license require an internet connection?

No. License verification is completely offline. Your server never contacts AdaTrack's servers to validate the license.

#### Can I move my license to a different server?

Standard licenses without instance binding can be used on any single installation. Instance-bound licenses are tied to a specific server — contact support if you need to transfer one.

#### What happens if my license file is deleted?

The server gracefully falls back to Community Edition limits. No data is lost and no restart is needed. Simply re-add your license to restore your tier.

#### Can I try Standard/Enterprise features before purchasing?

All features are available in Community Edition — only the resource limits differ. You can fully evaluate every capability within the Community limits.
