Self-host Tyk
v5.8.20Open-source API and AI gateway for REST, GraphQL, gRPC, MCP
sudo yum install -y tyk-gateway- Stars
- 10 879
- Port
- 8080 (Gateway listens for proxied API traffic (listen_port))
- Requires
- Redis
tykio/tyk-gatewayWhat is Tyk?
Tyk Gateway is the Go-based, community-licensed core of Tyk's API management platform: a reverse proxy and policy engine for REST, SOAP, GraphQL, gRPC, TCP and Model Context Protocol traffic. It authenticates consumers with OIDC, JWT, static bearer tokens, basic auth or client certificates, enforces per-consumer rate limits and quotas, versions APIs, rewrites headers and payloads, allows or blocks endpoints, emits webhooks on events and reloads its configuration without dropping in-flight requests. Plugins extend the middleware chain in JavaScript, Go or any gRPC-capable language. The open-source edition has no admin UI: APIs live as JSON definitions in the apps folder or are created through the Gateway management API, and policies come from a file. Self-hosting means the tykio/tyk-gateway container plus Redis; Helm charts, an Ansible playbook, Ubuntu and RHEL/CentOS packages, or compiling from source are documented. Analytics stay raw in Redis until a tool such as Tyk Pump purges them elsewhere. Code under the ee folder is commercial, so the Dashboard, developer portal and Kubernetes operator need a paid or 14-day trial licence, and Tyk Cloud hosts the full stack as SaaS.
Tyk alternatives
mcp-gatewaySelf-hosted MCP gateway converting REST APIs into secured MCP endpoints with multi-tenant isolation, API key/OAuth auth, tool policies, and audit logging.Comparemcp-gateway with Tyk
apisixOpen-source, self-hosted API and AI gateway built on NGINX and etcd, with hot-loaded plugins, dynamic routing, load balancing and rate limiting.Compareapisix with Tyk
agentgatewayOpen-source, self-hosted HTTP and gRPC gateway routing LLM, MCP, A2A and service traffic in one binary, with auth, policy, guardrails, cost controls and observability.Compareagentgateway with Tyk
llm-gatewaySelf-hosted open-source API gateway routing 250+ LLM models from 40+ providers via unified OpenAI-compatible API with cost tracking, caching, and failover.Comparellm-gateway with Tyk
inference-gatewaySelf-hosted gateway that routes requests to 16+ LLM providers through a single OpenAI-compatible endpoint with MCP tools, A2A agents, guardrails, and observability.Compareinference-gateway with Tyk
GoModelThis open-source, self-hosted AI gateway in Go unifies 34 LLM providers behind OpenAI-style and Anthropic-style APIs, adding budgets, caching, routing and audit logs.CompareGoModel with Tyk
mcp-context-forgeAn AI Gateway, registry, and proxy that sits in front of any MCP, A2A, or REST/gRPC APIs, exposing a unified endpoint with centralized discovery, guardrails and management. Optimizes Agent & Tool calling, and supports plugins.Comparemcp-context-forge with Tyk
envoy-ai-gatewayOpen-source AI gateway on Envoy Gateway. One OpenAI-compatible API for providers like OpenAI, Azure, Google Gemini, AWS Bedrock, Anthropic, and self-hosted vLLM.Compareenvoy-ai-gateway with Tyk
Should you self-host Tyk?
Tyk scores 69/100 on selfhost.directory (how scoring works) and ranks #5 of 39 in API Gateway. It has 10 879 GitHub stars, +31 in the last 30 days.
It shipped 7 stable releases in the past year. The latest, v5.8.20, came out on 6 November 2026. New versions land roughly every 5 days.
Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MPL-2.0-licensed and written mostly in Go.
Its closest alternative on selfhost.directory is Traefik (86/100, 65 491 stars). It scores higher overall, so compare the two before you pick. See Tyk vs Traefik side by side.
Features
- Allow / block lists
- Analytics logging
- API-to-MCP generation
- API versioning
- Custom middleware plugins
- Event webhooks
- Granular Access Control
- MCP Gateway
- Multi-protocol API proxying
- OpenAPI import
- Rate limiting and quotas
- Request/response transformation
- Zero-downtime config reload
FAQ
Why does the gateway log "couldn't unmarshal config: invalid character"?
It means a configuration file has invalid JSON syntax; correct the syntax, restart the gateway and validate the files with a JSON linter if it persists.
How can I check which Gateway version I am running?
From version 5.0.8/5.2.3 onwards `tyk version` prints build details, with `--json` for machine-readable output; older builds respond to `tyk --version`.
How do I back up Redis?
Redis holds all keys used by the gateway, so it must be backed up deliberately: it is in-memory and has no built-in backup policy, so follow Redis persistence guidance.
How do I back up the policies file?
When the gateway loads policies from a file for API keys, keep that file in your backup plan; the default name is /policies and it is configurable.
How do I back up API definitions when running the open-source gateway?
If you serve definitions from a directory, include it in your backups; the default location is /apps and the path is configurable.
Which config file belongs to each Tyk component?
Tyk Gateway uses tyk.conf and Tyk Pump uses pump.conf; the Dashboard, MDCB and hybrid gateway use their own files (tyk_analytics.conf, tyk_sink.conf, tyk.hybrid.conf). Those are only default names.
Can I roll back an API or policy configuration after a bad change?
Yes, by configuring Tyk-Sync to keep APIs and policies in a version control system such as GitHub or GitLab and rolling back from there. API keys are not synced.
More in API Gateway
unkeySource-available developer platform for modern APIs: issue and verify API keys, rate limit at a global gateway, deploy apps, and watch usage from one control plane.
unspeechunSpeech is a self-hosted, open-source TTS proxy with an OpenAI-compatible API for multiple cloud providers like ElevenLabs, Azure, and Deepgram.
voidllmSelf-hosted LLM proxy routing to OpenAI, Anthropic, Azure, Ollama, vLLM with load balancing, RBAC, rate limits, and zero-knowledge architecture.
WA-AKGWA-AKG is a self-hosted, open-source WhatsApp gateway with dashboard for managing sessions, scheduling messages, auto-replies, and REST API integration.
WaxumSelf-hosted WhatsApp gateway in Rust with 230+ endpoints for messaging, calls, groups, and webhooks.
Weave RouterOpen-source LLM model router for coding agents like Claude Code, Codex, and Cursor; self-hosted with Docker Compose, it picks the cheapest capable model per request.
wundergraphOpen-source, self-hosted lifecycle manager for federated GraphQL APIs: schema registry, breaking-change checks, router, usage analytics and tracing.
1flowbaseAn open-source AI Gateway and app runtime you host yourself, unifying model access with PostgreSQL storage, workflows, APIs, and React apps via MCP.
9RouterOpen-source, self-hosted AI router giving coding CLIs one OpenAI-compatible endpoint, 3-tier fallback across 60+ providers, token compression and a local dashboard.
agentgatewayOpen-source, self-hosted HTTP and gRPC gateway routing LLM, MCP, A2A and service traffic in one binary, with auth, policy, guardrails, cost controls and observability.
AgentSafeSelf-hosted gateway intercepting AI agent HTTP actions, asking Decionis for authorization, forwarding only approved requests with signed evidence.
ai-apiSelf-hosted AI gateway unifying Azure OpenAI, OpenAI, Anthropic, and Gemini behind one OpenAI-compatible API with revocable credentials and cost tracking.

0 comments