# Render (/docs/starter/deploy/render)

`render.yaml` is a [Render](https://render.com) Blueprint: the web service, its health check, its migrations, and the variables it needs.

A project with a [frontend and its API](../../cli/frontend-and-api.mdx) can't use this option yet: it deploys on [any container host](./container-host.mdx#a-frontend-and-its-api) or [Railway](./railway.mdx#a-frontend-and-its-api). Nor can a project [without a website](../../cli/without-a-website.mdx), whose API deploys on [any container host](./container-host.mdx#without-a-website) or [Railway](./railway.mdx#without-a-website): the CLI refuses this option for it.

<Callout>
  [`pnpm clubedge deploy`](../../cli/deploy/render.mdx) creates the same service through Render's API, sets the variables, and waits until it is live.
</Callout>

## What render.yaml sets [#what-renderyaml-sets]

- **Runtime:** Docker, from the root `Dockerfile`.
- **Pre-deploy command:** `node /app/migrate.mjs` runs before each deploy goes live, and a failed migration stops the deploy.
- **Health check:** `/api/health`.
- **Variables:** `DATABASE_URL`, the app URL, and the keys your modules need, marked `sync: false` so Render asks for each value. With Better Auth, Render generates `BETTER_AUTH_SECRET`. Optional variables aren't listed, such as `DATABASE_URL_DIRECT`, `STORAGE_PUBLIC_URL`, `SENTRY_ENVIRONMENT`, `OTEL_SERVICE_NAME`, and a `STRIPE_PRICE_<PLAN>` for each plan other than `pro`: add the ones you use to `render.yaml` or the service's settings.
- **Client address:** `CLIENT_IP_HEADER=cf-connecting-ip`: Cloudflare, in front of every Render service, puts each [client's address](../before-deploying.mdx#client-addresses) in `CF-Connecting-IP` and refuses requests that send their own (Starter v0.27.0 or newer).

## Deploy by hand [#deploy-by-hand]

Push the project to GitHub, GitLab, or Bitbucket. In Render's dashboard, choose New, then Blueprint, and select the repository. Render reads `render.yaml`, asks for each `sync: false` variable, and deploys. Set `NEXT_PUBLIC_APP_URL` to the service's `*.onrender.com` URL: Render passes the service's variables to the Docker build.

<Callout type="warn">
  Pre-deploy commands need a paid instance type. On the free type, remove `preDeployCommand` from `render.yaml` and apply migrations yourself before deploying, from your machine or CI, with `DATABASE_URL` set to the production database: `pnpm db:migrate`, or the [migrator](../docker.mdx#the-migrator) in the image.
</Callout>

Render Postgres works as the database: create it in the dashboard and use its internal URL as `DATABASE_URL`.

## Background jobs [#background-jobs]

Render runs the app as a long-lived server, so the [jobs](../modules/jobs.mdx) worker runs with it. Free instances sleep when idle, which stops the worker too.

## The deploy workflow [#the-deploy-workflow]

The Deploy job calls the service's deploy hook, which starts a deploy of its branch with its pre-deploy migrations. It needs the secret `RENDER_DEPLOY_HOOK_URL`, the deploy hook from the service's settings. Render also deploys on each push to the branch unless you turn that off.
