# Get a License Key (/deploy/license-key)



A standalone KubeMQ server requires a license token to start. Getting one is
**free** — about **2-3 minutes the first time**, since it includes creating a free
account. This page explains what the token is, where to get one, and how to pass
it to the server.

## Why a license key is required [#why-a-license-key-is-required]

When KubeMQ runs **outside Kubernetes** — for example, a single Docker container on
your laptop or a CI runner — the server validates a license token on startup.

<Callout type="warn">
  Without a valid `KUBEMQ_TOKEN`, a standalone server will **not start**: it logs a
  licensing error and exits immediately. Set the token before you run the container.
</Callout>

The token is read from the `KUBEMQ_TOKEN` environment variable (or, equivalently,
the `--key` command-line flag). It is free to obtain and ties your running server to
your KubeMQ account.

## Get your token [#get-your-token]

<Steps>
  <Step>
    ### Create an account or sign in [#create-an-account-or-sign-in]

    Register or log in at the KubeMQ account portal:

    <Cards>
      <Card title="Open the KubeMQ account portal" href="https://account.kubemq.io/auth/signup">
        Create a free account or sign in to retrieve your license token.
      </Card>
    </Cards>
  </Step>

  <Step>
    ### Copy your license token [#copy-your-license-token]

    Once signed in, locate your license key and copy its value. This is the string you
    will pass to the server as `KUBEMQ_TOKEN`.
  </Step>

  <Step>
    ### Pass it to the server [#pass-it-to-the-server]

    Provide the token wherever you start KubeMQ — see the methods below.
  </Step>
</Steps>

## Pass the token to the server [#pass-the-token-to-the-server]

The same license value works across every way you run KubeMQ. In the examples below,
replace `YOUR_LICENSE_KEY` with the token you copied.

<Tabs items="[&#x22;Docker&#x22;, &#x22;Docker Compose&#x22;, &#x22;Helm&#x22;]">
  <Tab value="Docker">
    Pass the token with `-e KUBEMQ_TOKEN=…`. The `docker run` command already shows
    `YOUR_LICENSE_KEY` as a placeholder:

    <RunKubeMQ />
  </Tab>

  <Tab value="Docker Compose">
    Add the token to the `environment` section of your service:

    ```yaml title="docker-compose.yml"
    services:
      kubemq:
        image: europe-docker.pkg.dev/kubemq/images/kubemq:next
        container_name: kubemq
        ports:
          - "50000:50000"
          - "9090:9090"
          - "8080:8080"
        environment:
          - KUBEMQ_TOKEN=YOUR_LICENSE_KEY
    ```
  </Tab>

  <Tab value="Helm">
    On Kubernetes, the same license value is supplied to the chart with `--set key=…`:

    ```bash title="Terminal"
    helm install kubemq-cluster kubemq/kubemq \
      --set key=YOUR_LICENSE_KEY
    ```
  </Tab>
</Tabs>

## One license, two surfaces [#one-license-two-surfaces]

A single license value reaches KubeMQ through two different surfaces:

| Surface               | How the key is supplied                                      | Mechanism                                           |
| --------------------- | ------------------------------------------------------------ | --------------------------------------------------- |
| Standalone server     | `-e KUBEMQ_TOKEN=YOUR_LICENSE_KEY` (or the `--key` flag)     | The server validates the token on startup.          |
| Kubernetes deployment | Helm `--set key=YOUR_LICENSE_KEY` / `KubemqCluster.spec.key` | The chart passes the key into the cluster resource. |

<Callout type="info">
  Under Kubernetes, the **server** skips its own license check — licensing is handled
  by the operator. The chart still needs the `key` value, so supply it via
  `--set key=…` or `KubemqCluster.spec.key`.
</Callout>

## Next steps [#next-steps]

<Cards>
  <Card title="Install with Docker" href="/deploy/docker">
    Run KubeMQ locally with the token-bearing Docker command.
  </Card>

  <Card title="Install with Helm" href="/deploy/kubernetes-helm">
    Deploy KubeMQ to Kubernetes and supply the key via the chart.
  </Card>
</Cards>
