---
title: "Deploy Railway Caddy Function"
description: "Quickly run any Caddyfile in a Railway container."
category: "Other"
url: https://railway.com/deploy/railway-caddy-function
---

# Deploy Railway Caddy Function

Quickly run any Caddyfile in a Railway container.

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

- **Creator:** Noah templates
- **Category:** Other

## Template content

### railway-function-caddy https://caddyserver.com/resources/images/favicon.png

- **Image:** ghcr.io/thesamgordon/railway-function-caddy
- **Start command:** `/bin/sh -c "exec sh run.sh $CADDYFILE"`

## Documentation

# Deploy a Caddyfile on Railway
Quickly create a Caddy proxy on a Railway hosted container. Read more about Caddy here: https://caddyserver.com/

## Hosting a Caddyfile
Encode your Caddyfile to a base64 string using any tool of your choice. I used https://www.base64encode.org/.

Take the output string and put it in the `CADDYFILE` environmental variable. Deploy the container and it will create a Caddy server with the configuration you provided.

## 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/railway-caddy-function
