Guides

Connect Railway to Uptimy Cloud

Paste a Railway project token, pick your services, and get a monitor for each, incidents for crashed and failed deploys, and automatic restarts. About five minutes.

Uptimy Cloud or Uptimy Agent?

This guide connects Railway to Uptimy Cloud, which checks your services from outside Railway and can restart them. To check private services and databases from inside your project, deploy the open-source agent instead, or next to it: see Deploy Uptimy Agent on Railway.

Overview

Uptimy's Railway integration reads your project with a project token and sets up three things:

  • Monitors: an HTTP check for each service with a public domain, from several regions. Every plan, within its monitor limits.
  • Deploy events: a crashed or failed deploy opens an incident, including for workers and databases, which have no address to check.
  • Self-healing: a workflow that restarts or redeploys a service when its incident opens, with limits that stop a flapping service from restarting in a loop. Growth and above.

1. Create a project token

In Railway, open your project's Settings → Tokens and create a token for the environment you want to monitor, usually production. A project token is scoped to that one project and environment. Uptimy uses it to list the services, and to restart them from a self-healing workflow. It's encrypted at rest and never shown again.

2. Import your services

New to Uptimy? Create an account and choose Import from Railway during setup. The workspace is named after your Railway project.

In an existing workspace:

  1. Open Settings → Integrations, choose Railway and paste the token.
  2. Click Import monitors on the Railway card.
  3. Untick the services you don't want, adjust each health path and expected status, and import.

Services without a public domain, such as workers and databases, are added without a monitor. They still get deploy incidents, and can still be restarted. Imported monitors count toward your plan's limits.

3. Turn on deploy events

On the Railway card in Settings → Integrations, click Webhook URL and copy it. In Railway, paste it under Project → Settings → Webhooks. The URL contains a secret, so treat it like a password. From then on:

  • A crashed deploy opens a high-severity incident, even for a worker with no URL, and even when its HTTP check looks fine.
  • A failed deploy opens a medium-severity incident. The previous deploy keeps serving.
  • A successful deploy resolves it.
  • Three crashes in ten minutes escalate the incident to critical. That's a service crashing and restarting faster than any check can catch.

Repeated crashes stay one incident instead of a page each.

4. Restart services automatically

After the import, Create self-healing workflow builds a workflow with one branch per imported service: when that service's monitor opens an incident, the Railway self-heal step restarts its latest deployment. Switch the step to Redeploy for a full redeploy instead.

The step comes with guardrails:

  • A resolved incident never triggers an action.
  • A cooldown between actions on the same service, 10 minutes by default.
  • At most 3 actions per incident by default. If those didn't fix it, a fourth won't.

Every action, and every one skipped with its reason, is in the workflow's run details. Add a message step after it so a person hears about restarts too. See Workflows.

Plans

Importing, monitoring and deploy events work on every plan. The Railway self-heal step comes with Growth and above.

Private services and databases

Uptimy checks from outside Railway, so services without a public domain and your Postgres, MySQL or Redis have no address it can reach. Deploy events cover crashes, but not whether a worker is healthy or a database still accepts logins. For that, run Uptimy Agent in your Railway project: it checks *.railway.internal services and databases over private networking. Connected to Uptimy Cloud, its monitors show up next to the others.

Troubleshooting

  • No incidents for crashes: check that the webhook URL is saved in the Railway project's settings, and that the crashed service was imported. Events for services that weren't imported are ignored.
  • The import shows services from the wrong environment: project tokens belong to one environment. Create one for the environment you want and connect it as another integration.
  • A restart failed: the run details show Railway's answer. A token that was deleted in Railway fails every call. Connect a new one under Settings → Integrations.

Next steps