---
title: "Deploy OpenResty"
description: "Programmable Nginx web server with Lua APIs and health checks."
category: "Starters"
url: https://railway.com/deploy/openresty
---

# Deploy OpenResty

Programmable Nginx web server with Lua APIs and health checks.

**[Deploy OpenResty on Railway](https://railway.com/template/openresty)**

- **Creator:** Tom
- **Category:** Starters

## Template content

### OpenResty https://raw.githubusercontent.com/monotykamary/railway-template-openresty/main/assets/openresty-icon.png

- **Source:** https://github.com/monotykamary/railway-template-openresty
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenResty with Railway

OpenResty combines Nginx with LuaJIT and a curated set of high-performance modules for programmable web applications, gateways, and proxies. This template deploys a pinned OpenResty release with sample Lua APIs, a browser landing page, structured logs, security headers, and an HTTP health check.

## About Hosting OpenResty

Hosting OpenResty provides an event-driven server that can execute Lua directly in the Nginx request lifecycle. This Railway starter configures the assigned port at container startup, serves a static landing page, exposes testable Lua endpoints, records JSON access logs, and supplies a dedicated readiness endpoint. The included fat image provides OPM and LuaRocks, making it straightforward to add OpenResty libraries while retaining a reproducible base version.

## Common Use Cases

- Build lightweight JSON APIs with Lua
- Create programmable reverse proxies and API gateways
- Perform request validation, transformation, and routing at the edge
- Serve static applications with dynamic server-side endpoints
- Prototype high-concurrency web services without a separate application runtime

## Dependencies for OpenResty Hosting

- OpenResty 1.31.1.1
- Official Docker packaging revision 2 on Debian Bookworm
- LuaJIT and bundled OpenResty modules
- OPM and LuaRocks package managers

### Deployment Dependencies

- [OpenResty documentation](https://openresty.org/en/)
- [OpenResty Lua API reference](https://github.com/openresty/lua-nginx-module#readme)
- [Official Docker tooling](https://github.com/openresty/docker-openresty)
- [Template source repository](https://github.com/monotykamary/railway-template-openresty)

### Implementation Details

The startup wrapper validates Railway's `PORT`, renders the Nginx server configuration, and launches OpenResty in the foreground. Lua handlers use the bundled safe JSON encoder. The configuration adds structured access logs, request IDs, a 1 MiB body limit, and baseline browser security headers. The service is stateless and requires no database or persistent volume.

### Why Deploy OpenResty on Railway?

Railway provides reproducible source builds, HTTPS networking, deployment health checks, logs, and restart management around OpenResty. This produces a small programmable web platform without managing a host, TLS certificates, or a separate load balancer.


## Similar templates

- [open-excalidraw](https://railway.com/deploy/open-excalidraw) — Self-hostable collaborative drawing built on Excalidraw
- [caring-vibrancy](https://railway.com/deploy/caring-vibrancy) — Deploy and Host caring-vibrancy with Railway
- [Appsmith](https://railway.com/deploy/appsmith-1) — Low-code platform for internal tools, dashboards, and admin panels.

Open this page in a browser: https://railway.com/deploy/openresty
