Railway & Render
Deploy Node.js, Python, and Docker backends with zero server management — databases included
Skills taught: deployment.railway, deployment.render, deployment.paas, deployment.managed-postgres, deployment.background-workers
Platform as a Service — the Heroku successors
Railway and Render are modern Platform as a Service (PaaS) providers — you give them your code or a Docker image, they handle everything else: provisioning servers, load balancing, auto-restart on crash, SSL, logging, and monitoring. Unlike EC2 (where you manage the OS) or ECS (where you manage container orchestration), PaaS requires near-zero ops knowledge. They're the fastest way to get a Node.js API or Python service into production with a real database.
Railway — deploy in 60 seconds
# Install Railway CLI
npm install -g @railway/cli
# Login
railway login
# Initialize a new project
railway init
# Or link to existing: railway link
# Deploy current directory
railway up
# Railway detects your framework automatically:
# - Node.js: runs 'npm start' (set in package.json)
# - Python: runs gunicorn or uvicorn
# - Dockerfile: builds and runs your container
# - No Dockerfile? Railway buildpacks detect your runtime
# Add a PostgreSQL database (one command):
railway add --plugin postgresql
# Sets DATABASE_URL in your environment automatically!
# Add Redis:
railway add --plugin redis
# Sets REDIS_URL automatically
# Run a one-off command (migrations, seeds):
railway run npm run db:migrate
# View logs:
railway logs
# Open your deployed app:
railway open
# Environment variables:
railway variables set NODE_ENV=production
railway variables set JWT_SECRET=mysecretkey
railway variables list
Render — free tier, auto-sleep
# render.yaml in your repo root
# Defines all your services declaratively
services:
# Web service (your Node.js API)
- type: web
name: myapp-api
runtime: node
plan: starter # $7/month, or 'free' (sleeps after 15min inactive)
buildCommand: npm ci && npm run build
startCommand: npm start
healthCheckPath: /health
envVars:
- key: NODE_ENV
value: production
- key: DATABASE_URL
fromDatabase:
name: myapp-db
property: connectionString
- key: JWT_SECRET
generateValue: true # Render generates a random secret
# Background worker
- type: worker
name: myapp-worker
runtime: node
buildCommand: npm ci
startCommand: node workers/email.js
envVars:
- fromService:
name: myapp-api
type: web
envVarKey: DATABASE_URL
databases:
- name: myapp-db
plan: starter # $7/month for persistent PostgreSQL
databaseName: myapp
user: myapp
Railway vs Render — comparison
RAILWAY:
Pricing: Pay for what you use (usage-based, not plans)
~$0.000231/vCPU-minute, ~$0.0000128/MB-minute
$5 free credit/month on Hobby plan
Database: PostgreSQL, MySQL, Redis, MongoDB as plugins
DX: Best-in-class — 'railway up' is 1 command deploy
Best for: Rapid prototyping, startups, any language/framework
No sleep: Services stay awake always (unlike Render free tier)
RENDER:
Pricing: Starter web service: $7/month
Free tier: web services (sleep after 15min)
Database: Managed PostgreSQL, Redis
DX: render.yaml IaC, GitHub auto-deploy
Best for: Simpler projects, teams wanting predictable pricing
Free tier: Good for personal projects that tolerate cold starts
BOTH:
✓ Automatic HTTPS
✓ GitHub/GitLab deploy on push
✓ Environment variables
✓ PostgreSQL and Redis
✓ Custom domains
✓ Zero server management
HEROKU COMPARISON:
Railway and Render are what Heroku used to be before price changes
Both offer better value and similar or better DX
Tip: Render's free tier web services sleep after 15 minutes of inactivity. When the first request arrives after sleeping, the service cold-starts (taking 30-60 seconds). This is fine for personal projects and portfolios. For anything with real users, use a paid tier or keep the service awake with a periodic ping (a health check every 10 minutes). Railway's free tier doesn't sleep, but has $5/month credit limits.
Frequently Asked Questions
Should I use Railway/Render or AWS for my startup?
Start with Railway or Render. They're 10x faster to get running, require no AWS knowledge, and cost $5-20/month for a typical small app. Migrate to AWS when: you need specific AWS services (SQS, Lambda at scale, custom VPC networking), your bill exceeds $100/month and AWS would be cheaper, or you need compliance certifications that AWS has but PaaS doesn't. Most startups are on PaaS until well after product-market fit.