Detailed explanation of each service type available on Render.
Detailed explanation of each service type available on Render. Choose the right service type based on your application's needs.
type: web)Web services are HTTP servers that handle incoming requests from the internet. They're publicly accessible via HTTPS URLs.
https://[service-name].onrender.com0.0.0.0:$PORTtype: web
name: my-api
runtime: node
buildCommand: npm ci
startCommand: npm start
const PORT = process.env.PORT || 3000;
app.listen(PORT, '0.0.0.0');
app.get('/health', (req, res) => {
res.status(200).json({ status: 'ok' });
});
type: worker)Worker services run background tasks without handling HTTP requests. They're not publicly accessible.
type: worker
name: queue-processor
runtime: python
buildCommand: pip install -r requirements.txt
startCommand: celery -A tasks worker --loglevel=info
import redis
r = redis.from_url(os.environ['REDIS_URL'])
Node.js with BullMQ:
type: worker
name: job-processor
runtime: node
buildCommand: npm ci
startCommand: node worker.js
envVars:
- key: REDIS_URL
fromDatabase:
name: redis
property: connectionString
Python with Celery:
type: worker
name: celery-worker
runtime: python
buildCommand: pip install -r requirements.txt
startCommand: celery -A app.celery worker
envVars:
- key: REDIS_URL
fromDatabase:
name: redis
property: connectionString
type: cron)Cron jobs run scheduled tasks on a repeating schedule. They execute, complete, and shut down.
type: cron
name: daily-backup
runtime: node
schedule: "0 2 * * *" # Daily at 2 AM UTC
buildCommand: npm ci
startCommand: node scripts/backup.js
Standard cron syntax: minute hour day month weekday
Common schedules:
| Schedule | Description | |----------|-------------| | /5 | Every 5 minutes | | 0 | Every hour | | 0 0 | Daily at midnight UTC | | 0 9 1-5 | Weekdays at 9 AM UTC | | 0 0 1 | First day of each month | | 0 9 1 | Every Monday at 9 AM UTC |
Daily Database Backup:
type: cron
name: db-backup
runtime: python
schedule: "0 1 * * *" # 1 AM UTC daily
buildCommand: pip install -r requirements.txt
startCommand: python scripts/backup.py
envVars:
- key: DATABASE_URL
fromDatabase:
name: postgres
property: connectionString
- key: S3_BUCKET
value: my-backups
Hourly Cache Refresh:
type: cron
name: cache-refresh
runtime: node
schedule: "0 * * * *" # Top of every hour
buildCommand: npm ci
startCommand: node scripts/refresh-cache.js
type: web + runtime: static)Serve static HTML, CSS, and JavaScript files via CDN. No backend runtime.
type: web
name: frontend
runtime: static
buildCommand: npm ci && npm run build
staticPublishPath: ./dist # or ./build, ./out, ./public
Single Page Applications need rewrite rules to handle client-side routing:
type: web
name: react-app
runtime: static
buildCommand: npm ci && npm run build
staticPublishPath: ./build
routes:
- type: rewrite
source: /*
destination: /index.html
Add cache control and security headers:
type: web
name: static-site
runtime: static
buildCommand: npm ci && npm run build
staticPublishPath: ./dist
headers:
# Cache static assets
- path: /static/*
name: Cache-Control
value: public, max-age=31536000, immutable
# Security headers
- path: /*
name: X-Frame-Options
value: DENY
- path: /*
name: X-Content-Type-Options
value: nosniff
For monorepos, only build when frontend files change:
type: web
name: frontend
runtime: static
buildCommand: npm ci && npm run build
staticPublishPath: ./dist
buildFilter:
paths:
- frontend/**
ignoredPaths:
- frontend/**/*.test.js
- frontend/README.md
type: pserv)Internal services accessible only within your Render account. Not exposed to the internet.
0.0.0.0:$PORT[service-name].render-internal.comtype: pserv
name: internal-api
runtime: node
buildCommand: npm ci
startCommand: npm start
From other services in the same account:
// Use .render-internal.com domain
const API_URL = 'http://internal-api.render-internal.com:10000';
Or use service references:
services:
- type: web
name: frontend
runtime: node
envVars:
- key: INTERNAL_API_URL
fromService:
name: internal-api
type: pserv
property: hostport
.render-internal.com domains| Feature | Web | Worker | Cron | Static | Private | |---------|-----|--------|------|--------|---------| | Public URL | ✅ Yes | ❌ No | ❌ No | ✅ Yes | ❌ No | | Port Binding | ✅ Required | ❌ Not needed | ❌ Not needed | ❌ N/A | ✅ Required | | Health Checks | ✅ Yes | ❌ No | ❌ No | ❌ N/A | ✅ Yes | | Runtime | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | | Persistent | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | | Scaling | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | | Use Case | HTTP servers | Background jobs | Scheduled tasks | Static files | Internal services |
Use Web Service when:
Use Worker Service when:
Use Cron Job when:
Use Static Site when:
Use Private Service when: