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

# Licence

> Activate the key of an installation you bought, and, as a seller, issue keys.

An installation that was sold carries a **signed key**. It is checked **offline**: Lekalao never needs the internet to know it is licensed.

## Activate a key

```dotenv .env theme={null}
LEKALAO_LICENCE_REQUIRED=true
LEKALAO_LICENCE_PUBLIC_KEY=<the public key shipped with your version>
LEKALAO_LICENCE_SERVER=https://lekalao.app
```

```bash theme={null}
php artisan config:cache
php artisan lekalao:licence:activate lekalao_…
```

The command checks the signature and saves the key. A key badly copied, or signed by someone else, is refused.

## What the key says

| Item          |                                       |
| ------------- | ------------------------------------- |
| Customer      | The buyer's name.                     |
| Plan          | `self-hosted` by default.             |
| Subscribers   | A limit, when the plan has one.       |
| Updates until | When updates and support run out.     |
| Installations | How many installations may run on it. |

## The online check

Every Tuesday, `lekalao:licence:check` tells the licence server that the installation is running, and asks whether the key has been revoked. It sends the key, an installation identifier derived from `APP_KEY` (which says nothing about the customer), the domain and the version.

* **Server unreachable**: nothing changes, the key proves itself.
* **Key revoked**: the command says so and exits with an error.

## When it runs out

When the update period ends, **Lekalao keeps sending**. Only new versions and support stop. Renew to get them back.

## On the seller's side

To sell installations, a Lekalao server acts as the licence server.

<Steps>
  <Step title="Generate the key pair, once">
    ```bash theme={null}
    php artisan lekalao:licence:keys
    ```

    Keep the signing key secret (`LEKALAO_LICENCE_SIGNING_KEY`); ship the public key with your versions.
  </Step>

  <Step title="Issue a key">
    From **Platform → Licences → Issue a licence**, or:

    ```bash theme={null}
    php artisan lekalao:licence:issue --name="Lacombe Bakery" --email=it@lacombe.cm --months=12 --installations=1
    ```

    The key is shown once only. Send it to the customer.
  </Step>

  <Step title="Follow and revoke">
    **Platform → Licences** lists the keys, their active installations and their end date, and lets you **Revoke** one.
  </Step>
</Steps>
