# Install with kmq (/deploy/install/kmq)



This page adds a license to the server you started in Try KubeMQ. When you finish, `kmq license` reports an active license and your data is unchanged. Time: about 10 minutes.

## Before you start [#before-you-start]

* A server from the kmq tab of [Try KubeMQ](/deploy/quickstart#install-kmq).
* A trial key or a license key: see [Plans compared](/licensing#which-one-fits).

## Steps [#steps]

<Steps>
  <Step>
    ### Add your license [#add-your-license]

    <Tabs groupId="license" items="[&#x22;Trial key&#x22;, &#x22;License key&#x22;]">
      <Tab value="Trial key">
        `--accept-terms` records that you accept the trial terms  and the [privacy notice](https://kubemq.io/privacy-policy-2/); an AI agent must ask you first.

        ```bash
        kmq trial request --email YOUR_EMAIL --name "YOUR_NAME" --company "YOUR_COMPANY" --platform docker --accept-terms
        ```

        Replace: `YOUR_EMAIL`, `YOUR_NAME`, `YOUR_COMPANY` — your work email, full name and company.

        You should see:

        ```text title="Output"
        HARNESS_OUTPUT_PENDING
        ```

        Type the emailed code yourself, never in chat.

        ```bash
        kmq trial verify --request YOUR_REQUEST_ID
        ```

        Replace: `YOUR_REQUEST_ID` — the `request_id` printed above.

        You should see:

        ```text title="Output"
        HARNESS_OUTPUT_PENDING
        ```

        ```bash
        kmq trial claim --request YOUR_REQUEST_ID
        ```

        You should see:

        ```text title="Output"
        HARNESS_OUTPUT_PENDING
        ```

        `credential` is `YOUR_LICENSE_REF`.
      </Tab>

      <Tab value="License key">
        Create a private folder, readable only by you, and work inside it:

        ```bash
        mkdir -p -m 700 kubemq-private
        ```

        ```bash
        cd kubemq-private
        ```

        Save the license key as `license.key` in this folder. The file holds only the key, on one line, with no quotes and no `KUBEMQ_LICENSE_KEY=` prefix. Then make it readable by you alone:

        ```bash
        chmod 600 license.key
        ```

        This file is a secret. Do not commit it, paste it into chat, or attach it to a support ticket.

        On Windows, in PowerShell:

        ```powershell
        New-Item -ItemType Directory -Force kubemq-private
        ```

        ```powershell
        Set-Location kubemq-private
        ```

        ```powershell
        icacls . /inheritance:r /grant:r "${env:USERNAME}:(OI)(CI)F"
        ```

        ```powershell
        icacls license.key /inheritance:r /grant:r "${env:USERNAME}:F"
        ```

        Save `license.key` before the last command. Use a non-administrator window.

        In any shell:

        ```bash
        kmq license import --file license.key
        ```

        You should see:

        ```text title="Output"
        HARNESS_OUTPUT_PENDING
        ```

        `reference` is `YOUR_LICENSE_REF`.
      </Tab>
    </Tabs>
  </Step>

  <Step>
    ### Apply it to your server [#apply-it-to-your-server]



    ```bash
    kmq deploy update --installation kubemq --credential YOUR_LICENSE_REF --deadline 10m
    ```

    Replace: `YOUR_LICENSE_REF` — the reference from step 1.

    You should see:

    ```text title="Output"
    HARNESS_OUTPUT_PENDING
    ```

    Data stays; the old container is kept, stopped, as `kubemq-retained-…`.
  </Step>

  <Step>
    ### Check the license [#check-the-license]

    Check that `STATE` is `active`, `PLAN` is `trial` or your plan, and `EXPIRES` is the date you expect.

    ```bash
    kmq license
    ```

    You should see:

    ```text title="Output"
    HARNESS_OUTPUT_PENDING
    ```

    Other states: [How licensing works](/licensing/how-it-works#check-license-status).
  </Step>
</Steps>

### Replace the license later [#replace-the-license-later]

Repeat steps 1 to 3 without the folder commands. If it does not show, rerun step 2 with the previous reference; see [Troubleshooting](/licensing/troubleshooting#license-not-accepted). Never start a second installation to extend a license.

## Manage your server [#manage-your-server]

To remove the server and keep `kubemq-data`:



```bash
kmq deploy remove --installation kubemq
```

You should see:

```text title="Output"
HARNESS_OUTPUT_PENDING
```

## Update or remove kmq [#update-or-remove-kmq]

```bash
kmq update
```

You should see:

```text title="Output"
HARNESS_OUTPUT_PENDING
```

[Upgrade KubeMQ](/deploy/upgrade) then updates your server.

<Accordions>
  <Accordion title="Pin a version">


    Open the [Release notes](/release-notes) and copy the release number exactly as shown.

    If kmq is installed, switch it to that release:

    ```bash
    kmq update --version YOUR_VERSION
    ```

    Replace: `YOUR_VERSION` — the release number you copied, with a leading `v`.

    On a machine without kmq, download the installer as [Try KubeMQ](/deploy/quickstart#install-kmq) shows, then run it with that release:

    ```bash
    sh install-kmq.sh --version YOUR_VERSION
    ```

    On Windows, in PowerShell:

    ```powershell
    & .\install-kmq.ps1 -Version YOUR_VERSION
    ```

    That kmq installs its matching server release. A pinned install does not update itself: read the release notes and move to the latest release regularly. `kmq update` with no `--version` returns kmq to the latest release.
  </Accordion>
</Accordions>

To remove kmq, delete `kmq` from `/usr/local/bin`, `~/.local/bin` or `~/bin` (Windows: `%LOCALAPPDATA%\Programs\kmq`).

## Use kmq from an AI coding agent [#use-kmq-from-an-ai-coding-agent]

```bash
kmq skills install
```

It adds the kmq skill to `.claude/skills/kmq` and `AGENTS.md` here; `--global` installs it for your user ([kmq CLI](/operate/kmq-cli#agent-skill-distribution)). A starting prompt:

```text title="Prompt"
Use kmq to install KubeMQ on this machine. Run `kmq schema -o json` first. Ask me before creating anything. I will type passwords and email codes myself; never ask me to paste them.
```

## If something goes wrong [#if-something-goes-wrong]

* **Try KubeMQ found no evaluation left.** Get a reference in step 1 and run `kmq onboard --goal trial --name kubemq --credential YOUR_LICENSE_REF --pull --continue-volume --deadline 10m` (first `docker rm kubemq` if needed); `--goal trial` runs a Docker server on any saved license, trial or paid. Replace: `YOUR_LICENSE_REF` — as in step 2. Then do Try KubeMQ steps 3 and 4 (`kmq auth login` if an administrator exists) and step 3 here.
* **No email code, or a lost trial key.** Run `kmq trial resend-verification --request YOUR_REQUEST_ID` or `kmq trial resume --request YOUR_REQUEST_ID`, or `kmq license recover --email YOUR_EMAIL` for a lost key, then verify and claim. Replace: `YOUR_REQUEST_ID`, `YOUR_EMAIL` — as in step 1.
* **`credential_storage_unavailable`.** On Linux with no keyring, add `--credential-backend file` to every `kmq trial`, `kmq license`, `kmq deploy`, `kmq auth` and `kmq onboard` command, and check `chmod 600 license.key`.
* **`docker volume rm kubemq-data` says the volume is in use.** Remove the `kubemq-retained-…` containers with `docker rm`.

## Next steps [#next-steps]

<Cards>
  <Card title="Upgrade KubeMQ" href="/deploy/upgrade" description="Move this server to the latest release and keep its data and license." />

  <Card title="Install on Kubernetes" href="/deploy/install/kubernetes" description="Run a three-server cluster for production." />

  <Card title="Client SDKs" href="/sdks" description="Connect your application to KubeMQ." />

  <Card title="kmq CLI" href="/operate/kmq-cli" description="Every kmq command, its flags and exit codes." />
</Cards>
