
Deploy Apache APISIX
Cloud-native API and AI gateway with etcd and the built-in dashboard
Just deployed
dashboard
Just deployed
Just deployed
/var/lib/etcd
Deploy and Host Apache APISIX on Railway
Apache APISIX is an open-source, cloud-native API and AI gateway from the Apache Software Foundation. Built on NGINX and OpenResty, it routes, load-balances, authenticates and rate-limits traffic to your services, with more than 100 plugins. Routes and plugins change at runtime through its Admin API or built-in dashboard, without restarts.
About Hosting Apache APISIX
APISIX keeps all of its configuration (routes, upstreams, consumers, plugins, certificates) in etcd, so a working setup needs two stateful pieces wired together: the gateway and an etcd store with authentication and persistent storage. This template deploys APISIX 3.20.0, a single-node etcd 3.6 with authentication enabled on first boot and its data on a Railway volume, and a small proxy that publishes the built-in dashboard on its own HTTPS domain. The admin key, the etcd password and the data-encryption key are generated per deployment. The gateway waits for etcd before it starts, and every service has a health check.
Common Use Cases
- Put one gateway in front of several Railway services, with routing by host or path, load balancing and retries
- Add API keys, JWT, OpenID Connect, rate limits, CORS or IP restrictions to APIs without changing their code
- Proxy and govern LLM traffic with the AI plugins (ai-proxy, token rate limits, prompt guards)
Dependencies for Apache APISIX Hosting
- etcd 3.x for configuration storage (included, with authentication and a volume)
- A public HTTPS domain for the gateway (Railway provides one)
Deployment Dependencies
- Apache APISIX docs: https://apisix.apache.org/docs/apisix/getting-started/README/
- Admin API reference: https://apisix.apache.org/docs/apisix/admin-api/
- Template source (Dockerfiles, config, changelog): https://github.com/aalfath/apisix-railway-template
Implementation Details
The template runs three services, all built from the public template repo:
- apisix: the gateway (apache/apisix 3.20.0, pinned by digest). Its public domain serves your routes on port 9080. The Admin API (port 9180) is private. Railway checks health on /status/ready, which answers only once every worker has its configuration from etcd.
- etcd: etcd 3.6.17 with authentication, data on a volume at /var/lib/etcd. Private only.
- dashboard: a Caddy proxy that publishes the APISIX dashboard (/ui/) and the Admin API (/apisix/admin/) on a second HTTPS domain. Every Admin API call needs the admin key.
Nothing has to be filled in at deploy time. After deploying:
- Open the dashboard service's domain. It redirects to /ui/.
- Copy APISIX_ADMIN_KEY from the apisix service's variables and enter it in the dashboard settings.
- Create an upstream and a route. They answer on the apisix service's domain.
From the command line:
curl https://YOUR-DASHBOARD-DOMAIN/apisix/admin/routes -H "X-API-KEY: YOUR-ADMIN-KEY"
Keep APISIX_KEYRING unchanged after the first deploy: it encrypts SSL keys and secret plugin fields in etcd. The template does not include stream (TCP/UDP) proxying or APISIX's own TLS listener, because Railway's public domains carry HTTP and end TLS at the edge.
Updates: image versions are pinned in the repo's Dockerfiles. When a new APISIX version has been tested, it lands on the repo's main branch with a changelog entry, and Railway shows an "update available" notice on your project. Your configuration stays in etcd across updates.
Why Deploy Apache APISIX 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 Apache APISIX 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.
Template Content
