Skip to content
UT Studio

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

VariableRequiredPurpose
NEXT_PUBLIC_APP_URLYesAbsolute origin of the deployment. Canonical URLs, OpenGraph and the sitemap are built from it.
DATABASE_URLOnly if the template uses oneUse a pooled endpoint in serverless environments.
LOG_LEVELNodebug | 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.

Terminal
docker build -t my-site .
docker run -p 3000:3000 --env-file .env my-site

Standalone 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

Terminal
pnpm install --prod=false
pnpm build
pnpm start

Before you call it live

  1. Absolute origin set, and canonical tags resolving to it.
  2. A real 404 page, reached by visiting a URL that does not exist.
  3. Sitemap and robots reachable, and the sitemap listing what you expect.
  4. A production build tested locally — `pnpm build && pnpm start` — not just the dev server.
  5. 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.

Read next