Last Updated: November 21, 2025
Service Types
Web Service
HTTP server with public URL
Private Service
Internal service (no public access)
Background Worker
Long-running processes, queues
Cron Job
Scheduled tasks
Static Site
Static HTML/CSS/JS hosting
PostgreSQL
Managed PostgreSQL database
Redis
Managed Redis instance
render.yaml Blueprint
services:
Define services in render.yaml
- type: web
Web service definition
name: my-app
Service name
env: docker
Use Docker environment
env: node
Use Node.js runtime
buildCommand: npm install && npm run build
Custom build command
startCommand: npm start
Custom start command
plan: starter
Service plan (free, starter, standard, pro)
region: oregon
Deployment region
branch: main
Git branch to deploy
Environment Variables
envVars:
Define environment variables in render.yaml
- key: NODE_ENV value: production
Static environment variable
- key: DATABASE_URL fromDatabase: name: mydb property: connectionString
Reference database connection string
- key: API_KEY sync: false
Secret env var (set in dashboard)
- key: REDIS_URL fromService: name: redis type: redis property: connectionString
Reference Redis connection
- key: PORT value: 10000
Port for web service (auto-set)
$RENDER
Auto-set to true (detect Render)
$RENDER_SERVICE_NAME
Current service name
$RENDER_GIT_COMMIT
Git commit SHA being deployed
Static Sites
- type: web env: static
Define static site in render.yaml
buildCommand: npm run build
Build command for static site
publishPath: ./dist
Directory containing built files
headers: - path: /* name: Cache-Control value: public, max-age=3600
Custom HTTP headers
routes: - type: rewrite source: /* destination: /index.html
Redirect rules for SPA
Databases
databases: - name: mydb plan: starter
PostgreSQL database definition
databaseName: app_db
Custom database name
user: admin
Database username
plan: free
Free tier database (90 days, then expires)
plan: starter
Paid database (persistent)
ipAllowList: - source: 0.0.0.0/0
IP whitelist for database access
Cron Jobs
- type: cron
Define cron job
schedule: "0 0 * * *"
Cron schedule (daily at midnight)
schedule: "*/15 * * * *"
Every 15 minutes
command: node scripts/cleanup.js
Command to execute
Health Checks
healthCheckPath: /health
Custom health check endpoint
autoDeploy: false
Disable auto-deploy on git push
preDeployCommand: npm run migrate
Run command before deploy
Scaling & Resources
numInstances: 2
Horizontal scaling (multiple instances)
plan: starter
0.5 GB RAM, 0.5 CPU
plan: standard
2 GB RAM, 1 CPU
plan: pro
4 GB RAM, 2 CPU
Domains & URLs
*.onrender.com
Free subdomain for each service
customDomains: - example.com - www.example.com
Custom domain configuration
TLS/SSL
Automatic HTTPS for all domains
Docker Support
env: docker
Use Dockerfile for builds
dockerfilePath: ./Dockerfile
Custom Dockerfile location
dockerContext: ./
Docker build context
registryCredential: name: docker-creds
Private registry credentials
Build & Deploy Settings
rootDir: ./backend
Service root directory (monorepo)
buildFilter: paths: - backend/**
Only build on specific file changes
autoDeploy: true
Auto-deploy on git push
pullRequestPreviewsEnabled: true
Create preview deploys for PRs
Private Services
- type: pserv
Private service (no public access)
${SERVICE_NAME}.onrender.com:port
Internal service discovery
$RENDER_INTERNAL_HOSTNAME
Auto-set internal hostname
Complete Example
services: - type: web name: api env: node buildCommand: npm install startCommand: npm start envVars: - key: DATABASE_URL fromDatabase: name: mydb property: connectionString databases: - name: mydb plan: starter
Full render.yaml example
Best Practices
preDeployCommand: npm run db:migrate
Always run migrations before deploy
healthCheckPath: /health
Implement health check endpoints
plan: starter
Start with paid DB for production
pullRequestPreviewsEnabled: false
Disable PR previews to save costs
render.yaml in repo
Use Infrastructure as Code with render.yaml
💡 Pro Tip:
Use render.yaml blueprints to define your entire infrastructure as code. Free databases expire after 90 days - upgrade to starter plan for production apps!