Skip to main content

Installation

TinyMQ ships as a single static binary and an ultra-minimal Docker image (~13 MB). There are no configuration files, no runtimes to install, and no environment bootstrapping required.


From GitHub Container Registry (GHCR)โ€‹

docker pull ghcr.io/x-name15/tinymq:latest

docker run -d \
--name tinymq \
-p 7800:7800 \
-p 1883:1883 \
-v $(pwd)/data:/home/tinymq/data \
ghcr.io/x-name15/tinymq:latest
Volume Mount Permissions

TinyMQ runs as an unprivileged user (UID 10001). If you are bind-mounting a local directory instead of a Docker volume, ensure the directory has the correct ownership: sudo chown -R 10001:10001 $(pwd)/data

For more advanced Docker configurations (TLS, networks), see the Docker Deployment Guide.


Option 2: Docker Composeโ€‹

For homelab or production-like environments, docker-compose is the recommended setup. This configuration includes a healthcheck.

Create a docker-compose.yml file:

services:
tinymq:
image: ghcr.io/x-name15/tinymq:latest
container_name: tinymq
restart: unless-stopped
ports:
- "7800:7800" # HTTP/WS
- "1883:1883" # MQTT
volumes:
- tinymq_data:/home/tinymq/data
environment:
- PORT=7800
- TINYMQ_MAX_MESSAGES=100000
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://127.0.0.1:7800/healthz || exit 1"]
interval: 10s
timeout: 5s
retries: 3

volumes:
tinymq_data:

Start the stack:

docker compose up -d

๐Ÿ“ฆ Downloads (Broker Server + CLI Bundle)โ€‹

Operating SystemDownload Archive
Windows (x64)tinymq-Checking version...-windows-amd64.zip
Linux (x64)tinymq-Checking version...-linux-amd64.tar.gz
Linux (ARM64)tinymq-Checking version...-linux-arm64.tar.gz
macOS (Intel)tinymq-Checking version...-darwin-amd64.tar.gz
macOS (Apple Silicon)tinymq-Checking version...-darwin-arm64.tar.gz

Docker Images (multiโ€‘arch: amd64 + arm64):

  • GHCR: docker pull ghcr.io/x-name15/tinymq:Checking version...
  • Docker Hub: docker pull flez71/tinymq:Checking version...

Option 4: Build from Sourceโ€‹

Requires Go 1.25+.

git clone https://github.com/x-name15/tinymq.git
cd tinymq

# Build the broker
make build

# Run
./bin/tinymq

Environment Variables Configurationโ€‹

TinyMQ is entirely configured via environment variables.

Broker Coreโ€‹

VariableDefaultDescription
PORT7800HTTP listening port
TINYMQ_FSYNCfalseForce disk sync after every write (slows down writes but guarantees durability)
TINYMQ_COMPACT_INTERVAL10mBackground WAL compaction interval
TINYMQ_DEFAULT_POLICYrejectQueue overflow policy (reject or drop-oldest)
TINYMQ_MAX_MESSAGES100000Max messages per topic held in RAM
TINYMQ_MAX_TOPICS10000Max unique topics (DoS protection)
TINYMQ_API_KEY(empty)Global Bearer token for API authentication
TINYMQ_RATE_LIMIT0Per-IP request limit per second (0 = disabled)
TINYMQ_TRUST_PROXY_HEADERSfalseTrust X-Real-IP or X-Forwarded-For from reverse proxies for rate limiting
TINYMQ_TLS_CERT(empty)Path to TLS certificate for native HTTPS
TINYMQ_TLS_KEY(empty)Path to TLS private key

Transportsโ€‹

VariableDefaultDescription
TINYMQ_MQTT_PORT1883TCP port for the MQTT v3.1.1 gateway
TINYMQ_MQTT_DISABLEfalseSet to true to completely disable MQTT
TINYMQ_NATS_PORT(empty)TCP port for NATS Gateway (e.g., 4222)

Clusteringโ€‹

VariableDefaultDescription
TINYMQ_CLUSTER_ADDR(empty)TCP bind address for clustering (e.g. 0.0.0.0:7901)
TINYMQ_CLUSTER_SELF(empty)Advertised identity to peers (Required in Kubernetes)
TINYMQ_CLUSTER_NODES(empty)Comma-separated list of peer addresses
TINYMQ_CLUSTER_SECRET(empty)HMAC-SHA256 secret for securing cluster traffic
TINYMQ_CLUSTER_HTTP_ADVERTISE(empty)The HTTP address followers use to proxy to the leader
TINYMQ_CLUSTER_REPLICATE_TIMEOUT500msUse 2s or 3s in Kubernetes due to DNS latency
TINYMQ_CLUSTER_LEADERfalseForce static leadership (disables automatic elections)
TINYMQ_CLUSTER_ALLOW_INSECUREfalseFor testing, bypasses HMAC secret requirement if empty

CLI Configurationโ€‹

VariableDefaultDescription
TINYMQ_URLhttp://127.0.0.1:7800Target broker URL used automatically by the tmq CLI

Verifying the Installationโ€‹

Check broker stats:

curl http://localhost:7800/api/stats

Access the dashboard: http://localhost:7800/dashboard


What's Next?โ€‹