Blitz is pivoting to framework agnostic toolkit. Click to learn more.
🚀Announcing Flightcontrol - Easily Deploy Blitz.js and Next.js to AWS 🚀
Back to Documentation Menu

Deploy to a Server on Render.com

  1. Add one of the render.yaml files shown below or use the render recipe
  2. Push code to your GitHub repo
  3. Log in to Render.com
  4. Click on the New + button and then the Blueprint menu item
  5. Connect your GitHub account then select your blitz app repo
  6. Follow the directions on the screen and click apply
  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: free
    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: free
    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: free

Idea for improving this page? Edit it on GitHub.