⚡ High-performance job queue for Bun. SQLite by default, PostgreSQL multi-broker when you scale.
7.4K
High-performance job queue server for Bun.
Memory or one-file SQLite by default, PostgreSQL 15–18 multi-broker when you scale.
DLQ, cron, priorities, flows, S3 backups and Prometheus metrics. No Redis.
Documentation · Quick Start · Deployment guide · GitHub · npm
Dockerfile, built, tested and published by GitHub Actionslinux/amd64, linux/arm64 (Docker selects the matching one)ghcr.io/egeominotti/bunqueue, with the same tagsAll four variants run the same server with the same features, protocols and persistence options. Only the Linux base and the tools inside the container differ.
| Variant | Version tags | Moving tags | Base | Size (amd64) |
|---|---|---|---|---|
| Alpine (default) | 2.9.20, 2.9.20-alpine | latest, alpine | Alpine 3.22 (musl) | 52 MB |
| Distroless | 2.9.20-distroless | distroless | Debian 13, no shell or package manager | 61 MB |
| Debian slim | 2.9.20-slim | slim | Debian 13 slim (glibc) | 81 MB |
| Debian | 2.9.20-debian | debian | Debian 13 (glibc) | 101 MB |
apk.docker exec ... sh is unavailable).apt, when you need Debian compatibility or familiar tooling.Moving tags follow new releases. For production, pin a version tag, or a digest to pin the exact image.
docker run -d --name bunqueue \
--restart unless-stopped \
-p 127.0.0.1:6789:6789 \
-p 127.0.0.1:6790:6790 \
-v bunqueue-data:/app/data \
egeominotti/bunqueue:2.9.20
curl --fail http://127.0.0.1:6790/health
This binds both APIs to your machine only. Drop the 127.0.0.1: prefix to expose
them on the network, and enable authentication first (see below).
npm install bunqueue-client
import { Queue, Worker } from 'bunqueue-client';
const options = { embedded: false, connection: { host: '127.0.0.1', port: 6789 } };
const queue = new Queue('emails', options);
const worker = new Worker('emails', async (job) => {
console.log('Processing:', job.data.to);
return { sent: true };
}, options);
await queue.add('welcome', { to: '[email protected]' });
Official clients are also available for Deno, Python, PHP, Go, Rust and Elixir. See the Quick Start for each language.
services:
bunqueue:
image: egeominotti/bunqueue:2.9.20
restart: unless-stopped
ports:
- '6789:6789' # TCP (SDK clients)
- '6790:6790' # HTTP (health, metrics, REST)
volumes:
- bunqueue-data:/app/data
environment:
AUTH_TOKENS: ${AUTH_TOKENS}
volumes:
bunqueue-data:
| Item | Details |
|---|---|
6789/tcp | TCP protocol (msgpack), used by the SDK clients |
6790/tcp | HTTP API: REST, health and readiness probes, /metrics (JSON) and /prometheus |
/app/data | Persistent volume; SQLite database at /app/data/bunqueue.db |
| User | Non-root, UID/GID 1001:1001 (bind mounts must be writable by it) |
| Health check | Built in: /app/bunqueue healthcheck (works on distroless and with auth enabled) |
Probe endpoints: /healthz (liveness), /ready (readiness) and /health
(health plus memory). /health and /ready return 503 when persistent storage
is degraded.
Configure the server with environment variables. The most common ones:
| Variable | Description | Default |
|---|---|---|
TCP_PORT / HTTP_PORT | Listener ports | 6789 / 6790 |
DATA_PATH | SQLite database file | /app/data/bunqueue.db |
AUTH_TOKENS | Comma-separated tokens required by every TCP connection and protected HTTP endpoint (health probes stay public) | none |
TLS_CERT_FILE / TLS_KEY_FILE | PEM certificate and key: native TLS on TCP and HTTP | none |
CORS_ALLOW_ORIGIN | Comma-separated allowed CORS origins for the HTTP API | none |
METRICS_AUTH | Also require a token for /prometheus | false |
BUNQUEUE_STORAGE_DRIVER | memory, sqlite or postgres | inferred |
BUNQUEUE_POSTGRES_URL | PostgreSQL connection URL (multi-broker mode) | none |
S3_BACKUP_ENABLED | Scheduled SQLite backups to S3 (with S3_BUCKET, S3_REGION, keys) | false |
SHUTDOWN_TIMEOUT_MS | Graceful shutdown timeout | 30000 |
Clients authenticate with connection: { token: '...' }. The full list is in the
environment variables reference.
Run several active brokers against one PostgreSQL 15–18 database by setting
BUNQUEUE_STORAGE_DRIVER=postgres and the same BUNQUEUE_POSTGRES_URL (and
BUNQUEUE_POSTGRES_NAMESPACE, if you set one) on every replica.
The repository ships a ready-made
docker-compose.postgres.yml,
and the deployment guide covers
Kubernetes manifests, probes and connection budgeting.
Every variant is tested on both architectures before it is published. Since 2.9.13, release images are signed with GitHub artifact attestations (Sigstore, no keys to manage): build provenance on Docker Hub and GHCR, plus a CycloneDX SBOM (linux/amd64). Verify an image before deploying it:
gh attestation verify oci://docker.io/egeominotti/bunqueue:2.9.20 --repo egeominotti/bunqueue
Add --predicate-type https://cyclonedx.org/bom and use the ghcr.io reference
to verify the SBOM.
bunqueue CLI inside the imageThe bunqueue npm package adds a
workflow engine with saga compensation and an MCP server for AI agents; both can
connect to this server over TCP.
bunqueue is released under the MIT License.
Content type
Image
Digest
sha256:57bcfc1de…
Size
52.1 MB
Last updated
1 day ago
docker pull egeominotti/bunqueue