One API to dispatch your content anywhere. Twitter / X · Instagram · Telegram · Bluesky · LinkedIn · Threads · YouTube Shorts · TikTok · Facebook · Discord — self-host forever free · MIT license Open-Dispatch is the infrastructure layer for content distribution. Like Stripe is to payments, this is to posting. One HTTP call, ten platforms, zero vendor lock-in. Integrate from any app, n8n workflow, cron job, or AI…
One API to dispatch content to 10 social platforms: X, Bluesky, Instagram, Threads, LinkedIn, Telegram, YouTube Shorts, TikTok, Discord, and Facebook. Self-host free, MIT licensed. The open-source alternative to Buffer/Hootsuite.
One API to dispatch your content anywhere.
Twitter / X · Instagram · Telegram · Bluesky · LinkedIn · Threads · YouTube Shorts · TikTok · Facebook · Discord
— self-host forever free · MIT license
Open-Dispatch is the infrastructure layer for content distribution. Like Stripe is to payments, this is to posting. One HTTP call, ten platforms, zero vendor lock-in. Integrate from any app, n8n workflow, cron job, or AI agent.
⭐ If self-hosting your social posting sounds good, star the repo to follow development — it’s the fastest way to support an independent MIT project.
Or use the built-in dark dashboard at http://localhost:8000/ — compose, schedule, retry, watch the queue live. Selecting YouTube in the composer reveals video fields (media-dir file path, optional title, visibility); the caption becomes the description.
Why self-host?
Hosted scheduling services charge $3–6 per connected account, gate analytics and inbox management behind paid tiers, and keep your OAuth tokens on their servers. Open-Dispatch runs on your own machine, stores nothing externally, and costs nothing beyond electricity.
Hosted tools
Open-Dispatch
Pricing
Per-account fees that stack up
Self-host free — $0 forever
Credentials
Live on their servers
Never leave your machine
Errors
Fail silently or stay vague
Visible + retryable in the dashboard
Inbox / analytics / X
Extra paid add-ons
All platforms included, no tiers
Your data
Lingers after you cancel
You own the queue end-to-end
Lock-in
Proprietary
MIT licensed — fork it any time
Install
Five ways to run Open-Dispatch. Pick what fits your stack.
# Add the tap
brew tap matthew-selvam/open-dispatch
brew install open-dispatch
# Set up credentials
$EDITOR $(brew --prefix)/var/open-dispatch/.env
# Start the server (foreground)
open-dispatch
# Or run as a background service — auto-starts on login
brew services start open-dispatch
Installs three commands: dispatch (CLI), open-dispatch (server), open-dispatch-worker (background worker).
brew services wires a launchd plist so the server starts at login automatically.
curl -fsSL \
https://raw.githubusercontent.com/Matthew-Selvam/Open-Dispatch/main/install.sh \
| bash
# Set up credentials
$EDITOR $(brew --prefix)/var/open-dispatch/.env
# Start the server
open-dispatch
# macOS: start at login via launchd
launchctl load ~/Library/LaunchAgents/dev.open-dispatch.plist
# Linux: start via systemd user session
systemctl --user enable --now open-dispatch
The script auto-detects your OS, finds Python 3.11+, creates an isolated virtualenv, and writes
a launchd plist (macOS) or systemd user unit (Linux). No sudo required.
git clone https://github.com/Matthew-Selvam/Open-Dispatch
cd Open-Dispatch
cp .env.example .env # fill in your platform credentials
docker compose up -d
# Verify
curl -s http://localhost:8000/healthz | jq -e '.status=="ok"'
# Open the dashboard
open http://localhost:8000
# Optional: add Redis for multi-worker throughput
docker compose --profile redis up -d
SEC-1 — the API binds to loopback by default. The compose file maps
127.0.0.1:8000:8000, so the API is reachable only from the host
machine. That is deliberate: with OPEN_DISPATCH_API_TOKEN unset the API
is unauthenticated, and binding all interfaces would let anyone who can
reach the host create profiles, queue posts, and read queue content.
Set a strong token and change the mapping before serving remotely:
see Exposing the API remotely.
Exposing the API remotely
The default Compose deployment is loopback-only (see SEC-1 above). To serve
other machines you need both of:
A bearer token. Generate one and put it in .env:
OPEN_DISPATCH_API_TOKEN=$(openssl rand -hex 32)
A TLS-terminating reverse proxy (nginx, Caddy, Traefik) in front of
the container. Do not simply change the port mapping to "8000:8000"
and expose the raw container — HTTP is plaintext and the API allows CORS-
gated browser use. A minimal Caddy example:
The proxy must live on the same host as the container (so 127.0.0.1
still applies) or join the compose network directly. Restrict proxy
routes to what clients need; the queue/API surface is not designed for
anonymous public exposure.
Then change the compose mapping to "8000:8000"or remove ports: and
let the proxy join the compose network. Verify from the host with
ss -tlnp | grep 8000 (Linux) or lsof -nP -iTCP:8000 -sTCP:LISTEN (macOS)
that nothing else is listening on 0.0.0.0.
Multi-arch image (amd64 + arm64). Non-root dispatch user. No compiler tools in the final layer.
First launch: right-click → Open → click Open in the dialog (unsigned build — bypasses Gatekeeper once)
A status icon appears in your menu bar
Click → Edit .env → add your platform credentials
Click → Start Server
Click → Open Dashboard → http://localhost:8000
Apple Silicon & Intel — this release is native arm64. Rosetta 2 runs it on Intel Macs without any extra steps.
SwiftUI menubar app (macOS 13+). Bundles the Python server — no separate Python install. Supports launch-at-login via SMAppService.
Build it yourself:
bash scripts/make-dmg.sh
# → dist/Open-Dispatch-0.5.0.dmg
# With code-signing + notarization:
bash scripts/make-dmg.sh \
--sign "Developer ID Application: Your Name (TEAMID)" \
--notarize
Configuration
All config lives in .env (or ~/.open-dispatch/.env for Homebrew / install.sh installs).
cp .env.example .env
$EDITOR .env
Where do I get the API keys?CREDENTIALS_GUIDE.html walks through all ten platforms one at a time, with the scope each one needs and what to paste where. Open it in a browser. .env.example is the same information as a copy-paste template: Telegram, Twitter / X, Instagram (Graph API, needs public media URLs), Bluesky (App Password, not your login password), LinkedIn (3-legged OAuth with w_member_social), Threads (Meta Graph API), YouTube Shorts (Data API v3), TikTok (Content Posting API v2), Facebook (Meta Graph API, Page token), and Discord (webhook, no bot required). For replacing expired or revoked credentials and safely retrying failed queue rows, see the credential rotation guide.
Only fill in the platforms you actually dispatch to. The API does not complain about targets whose env vars are unset.
# ── Twitter / X ──────────────────────────────────────────────────────────────
TWITTER_API_KEY=...
TWITTER_API_SECRET=...
TWITTER_ACCESS_TOKEN=...
TWITTER_ACCESS_SECRET=...
# ── Bluesky ──────────────────────────────────────────────────────────────────
BLUESKY_HANDLE=user.bsky.social
BLUESKY_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
# ── Telegram ─────────────────────────────────────────────────────────────────
TELEGRAM_BOT_TOKEN=123456:ABC-...
TELEGRAM_CHAT_ID=@channel_or_id
# ── Instagram / Threads / LinkedIn / YouTube: see .env.example for full list ─
# ── Queue backend (optional) ──────────────────────────────────────────────────
# REDIS_URL=redis://localhost:6379 # Redis backend
# DATABASE_URL=postgresql://... # Postgres backend
# ── API access control (optional, but read this) ───────────────────────────
# When set, EVERY route except /healthz requires `Authorization: Bearer <token>`.
# When unset, the API is completely open — fine for 127.0.0.1, NOT fine if the
# container port is published to a public interface. The Docker image binds
# 0.0.0.0:8000, so set this before exposing the port.
# OPEN_DISPATCH_API_TOKEN=change-me-to-a-long-random-string
# ── AI caption adapter (optional) ────────────────────────────────────────────
# OPENROUTER_API_KEY=...
# OLLAMA_HOST=http://localhost:11434
Only configure the platforms you actually use — missing vars are silently skipped.
API access control
OPEN_DISPATCH_API_TOKEN is off by default. With it unset, anyone who can
reach the port can dispatch content to your connected accounts, so treat it as
required for anything beyond a local, firewalled bind.
With the token set, every route except the /healthz JSON probe (kept open
for Docker health checks, uptime monitors, and dispatch doctor) requires:
Authorization: Bearer <your token>
Requests without a valid token get 401. Note this includes the browser
dashboard: a browser cannot send the bearer header, so a token-protected
instance is API-only unless you front it with a proxy that injects auth.
Keep the dashboard token-free on a loopback-only bind instead.
All three bundled clients send it automatically once the variable is set in
their environment:
CLI — reads OPEN_DISPATCH_API_TOKEN, or pass --token <value>
MCP server (mcp_server.py) — reads OPEN_DISPATCH_API_TOKEN
n8n node — paste it into the credential’s API Key Header field
A 401 or 403 from any of them names this variable rather than dumping a
bare HTTP error.
State-changing requests (POST/PUT/PATCH/DELETE) are additionally checked
against the Origin header, and must be sent without an Authorization
header from a browser form — i.e. use the dashboard on the same origin.
Behind a reverse proxy: the origin check compares against the request’s own
base URL. If your proxy rewrites Host or X-Forwarded-* in a way that
doesn’t match the browser’s Origin, legitimate dashboard mutations will
return 403. Either serve on a single origin, or pass the original host
through unchanged.
Web UI
http://localhost:8000/ # dashboard — queue, filters, live auto-refresh
http://localhost:8000/compose # post composer with AI caption adapt
http://localhost:8000/queue/<id> # row detail + retry
Dark terminal aesthetic. HTMX-driven (no JS build step). 51 KB vendored htmx.min.js. Runs on the same port as the API.
API reference
Method
Path
Purpose
GET
/healthz
Liveness probe — JSON diagnostics for monitors/curl (open), full HTML dashboard for browsers (auth-gated when a token is set)
POST
/dispatch
Enqueue a ContentUnit for one or many platforms
GET
/queue?status=…
List rows (queued / publishing / published / failed / dead / canceled)
Queue: JSONL on disk (default), Redis (REDIS_URL), or Postgres (DATABASE_URL). All three implement QueueProtocol — swap with a single env var, no code changes.
Fail closed: when REDIS_URL or DATABASE_URL is set but that backend is unreachable, Open Dispatch raises an explicit error instead of silently falling back to JSONL. The API answers 503 Service Unavailable with the fix in the response; the worker logs queue backend unavailable: … — retrying in Ns and keeps polling. Nothing is ever enqueued to a different store than the one you configured. Unset the env var to deliberately switch to the JSONL queue.
Queue health: /healthz returns 200 {"status": "ok", …} when the queue works and 503 {"status": "degraded", "queue_error": "…"} when the API is up but the configured backend is down — a running API and a functioning queue are reported separately.
Retry: exponential backoff (WORKER_BACKOFF_BASE × 2^(attempts-1) + jitter), gives up after WORKER_MAX_ATTEMPTS.
State machine: queued → publishing → published | failed | dead
No-cloud option: everything runs from a single python process — python cli.py worker alongside uvicorn.
n8n integration
Community node lives in n8n-node/. One node, five operations:
Operation
Endpoint
Purpose
Dispatch
POST /dispatch
Send content (now or scheduled)
Adapt Caption with AI
POST /ai/adapt
Per-platform rewrite
Get Queue Row
GET /queue/{id}
Fetch one row
Retry Queue Row
POST /queue/{id}/retry
Re-queue a failed row
List Queue
GET /queue
List rows by status
cd n8n-node
npm install --ignore-scripts && npm run build
# In your n8n install:
npm link n8n-nodes-open-dispatch
The credential just needs your Open-Dispatch base URL (plus an optional bearer if you proxy with auth).
MCP server (Claude Desktop, Cursor, AI agents)
mcp_server.py wraps the entire Open-Dispatch API as an MCP server — 10 tools usable from Claude Desktop, Cursor, or any MCP-compatible AI agent via natural language.
pip install "open-dispatch[mcp]"
Claude Desktop — add to ~/.claude/claude_desktop_config.json:
“Adapt this caption for Twitter, Instagram and LinkedIn”
Available tools:health, dispatch, get_queue, get_row, retry_row, delete_row, adapt_caption, list_platforms
SSE transport (for remote/browser use):
python mcp_server.py --transport sse --port 8001
Media transcoding
Per-platform image resize via Pillow — 10 platform specs out of the box. Honors EXIF orientation, flattens RGBA to JPEG, never upscales.
# Transcode a Twitter card from a phone photo
curl -X POST "http://localhost:8000/media/transcode?platform=twitter" \
-H "Content-Type: image/jpeg" \
--data-binary @photo.jpg --output photo.twitter.jpg
# List all specs
curl http://localhost:8000/media/specs | jq .twitter
Python:
from media import transcode_image
transcode_image("photo.jpg", "instagram") # → photo.instagram.jpg
AI caption adapter
One source text → per-platform rewrites. Respects character limits and style conventions (Twitter punchy, LinkedIn formal, Instagram hashtag-heavy). Falls back to a heuristic when no LLM is configured — the endpoint never 500s on missing credentials.
Provider priority: Ollama (free, local) → OpenRouter (any cloud model) → heuristic (no LLM). Set OPENROUTER_API_KEY or OLLAMA_HOST in .env to enable AI rewrites.
Accessing the API
Once running, the API is at http://localhost:8000 — no auth by default (designed for trusted self-hosting).
Exposing to the internet? Put it behind Cloudflare Access, Tailscale, or basic auth first. See SECURITY.md.
Tests
pytest -q
# Full suite (schema, queue, API, media, profiles, adapters, and docs coverage). See CI for the current count. No credentials required; live integration tests run only when a DSN is provided.
MCP server (mcp_server.py — 10 tools, works with Claude Desktop, Cursor, any MCP client;
compatible with mcp 1.x and 2.x)
Video transcoding (ffmpeg-backed)
Calendar view in dashboard
Analytics (fetch engagement metrics per post)
PyPI publish
Third-party adapter backends
Some adapters support an alternative backend via an env var. These backends route your content and credentials through a third-party service instead of the platform’s official API. They are fully opt-in — the default backend never changes.
See CONTRIBUTING.md. The adapter contract is one function — adding a platform is ~80 LOC.
Operations: queue failures and quarantined jobs
When a queue backend is down
With REDIS_URL or DATABASE_URL set, Open Dispatch fails closed: if that
backend cannot be reached, the API returns 503 on every dispatch and
/healthz reports "status": "degraded" with the exact fix in
queue_error. The worker logs
queue backend unavailable: … — retrying in Ns and keeps polling. Nothing is
silently moved to a different store. To deliberately switch backends, unset the
env var (jobs stay in the old store — migrate before switching).
Recovering a quarantined job
If a worker dies mid-publish (crash, OOM, SIGKILL), the row is stuck in
publishing until the stale-claim reaper (WORKER_PUBLISHING_LEASE, default
900 s) moves it to failed with the error
“publish outcome unknown — verify on the platform before retrying to avoid a
duplicate post”.
The reaper cannot know whether the platform accepted the post — so it
never auto-requeues. To recover:
Check the platform for the post (by text/account, or your platform’s
recent-posts API).
If the post went out: leave the row as-is (or delete it) — retrying would
double-post.
If it did not go out: dispatch queue retry <row-id> (or the dashboard’s
Retry button), which re-queues it normally.
Quarantined rows are visible on the health dashboard under recent errors.
Worker concurrency
WORKER_CONCURRENCY (default 1) bounds how many rows one worker publishes
in parallel. Claims stay atomic per backend, so rows are never
double-published, but each slot multiplies load on the platform API — keep it
at or below your platform rate limits. JSONL saturates around 4 slots (file
lock contention); Postgres/Redis scale further. An invalid value falls back
to 1 with a warning in the worker log.
Security
See SECURITY.md. Report vulnerabilities via GitHub Security Advisories (private disclosure).
Moving off Buffer, Hootsuite, or a similar paid tool? The step-by-step guide is in
docs/migrating-from-zernio.md — export your accounts,
map them to .env, and dispatch your first post in about ten minutes.
评论