Skip to main content
Hosting

Get phone alerts when your Railway service crashes

Hugin Alerts delivers a push notification to your phone within seconds of a Railway crash or resource issue. Add one HTTP call to your app code — that's all it takes to never miss a production incident.

Last updated:

What you can monitor with Railway

Deployment succeeded or failed
Service crashed or restarted
Build failures
Resource usage alerts
Database connection issues
Scheduled job completions

Setup guide

Get started in minutes

1

How Railway notifications work

Railway supports deploy notifications through its integrations. But for crashes, resource issues, and custom events, there's no built-in webhook system. Instead, you add a simple HTTP call to your application code — on startup, in error handlers, after cron jobs. The question is: where do you send those notifications?

2

Get a notification endpoint from Hugin Alerts

Hugin Alerts is a service that receives HTTP requests and turns them into push notifications on your phone. Install the app and tap "Get started" — you get a unique ingest key immediately. No sign-up, no email, no credit card.

3

Add the Hugin key to Railway

Store your ingest key as an environment variable in Railway so your application can use it.

bash
# Railway Dashboard → Your Service → Variables → Add
# Key: HUGIN_KEY
# Value: your-ingest-key-here

# This is also available via the Railway CLI:
railway variables set HUGIN_KEY=your-ingest-key-here
4

Send notifications from your app

Add notification calls at key points — startup (to detect restarts), error handlers (to catch crashes), and after cron jobs.

javascript
// Add to your application entry point (e.g., index.ts)
const HUGIN_KEY = process.env.HUGIN_KEY;

// Notify on startup
if (HUGIN_KEY) {
  fetch('https://api.huginalerts.com/v1/events', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${HUGIN_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      system: 'railway',
      event: 'service_started',
      description: `Service started on Railway — ${process.env.RAILWAY_SERVICE_NAME || 'unknown'}`,
    }),
  }).catch(() => {});
}

// Notify on uncaught errors
process.on('uncaughtException', async (err) => {
  if (HUGIN_KEY) {
    await fetch('https://api.huginalerts.com/v1/events', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${HUGIN_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        system: 'railway',
        event: 'crash',
        description: `Service crashed: ${err.message}`,
      }),
    }).catch(() => {});
  }
  process.exit(1);
});

Examples

Ready-to-use examples

Deployment success notification

Get notified when your Railway deployment goes live.

bash
curl -X POST https://api.huginalerts.com/v1/events \
  -H "Authorization: Bearer YOUR_INGEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "system": "railway",
    "event": "deploy_success",
    "description": "API server deployed to Railway — build #147"
  }'

Service crash notification

Know instantly when your Railway service goes down.

bash
curl -X POST https://api.huginalerts.com/v1/events \
  -H "Authorization: Bearer YOUR_INGEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "system": "railway",
    "event": "crash",
    "description": "API server crashed — OOMKilled: memory limit exceeded"
  }'

Cron job completion notification

Track your Railway cron service runs.

bash
curl -X POST https://api.huginalerts.com/v1/events \
  -H "Authorization: Bearer YOUR_INGEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "system": "railway",
    "event": "cron_complete",
    "description": "Nightly database backup completed — 2.3 GB exported"
  }'

Frequently asked questions

How do I get push notifications when my Railway service crashes?
Use Hugin Alerts. Add a startup notification and an uncaught exception handler to your app code that sends an HTTP POST to the Hugin API. When your service crashes or restarts, you get an instant push notification on your iPhone or Android. Setup takes under 60 seconds — no account required.
Does Railway have built-in webhook support for crashes?
Railway supports deploy notifications via integrations, but not crash or health-check webhooks. For those, you need to send notifications from your application code as shown above.
How do I detect crash loops on Railway?
Add the startup notification shown in the setup steps. If your service restarts, you get a notification each time. Frequent restart notifications mean a crash loop — exactly the kind of thing you want to know about immediately.
Does this work with Docker deployments on Railway?
Yes. Add the HUGIN_KEY environment variable in Railway and use it in your Docker entrypoint script or application code. The HTTP call works from any language or runtime — Node.js, Python, Go, Rust, or a simple shell script.
Can I monitor Railway cron jobs with Hugin Alerts?
Yes. Add a Hugin API call at the end of your cron job script. Send a success event when the job completes, or an error event if it fails. This way you know immediately if a scheduled task breaks instead of discovering it days later.
How do I add the Hugin key to Railway?
In the Railway dashboard, go to your service → Variables → Add HUGIN_KEY with your ingest key. It's also available via the Railway CLI: railway variables set HUGIN_KEY=your-ingest-key-here.
What is Hugin Alerts?
Hugin Alerts is a push notification service for developers. Send one HTTP request from any system — Railway services, CI/CD, cron jobs, scripts — and get an instant push notification on your phone. No sign-up, no email, no credit card. Free during early access.

Start getting Railway alerts now

Set up takes less than a minute. No sign-up, no email, no credit card.

Get started for free