---
title: "Deploy Caddy"
description: "A static website with automatic HTTPS using a Caddy web server."
category: "Starters"
url: https://railway.com/deploy/caddy-starter
---

# Deploy Caddy

A static website with automatic HTTPS using a Caddy web server.

**[Deploy Caddy on Railway](https://railway.com/template/caddy-starter)**

- **Creator:** alphasec
- **Category:** Starters
- **Total deploys:** 213

## Template content

### caddy https://raw.githubusercontent.com/caddyserver/website/07c51663ab3cf37c8831eefeb64383a10af3a4a5/src/resources/images/favicon.png

- **Source:** alphasecio/caddy-server
- **Public domain:** Yes

## Documentation

# Deploy and Host Caddy on Railway

Caddy is a lightweight, open-source web server written in Go that compiles to a single static binary. It serves static files, handles reverse proxying, and manages TLS certificates automatically — making it an efficient alternative to NGINX for simple web serving needs.

## About Hosting Caddy

This Railway template deploys a static website using Caddy from the [alphasecio/caddy-server](https://github.com/alphasecio/caddy-server) GitHub repository. The `site/` directory contains your static files (HTML, CSS, assets), and the `Caddyfile` configures the server. Railway handles TLS and HTTPS at the platform level, so Caddy's automatic HTTPS is intentionally disabled in the Caddyfile — no certificate configuration needed. Replace the default `index.html` and `styles.css` in `site/` with your own content and redeploy.

## Common Use Cases

- **Static website hosting** — serve HTML, CSS, and asset files over HTTPS with minimal configuration and zero runtime dependencies
- **Landing pages and portfolios** — deploy a fast, lightweight personal site or project page without a full web framework
- **Reverse proxy** — extend the Caddyfile to proxy requests to backend services running elsewhere in your Railway project

## Dependencies for Caddy Hosting

- [alphasecio/caddy-server GitHub repository](https://github.com/alphasecio/caddy-server)

### Deployment Dependencies

- [Caddy documentation](https://caddyserver.com/docs/)
- [Caddyfile reference](https://caddyserver.com/docs/caddyfile)
- [alphasecio/caddy-server GitHub repository](https://github.com/alphasecio/caddy-server)
- [alphasec guide: How to Deploy a Static Website with Caddy on Railway](https://alphasec.io/how-to-deploy-a-static-website-with-caddy-on-railway/)

### Implementation Details
 
The `Caddyfile` is configured to serve files from `site/` on the port Railway injects via the `PORT` environment variable, with automatic HTTPS disabled (Railway handles TLS):
 
```caddyfile
:{$PORT} {
    root * /srv/site
    file_server
    encode gzip
}
```
 
To customise, fork the repository and edit the files in `site/`. 

## Why Deploy Caddy 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 Caddy 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

- [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/caddy-starter
