# Self-host VerneMQ

> A scalable MQTT broker with a status page and a data volume, with one generated admin user and anonymous access off. MQTT on 1883 stays private.

- Page: https://levelrail.com/templates/vernemq/
- JSON: https://levelrail.com/templates/vernemq.json
- Category: Infrastructure
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/vernemq/vernemq
- Upstream docs: https://docs.vernemq.com/

## Requirements
- Memory: about 256 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 2.2.1-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| vernemq | vernemq/vernemq | 2.2.1-alpine | 8888, 1883 | vernemq_data -> /vernemq/data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| vernemq | DOCKER_VERNEMQ_ACCEPT_EULA | preset |
| vernemq | DOCKER_VERNEMQ_ALLOW_ANONYMOUS | preset |
| vernemq | DOCKER_VERNEMQ_USER_admin | generated |

## Deploy

### CLI

```bash
levelrail-cli templates deploy vernemq --name my-vernemq
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/vernemq/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. Connect MQTT clients in this project to vernemq:1883 as user admin with the generated password from the app secrets.

## Questions

### Can I deploy VerneMQ on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for VerneMQ, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image vernemq/vernemq:2.2.1-alpine is what you deploy there.

Self-host VerneMQ, VerneMQ docker compose file, deploy VerneMQ on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
