---
title: "Deploy Tyk Gateway"
description: "Tyk Gateway 5.15: open-source API gateway with keys and rate limits."
category: "Other"
url: https://railway.com/deploy/tyk-gateway
---

# Deploy Tyk Gateway

Tyk Gateway 5.15: open-source API gateway with keys and rate limits.

**[Deploy Tyk Gateway on Railway](https://railway.com/template/tyk-gateway)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/tyk-gateway/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### tyk https://github.com/TykTechnologies.png

- **Image:** tykio/tyk-gateway:v5.15.0
- **Health check:** /hello
- **Public domain:** Yes

## Documentation

# Deploy and Host Tyk Gateway on Railway

Tyk Gateway is an open-source API gateway written in Go. It sits in front of your services and handles API keys, JWT and OAuth validation, rate limits, quotas, caching and request transforms. APIs and keys are managed through the Gateway's own REST API, so it fits GitOps and CI pipelines without a dashboard.

## About Hosting Tyk Gateway

This template runs the official `tykio/tyk-gateway:v5.15.0` image with a Railway Redis database, which holds keys, quotas and rate-limit counters. API definitions and policies are JSON files on a Railway volume, so they survive redeploys. The management API under `/tyk/` shares the public HTTPS domain and requires the generated `TYK_GW_SECRET` in the `x-tyk-authorization` header. Keys are stored hashed, and analytics are off. The image is distroless and cannot fix the volume's ownership, so it runs as root. Tyk's dashboard and developer portal are commercial and not included; this is the open-source gateway on its own.

## Common Use Cases

- API keys, rate limits and quotas in front of internal services
- A single entry point that validates JWTs before requests reach your apps
- Managing API definitions as code through the Gateway API in CI

## Dependencies for Tyk Gateway Hosting

- `tykio/tyk-gateway:v5.15.0` (official OSS image)
- Railway Redis and a volume at `/opt/tyk-gateway/apps`

### Deployment Dependencies

- [Tyk documentation](https://tyk.io/docs/)
- [Tyk Gateway API](https://tyk.io/docs/tyk-gateway-api/)
- [Tyk on GitHub](https://github.com/TykTechnologies/tyk)

### Implementation Details

| Service | Source | Networking | Storage |
| --- | --- | --- | --- |
| tyk | `tykio/tyk-gateway:v5.15.0` | public HTTPS | volume at `/opt/tyk-gateway/apps` |
| Redis | Railway Redis | private | volume |

| Variable | Purpose |
| --- | --- |
| `TYK_GW_SECRET` | Management API secret (`x-tyk-authorization` header) |
| `TYK_GW_APPPATH`, `TYK_GW_POLICIES_POLICYPATH` | Both point at the volume, so APIs and policies persist |
| `TYK_GW_HASHKEYS` | `true`: keys are stored hashed in Redis |
| `TYK_URL` | Public URL |

Add an API, reload, create a key:

```bash
curl -XPOST "$TYK_URL/tyk/apis" -H "x-tyk-authorization: $TYK_GW_SECRET" -d @api.json
curl "$TYK_URL/tyk/reload/group" -H "x-tyk-authorization: $TYK_GW_SECRET"
curl -XPOST "$TYK_URL/tyk/keys" -H "x-tyk-authorization: $TYK_GW_SECRET" -d @key.json
```

Point `proxy.target_url` at private addresses such as `http://api.railway.internal:8080`. Tyk forwards the client's `Authorization` header to the upstream unless the API sets `strip_auth_data`. Because APIs and policies share one folder, Tyk logs a harmless parse warning for policy files at startup.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by Tyk Technologies.

## Why Deploy Tyk Gateway on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Tyk Gateway on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/tyk-gateway
