🚀Announcing Flightcontrol - Optimized Deployment for Fullstack Blitz.js and Next.js 🚀
Back to Documentation Menu

Deploy to a Server on Render.com

  1. Add one of the render.yaml files shown below
  2. Push code to your GitHub repo
  3. Log in to Render.com
  4. Click on the "YAML" menu item, then click the "New from YAML" button
  5. Connect your GitHub account then select your blitz app repo
  6. Click approve
  7. Your server + database will be automatically configured and started. Each git push will trigger a new deploy

Without database:

Use this render.yaml:

services:
  - type: web
    name: blitzapp
    env: node
    plan: starter
    buildCommand: yarn --frozen-lockfile --prod=false && blitz build
    startCommand: blitz start
    envVars:
      - key: NODE_ENV
        value: production
      - key: SESSION_SECRET_KEY
        generateValue: true

With Postgres database:

Update your render.yaml to provide the DATABASE_URL environment variable to connect to your database:

services:
  - type: web
    name: blitzapp
    env: node
    plan: starter
    buildCommand:
      yarn --frozen-lockfile --prod=false &&
      blitz prisma generate &&
      blitz build &&
      blitz prisma migrate deploy
    startCommand: blitz start
    envVars:
      - key: NODE_ENV
        value: production
      - key: DATABASE_URL
        fromDatabase:
          name: blitzapp-db
          property: connectionString
      - key: SESSION_SECRET_KEY
        generateValue: true

databases:
  - name: blitzapp-db
    plan: starter

Idea for improving this page? Edit it on GitHub.