Railway: deployment failing silently [2026 fix]
Build succeeds but app won't start; Railway's default Node.js memory limit (512MB) kills process before logs appear.
Railway: Deployment Failing Silently – 2am Emergency Fix
TL;DR
Cause: Railway's 512MB default memory limit silently OOMKills your app before error logs reach the console. Fix: SetRAILWAY_RUNTIME_ENVIRONMENT and explicit memory limits in railway.json, or scale to 1GB+ dyno equivalent.---
Real Console Error Messages
These are the exact messages (or *absence* thereof) that indicate this issue:
``` Error 1: Build succeeds, deployment shows "Live" but app crashes instantly No error logs in Railway logs tab—just silence.
Error 2: [Railway] Deployment Status: Live ✓ [2024-12-15T02:14:33Z] Service crashed [No further output]
Error 3: Node process exited with status code 137 (Exit code 137 = SIGKILL from memory pressure)
Error 4: Build completed successfully Container started [crickets]
Error 5: ESTABLISH: {"level":"error","msg":"heap out of memory"} [Process terminated before stack trace written] ```
---
Broken Code vs. Exact Fix
❌ BROKEN: Default railway.json (or no config)
```json { "$schema": "https://railway.app/railway.schema.json", "build": { "builder": "nixpacks" }, "deploy": { "numReplicas": 1 } } ```
Problem: No memory specification means Railway defaults to 512MB. Node.js overhead + your app = instant OOM kill.
✅ FIXED: Explicit memory + environment
```json { "$schema": "https://railway.app/railway.schema.json", "build": { "builder": "nixpacks" }, "deploy": { "numReplicas": 1, "startCommand": "node --max-old-space-size=384 server.js", "restartPolicyMaxRetries": 5, "restartPolicyWindowMs": 60000 } } ```
And in your .env.railway (or Railway dashboard Variables tab):
```bash NODE_ENV=production NODE_OPTIONS=--max-old-space-size=384 RAILWAY_RUNTIME_ENVIRONMENT=production ```
And upgrade your plan in Railway dashboard:
---
Why This Happens
Railway's OOMKill is intentionally silent to prevent log spam. When a process exceeds memory limits:
1. Linux kernel sends SIGKILL (signal 9—cannot be caught) 2. Process dies *before* Node.js can flush error buffers to stdout 3. Railway logs show deployment as "Live" (because container *started*) 4. Your app is actually dead 5. Railway's crash detection retries, but same OOM occurs 6. Loop repeats silently
Key point: This is *not* a Railway bug—it's correct OOMKill behavior. You're just hitting the memory ceiling.
---
Step-by-Step Fix
Step 1: Add memory limits immediately
```bash
Push this railway.json to your repo
git add railway.json git commit -m "fix: explicit memory limits for railway deployment" git push ```Step 2: Check current memory usage
In Railway dashboard → "Logs" tab, look for:
``` Heap Size: X / 512MB ```
If your app uses >400MB, you need ≥1GB plan.
Step 3: Scale up OR optimize
Option A (Quick): Railway Dashboard → "Environment" → increase Memory slider to 1GB+
Option B (Optimized): Keep 512MB but reduce app footprint:
```javascript // Before: loads entire DB into memory const data = await db.find({});
// After: stream results const cursor = db.find({}).batchSize(100); ```
Step 4: Redeploy and verify
```bash git commit --allow-empty -m "trigger railway redeploy" git push ```
Wait 2-3 minutes. Check logs for your app output (not just "Live" status).
---
Still broken? Check these too
1. [Nixpacks build optimization](/?guide=railway-nixpacks-large-builds) – Your build artifact might be bloated; slim down node_modules with npm ci --omit=dev
2. [Production environment variables not set](/?guide=railway-env-not-loading) – Missing NODE_ENV=production can prevent optimizations (e.g., dev dependencies still loaded)
3. Port binding issues – App crashes silently if it can't bind to PORT. Ensure: const port = process.env.PORT || 3000; app.listen(port) *with error handler*
---
Version Notes
As of 2026: Railway's memory limits and Nixpacks behavior match this guide. However: Railway changed memory UI twice in 2024–2025. If your dashboard looks different, check the official docs link below to confirm memory settings location.
---
Official Docs
---
Found a different variation? Drop it in the comments
Silent failures on Railway can also stem from: failed health checks, port conflicts, or broken start scripts. If your error looks different, reply with the full railway logs output and exact error code.