selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Tyk logo

Self-host Tyk

v5.8.20

Open-source API and AI gateway for REST, GraphQL, gRPC, MCP

ReleaseOpen CoreMPL-2.0
sudo yum install -y tyk-gateway
Updatedyesterday
LanguageGo
Setup difficultyModerate
Stars
10 879
Port
8080 (Gateway listens for proxied API traffic (listen_port))
Requires
Redis
Docker
tykio/tyk-gateway
Tyk screenshot 1

What 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

All self-hosted alternatives to Kong →

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

Tyk README

tyk-github-header License: MPL 2.0 FOSSA Status

GitHub Latest Release GitHub Release Date Docker Pulls GitHub Workflow Status (with event) Go Report Card

GitHub commit activity GitHub Repo Stars GitHub Repo Forks X twitter Follow


How to install Tyk

Install Tyk with Docker Compose

Create a file named tyk.conf with the Gateway config (listen_port, secret, template_path, app_path and a Redis storage block). On Linux create the apps folder for user 65532:

mkdir apps
sudo chown 65532:65532 apps

Create a file named docker-compose.yml:

services:
  tyk-gateway:
    image: tykio/tyk-gateway:v5.15.1
    ports:
      - "8080:8080"
    volumes:
      - ./tyk.conf:/opt/tyk-gateway/tyk.conf
      - ./apps:/opt/tyk-gateway/apps
    depends_on:
      - tyk-redis
  tyk-redis:
    image: redis:8.2.0
    ports:
      - "6379:6379"

Then start it:

docker compose up -d

Verify with curl localhost:8080/hello.

Open-source gateway plus a Redis container.

How to configure Tyk

  • TYK_GW_SECRETEnvironment variable form of the secret setting (string)

    values: string

  • listen_port8080Port the Gateway listens on; env override TYK_GW_LISTENPORT

    values: int

  • listen_addressForce the Gateway onto a specific IP when the machine has several

    values: string

  • hostnameRestrict the Gateway to one domain name; env TYK_GW_HOSTNAME

    values: string

  • secretGateway API credentials sent as the X-Tyk-Authorization header; env TYK_GW_SECRET

    values: string

Tyk releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

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

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…