blueprint-spec

Complete reference for render.yaml Blueprint files.

Render Blueprint Specification

Complete reference for render.yaml Blueprint files. Blueprints define your infrastructure as code for reproducible deployments on Render.

Overview

A Blueprint is a YAML file (typically render.yaml) placed in your repository root that describes:

Root-Level Structure

# Top-level fields
services: []         # Array of service definitions
databases: []        # Array of PostgreSQL databases
envVarGroups: []     # Reusable environment variable groups (optional)
projects: []         # Project organization (optional)
ungrouped: []        # Resources outside projects (optional)
previews:            # Preview environment configuration (optional)
  generation: auto_preview | manual | none

Service Types

Web Services (type: web)

HTTP services, APIs, and web applications. Publicly accessible via HTTPS.

Required fields:

Common optional fields:

Example:

services:
  - type: web
    name: api-server
    runtime: node
    plan: free
    buildCommand: npm ci
    startCommand: npm start
    branch: main
    autoDeploy: true
    envVars:
      - key: NODE_ENV
        value: production
      - key: PORT
        value: 10000

Worker Services (type: worker)

Background job processors, queue consumers. Not publicly accessible.

Required fields:

Key differences from web services:

Example:

services:
  - type: worker
    name: job-processor
    runtime: python
    plan: free
    buildCommand: pip install -r requirements.txt
    startCommand: celery -A tasks worker --loglevel=info
    envVars:
      - key: REDIS_URL
        fromDatabase:
          name: redis
          property: connectionString

Cron Jobs (type: cron)

Scheduled tasks that run on a cron schedule.

Required fields:

Schedule format: Standard cron syntax (minute hour day month weekday)

Examples:

Example:

services:
  - type: cron
    name: daily-backup
    runtime: node
    schedule: "0 2 * * *"
    buildCommand: npm ci
    startCommand: node scripts/backup.js
    envVars:
      - key: DATABASE_URL
        fromDatabase:
          name: postgres
          property: connectionString

Static Sites (type: static or type: web with runtime: static)

Serve static HTML/CSS/JS files via CDN.

Required fields:

Optional configuration:

Example:

services:
  - type: web
    name: react-app
    runtime: static
    buildCommand: npm ci && npm run build
    staticPublishPath: ./dist
    routes:
      - type: rewrite
        source: /*
        destination: /index.html
    headers:
      - path: /*
        name: Cache-Control
        value: public, max-age=31536000, immutable

Private Services (type: pserv)

Internal services accessible only within your Render account.

Required fields:

Use cases:

Example:

services:
  - type: pserv
    name: internal-api
    runtime: go
    plan: free
    buildCommand: go build -o bin/app
    startCommand: ./bin/app

Runtimes

Native Runtimes

Node.js (runtime: node):

Python (runtime: python):

Go (runtime: go):

Ruby (runtime: ruby):

Rust (runtime: rust):

Elixir (runtime: elixir):

Docker Runtime

Docker (runtime: docker): Build from a Dockerfile in your repository.

Additional fields:

Example:

services:
  - type: web
    name: docker-app
    runtime: docker
    dockerfilePath: ./docker/Dockerfile
    dockerContext: .
    plan: free

Image (runtime: image): Deploy pre-built Docker images from a registry.

Additional fields:

Example:

services:
  - type: web
    name: prebuilt-app
    runtime: image
    image: myregistry.com/app:v1.2.3
    plan: free

Service Plans

Available instance types:

| Plan | RAM | CPU | Price | |------|-----|-----|-------| | free | 512 MB | 0.5 | Free (750 hrs/mo) | | starter | 512 MB | 0.5 | $7/month | | standard | 2 GB | 1 | $25/month | | pro | 4 GB | 2 | $85/month | | pro_plus | 8 GB | 4 | $175/month |

Always default to plan: free unless user specifies otherwise.

Regions

Available deployment regions:

Example:

services:
  - type: web
    name: my-app
    runtime: node
    region: frankfurt

Environment Variables

Three patterns for defining environment variables:

1. Hardcoded Values

For non-sensitive configuration:

envVars:
  - key: NODE_ENV
    value: production
  - key: API_URL
    value: https://api.example.com
  - key: LOG_LEVEL
    value: info

2. Generated Secrets

Render generates a base64-encoded 256-bit random value:

envVars:
  - key: SESSION_SECRET
    generateValue: true
  - key: ENCRYPTION_KEY
    generateValue: true

3. User-Provided Secrets

Prompt user for values during Blueprint creation:

envVars:
  - key: STRIPE_SECRET_KEY
    sync: false
  - key: JWT_SECRET
    sync: false
  - key: API_KEY
    sync: false

The sync: false flag means "user will fill this in the Dashboard".

4. Database References

Link to database connection strings:

envVars:
  - key: DATABASE_URL
    fromDatabase:
      name: postgres
      property: connectionString
  - key: REDIS_URL
    fromDatabase:
      name: redis
      property: connectionString

Available properties:

5. Service References

Link to other services:

envVars:
  - key: API_URL
    fromService:
      name: api-server
      type: web
      property: host

6. Environment Variable Groups

Reusable groups shared across services:

envVarGroups:
  - name: shared-config
    envVars:
      - key: LOG_LEVEL
        value: info
      - key: ENVIRONMENT
        value: production

services:
  - type: web
    name: web-app
    runtime: node
    envVars:
      - fromGroup: shared-config
      - key: PORT
        value: 10000

Databases

PostgreSQL

databases:
  - name: postgres
    databaseName: myapp_prod
    user: myapp_user
    plan: free
    postgresMajorVersion: "15"
    ipAllowList: []

Plans:

Key fields:

High Availability (paid plans):

databases:
  - name: postgres
    databaseName: myapp_prod
    plan: pro-4gb
    highAvailabilityEnabled: true

Read Replicas (paid plans):

databases:
  - name: postgres
    databaseName: myapp_prod
    plan: pro-4gb
    readReplicas:
      - name: read-replica-1
        region: ohio
      - name: read-replica-2
        region: frankfurt

Redis (Key-Value Store)

databases:
  - name: redis
    plan: free
    maxmemoryPolicy: allkeys-lru
    ipAllowList: []

Plans: Same as PostgreSQL

maxmemoryPolicy options:

Scaling

Manual Scaling

Fixed number of instances:

services:
  - type: web
    name: my-app
    runtime: node
    plan: standard
    numInstances: 3

Autoscaling

Dynamic scaling based on CPU/memory (Professional workspace required):

services:
  - type: web
    name: my-app
    runtime: node
    plan: standard
    scaling:
      minInstances: 1
      maxInstances: 5
      targetCPUPercent: 60
      targetMemoryPercent: 70

Notes:

Health Checks

Configure health check endpoints:

services:
  - type: web
    name: my-app
    runtime: node
    healthCheckPath: /health

Default: / (root path)

Recommended: Add a dedicated /health endpoint that returns 200 OK.

Build Filters

Control when builds are triggered based on changed files:

services:
  - type: web
    name: frontend
    runtime: static
    buildFilter:
      paths:
        - frontend/**
      ignoredPaths:
        - frontend/README.md
        - frontend/**/*.test.js

Behavior:

Projects and Environments

Organize services into projects with multiple environments:

projects:
  - name: my-application
    environments:
      - name: production
        services:
          - type: web
            name: prod-api
            runtime: node
            plan: pro
            buildCommand: npm ci
            startCommand: npm start
        databases:
          - name: prod-postgres
            plan: pro-4gb
        networking:
          isolation: enabled
        permissions:
          protection: enabled

      - name: staging
        services:
          - type: web
            name: staging-api
            runtime: node
            plan: starter
            buildCommand: npm ci
            startCommand: npm start
        databases:
          - name: staging-postgres
            plan: free

Environment features:

Preview Environments

Configure automatic preview environments for pull requests:

previews:
  generation: auto_preview  # auto_preview | manual | none

Options:

Complete Example

Full-featured Blueprint with multiple services and databases:

services:
  # Web service
  - type: web
    name: web-app
    runtime: node
    plan: free
    region: oregon
    buildCommand: npm ci && npm run build
    startCommand: npm start
    branch: main
    autoDeploy: true
    healthCheckPath: /health
    envVars:
      - key: NODE_ENV
        value: production
      - key: DATABASE_URL
        fromDatabase:
          name: postgres
          property: connectionString
      - key: REDIS_URL
        fromDatabase:
          name: redis
          property: connectionString
      - key: JWT_SECRET
        sync: false

  # Background worker
  - type: worker
    name: queue-worker
    runtime: node
    plan: free
    buildCommand: npm ci
    startCommand: node worker.js
    envVars:
      - key: REDIS_URL
        fromDatabase:
          name: redis
          property: connectionString

  # Cron job
  - type: cron
    name: daily-cleanup
    runtime: node
    schedule: "0 3 * * *"
    buildCommand: npm ci
    startCommand: node scripts/cleanup.js
    envVars:
      - key: DATABASE_URL
        fromDatabase:
          name: postgres
          property: connectionString

  # Static frontend
  - type: web
    name: frontend
    runtime: static
    buildCommand: npm ci && npm run build
    staticPublishPath: ./dist
    routes:
      - type: rewrite
        source: /*
        destination: /index.html

databases:
  - name: postgres
    databaseName: app_production
    user: app_user
    plan: free
    postgresMajorVersion: "15"
    ipAllowList: []

  - name: redis
    plan: free
    maxmemoryPolicy: allkeys-lru
    ipAllowList: []

Validation

Validate your Blueprint before deploying (when CLI command is available):

render blueprint validate

Common validation errors:

Best Practices

  1. Always use plan: free by default - Let users upgrade if needed
  2. Mark all secrets with sync: false - Never hardcode sensitive values
  3. Use fromDatabase for database URLs - Automatic internal connection strings
  4. Add health check endpoints - Faster deployment detection
  5. Use non-interactive build commands - Prevents build hangs
  6. Bind to 0.0.0.0:$PORT - Required for web services
  7. Use environment variable groups - Share config across services
  8. Enable autoDeploy: true - Deploy automatically on push
  9. Set appropriate regions - Choose closest to your users
  10. Use build filters - Optimize build triggers in monorepos

Additional Resources