# Railway

Deploy kogut on Railway with a persistent volume.

Run kogut on [Railway](https://railway.com), separate from the servers it monitors.

1. Open the [kogut template](https://railway.com/deploy/kogut) and select **Deploy Now**.

2. Keep the volume at `/data` across redeploys. Railway creates a public domain.

3. In **Variables**, set `KOGUT_URL` to the service's HTTPS URL.

4. Open the URL and create your account with the setup token: search the deploy log for
   `setup_token`.

The `kogut-setup` [agent skill](https://docs.kogut.dev/reference/mcp/#agent-skills) can do the rest over
the API: it tells you what to click on Railway and asks for the setup token.

## Use a custom domain

Add the domain under **Settings → Networking → Custom Domain**, create the DNS record
Railway shows, and change `KOGUT_URL` to the new HTTPS URL.

## Configure proxy trust

If you know Railway's proxy address range, add it to `[server] trusted_proxies` in
`kogut.toml`. Otherwise all visitors through that proxy share one rate limit. See
[Client addresses behind a proxy](https://docs.kogut.dev/installation/caddy/#client-addresses-behind-a-proxy).

## Monitor servers and internal services

[Install the agent](https://docs.kogut.dev/agent/installing/) on each server with the Railway HTTPS URL,
and allow outbound HTTPS to it.

Use `from` to run checks inside private networks. If Railway blocks ICMP, run ping checks
from an agent or use a TCP check. See [Internal services](https://docs.kogut.dev/monitoring/internal-services/).

## Update

Redeploy to pull the latest patch of the template's `0.1` image tag. Read
[Upgrading](https://docs.kogut.dev/installation/upgrading/) before changing minor versions.
