KubeMQ
DeployInstall

Install with Docker

Keep the KubeMQ server you started with Docker: add a license key with docker run, Compose or Podman, check the license and remove it safely.

This page turns the server you started in Try KubeMQ into a licensed server you keep, using your own container commands. When you finish, kmq license reports an active license and your data is unchanged. Time: about 10 minutes.

With Podman, use podman in place of docker in every command.

These commands are for bash on macOS and Linux. On Windows, run them in WSL (Windows Subsystem for Linux), or use the kmq tab of Try KubeMQ, which runs natively on Windows.

Before you start

Create a private folder, readable only by you, and work inside it:

mkdir -p -m 700 kubemq-private
cd kubemq-private

Steps

Add your license

  1. Open the trial page.
  2. Choose Docker (1 server).
  3. Enter your work email, name and company; accept the trial terms .
  4. Enter the code KubeMQ emails you. The trial key arrives by email.

No email? Use Recover a trial key on the same page.

Or use the kmq trial steps on Install with kmq with --platform docker, then run kmq license export --credential YOUR_LICENSE_REF --out license.key instead of saving the key below. Replace: YOUR_LICENSE_REF — the credential value that kmq trial claim printed.

Use the key from your KubeMQ order email.

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:

chmod 600 license.key

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

Write the key into a Docker environment file:

(umask 077; { printf 'KUBEMQ_LICENSE_KEY='; cat license.key; } > kubemq-license.env)

Stop and remove the container; kubemq-data keeps the data:

docker stop kubemq
docker rm kubemq

Start it again with the license:

docker run -d \  --pull always \  --platform linux/amd64 \  --name kubemq \  --hostname kubemq \  -p 127.0.0.1:50000:50000 \  -p 127.0.0.1:9090:9090 \  -p 127.0.0.1:8080:8080 \  -p 127.0.0.1:9092:9092 \  --env-file kubemq-license.env \  -e STORE_ENGINE=next \  -e STORE_NEXT_ACK_POLICY=strict \  -e STORE_STORE_PATH=/kubemq/store \  -e API_BIND_ADDRESS=0.0.0.0 \  -v kubemq-data:/kubemq/store \  europe-docker.pkg.dev/kubemq/images/kubemq-next:latest

With Podman:

podman run -d \  --pull always \  --platform linux/amd64 \  --name kubemq \  --hostname kubemq \  -p 127.0.0.1:50000:50000 \  -p 127.0.0.1:9090:9090 \  -p 127.0.0.1:8080:8080 \  -p 127.0.0.1:9092:9092 \  --env-file kubemq-license.env \  -e STORE_ENGINE=next \  -e STORE_NEXT_ACK_POLICY=strict \  -e STORE_STORE_PATH=/kubemq/store \  -e API_BIND_ADDRESS=0.0.0.0 \  -v kubemq-data:/kubemq/store \  europe-docker.pkg.dev/kubemq/images/kubemq-next:latest

Check that the server is running:

docker ps --filter name=kubemq --format '{{.Names}}: {{.Status}}'

You should see:

Output
HARNESS_OUTPUT_PENDING

Check the license

kmq license

You should see:

Output
HARNESS_OUTPUT_PENDING

STATE is active, PLAN is trial or your plan, and EXPIRES is the date you expect. Other states: How licensing works. If kmq cannot connect, wait a few seconds and run it again.

Sign in at http://localhost:8080: the orders channel from Try KubeMQ is still there.

Use Docker Compose instead

Instead of step 1's start command, use Compose:

curl -fsSLO https://docs.kubemq.io/docker-compose.yml

Turn on its env_file line:

sed -i.bak 's|# env_file:|env_file:|' docker-compose.yml

Then:

docker compose pull
docker compose up -d

Compose reuses kubemq-data; expect a warning that Compose did not create it. Check it:

docker compose ps

You should see:

Output
HARNESS_OUTPUT_PENDING

Then step 2.

Replace the license later

Run mv license.key license.key.old, save the new key, and repeat step 1 from the environment file on (with Compose, after the environment file, run docker compose up -d --force-recreate), then step 2. If the server does not start, restore the old key the same way; see Troubleshooting.

Remove the server

docker stop kubemq and docker rm kubemq, or docker compose down, keep the kubemq-data volume. Never run docker compose down -v.

Data loss: deleting the volume

This deletes every message, the administrator and the server's identity.

docker volume rm kubemq-data

If something goes wrong

  • Start with a trial key or license key. Do step 1 without stopping or removing a container, then step 2, then create the administrator at http://localhost:8080.
  • A port is in use. Change the host side of its -p flag, such as -p 127.0.0.1:18080:8080. For 8080, also run kmq license --endpoint http://127.0.0.1:18080.
  • The container stops at start. docker logs kubemq ends with a Troubleshooting link, for example #first-boot-bad-key (key refused) or #no-license-input (license env file missing).
  • Compose keeps restarting it after a licensing stop. Run docker compose stop, fix the license, then docker compose up -d.

Next steps

Was this page helpful?

On this page