← The stack
STACK GUIDE · ANY

Hosting and deploys

Pick one host for the team on day 1 and deploy before lunch. Every pull request gets its own preview link, so demos never wait for a merge.

Cloudflare Workers with OpenNext

  • Next.js runs on Cloudflare's network through the OpenNext adapter
  • Generous free tier, fast worldwide, D1, R2 and Queues next to the app
  • Pick it when you want the cheapest always on host and do not mind one adapter step

Vercel

  • Made by the team behind Next.js, the least setup of any option
  • Preview links for every pull request out of the box
  • The free plan is for non commercial use, which is fine for demos; check the plan terms before a business uses it

Netlify

  • Runs Next.js through its own adapter, preview deploys per pull request
  • Good free tier and simple forms and functions
  • Pick it if your team already knows it

Your own server with Docker

  • next build with standalone output runs as a plain Node server
  • One docker-compose.yml with the web app, workers and Postgres
  • Required for products that must stay inside the customer's building, such as clinics and banks

Workers and the database

  • Workers run on a Windows or Linux machine next to the browsers and desktops they drive, not on the web host
  • Postgres from Neon or Supabase (free tiers), or the Postgres in your docker-compose.yml
LEARN HOW IT WORKS

Four ideas to understand.

You direct the agent, so you need these in your head. Ask the agent to teach them with your own code.

  1. 1Build and deploy. What a build produces and what the host runs.
  2. 2Environment variables. How secrets reach the app without living in the code.
  3. 3Preview deployments. Why every pull request gets its own link.
  4. 4Edge versus server. Where your code runs and what that changes.
Explain how hosting and deploys works in our product, in plain words, for someone who will direct the code but not type it. Use our own repo as the example. Cover: build and deploy, environment variables, preview deployments, edge versus server. Then ask me three questions to check I understood.
ASK YOUR AGENT TO BUILD IT

A brief to start from.

Fill in the brackets with your product and paste it into your agent.

Deploy apps/web to our host ([Cloudflare with OpenNext / Vercel / Netlify / Docker]). Set up preview deployments for every pull request, keep secrets in the host's environment settings, connect the Postgres database, and add the deploy step to GitHub Actions. Also make docker-compose.yml run the same app as a Node server with the worker and Postgres. Show me each step before you run it.