Deployment
Deploying a template to Vercel, a container, or any Node host — and the environment variables that matter.
UT Studio6 min read
Every template builds to a standard Next.js production output. Nothing depends on a platform-specific runtime, which is the point: the host is your decision, not one made for you by the template.
Environment variables
| Variable | Required | Purpose |
|---|---|---|
| NEXT_PUBLIC_APP_URL | Yes | Absolute origin of the deployment. Canonical URLs, OpenGraph and the sitemap are built from it. |
| DATABASE_URL | Only if the template uses one | Use a pooled endpoint in serverless environments. |
| LOG_LEVEL | No | debug | info | warn | error. Defaults to info in production. |
The origin is not optional
Deploying without setting the absolute origin ships canonical tags and social cards pointing at localhost. The site works; it is simply invisible to search and broken in every link preview.
Vercel
Zero-config. Connect the repository, set the environment variables above, deploy. If the template is inside a monorepo, set the root directory to the application package so the build command runs where the app is.
Docker
Templates that include a Dockerfile use a multi-stage build producing a standalone image with no build toolchain in the final layer.
docker build -t my-site .
docker run -p 3000:3000 --env-file .env my-siteStandalone output needs its static files copied
Next's standalone build emits a self-contained server that still expects `.next/static` and `public/` beside it. A Dockerfile can do that copy; `next start` cannot. This is the single most common containerisation failure.
Any Node host
pnpm install --prod=false
pnpm build
pnpm startBefore you call it live
- Absolute origin set, and canonical tags resolving to it.
- A real 404 page, reached by visiting a URL that does not exist.
- Sitemap and robots reachable, and the sitemap listing what you expect.
- A production build tested locally — `pnpm build && pnpm start` — not just the dev server.
- Lighthouse or equivalent run against the deployed origin rather than against localhost.
Templates mentioned here
Everything above is written against real products. These are the ones this page draws on.

