Documentation

Configuration Examples

ready

Ready-to-copy nextdeploy.yml templates for Cloudflare Workers (Next.js 16 Turbopack + Edge Guard + D1/KV/R2), Linux VPS with Go Sidecar, and AWS Serverless.

Source reference: sample.nextdeploy.yml, docs/guide/configuration.md


1. Cloudflare Workers (Next.js 16 Turbopack + D1 + KV + Edge Auth)

version: "1.0"
target_type: serverless

app:
  name: nextdeploy-frontend
  environment: production
  domain: nextdeploy.org

serverless:
  provider: cloudflare
  cloudflare:
    engine: auto
    compatibility_date: "2026-05-01"
    compatibility_flags:
      - nodejs_compat
    placement:
      mode: smart
    resources:
      d1:
        - name: app_prod_db
          binding: DB
          protect: true
      kv:
        - name: rate_limit_kv
          binding: RATE_LIMIT
        - name: cache_tags_kv
          binding: NEXTCOMPILE_CACHE
    protection:
      enabled: true
      public_paths:
        - /
        - /docs/*
        - /login
        - /api/health
      rate_limit:
        kv_binding: RATE_LIMIT
        requests_per_minute: 120
      auth:
        secret_env: AUTH_SECRET
        cookie_name: nd_session
        protected_paths:
          - /app/*
        login_path: /login

2. Linux VPS with Go Sidecar & cgroup v2 Sandboxing

version: "1.0"
target_type: vps

app:
  name: my-store
  environment: production
  domain: store.example.com
  port: 3000
  gosidecar:
    enabled: true
    image_optimization: true
    isr_cache: true
    max_image_workers: 4

  resources:
    memory_max: 1024M
    cpu_quota: 150%

servers:
  - name: primary
    host: 203.0.113.10
    username: ubuntu
    key_path: ~/.ssh/id_ed25519
    port: 22

3. AWS Serverless (Lambda + S3 + CloudFront)

version: "1.0"
target_type: serverless

app:
  name: cloud-store
  environment: production
  domain: store.example.com

serverless:
  provider: aws
  region: us-east-1
  memory_size: 1024
  timeout: 30
  cloudfront_id: ${CLOUDFRONT_DISTRIBUTION_ID}
  isr_revalidation: true
  image_optimization: true
  warmer: true

Related