Skip to content
Chapter 6 / 9

Deploying with Vercel

From localhost to a public URL. Vercel CLI, preview deployments, production, environment variables, custom domain.

Two ways to deploy

Vercel deployment interface

Vercel via GitHub (recommended): you connect your GitHub repo to Vercel. Every git push triggers an automatic redeployment.

Vercel CLI: you deploy from the terminal with a command. More direct, less automated.

Worth noting: all the code commands below can be replaced by asking Claude in the conversation. For example: "Now deploy to production on Vercel." It processes the request and deploys on its own to your Vercel production URL.

Vercel CLI: installation and first deployment

npm install -g vercel
vercel login

From your project folder:

vercel

Vercel asks a few questions on the first deployment. At the end, it returns a preview URL: a unique public URL for that version.

Deploy to production

vercel --prod

Deploys the current version to production and returns the definitive public URL.

Typical workflow

  1. You work locally with Claude Code
  2. You check the result in the browser (localhost)
  3. vercel: preview URL, you share it for feedback
  4. You incorporate the feedback
  5. vercel --prod: production URL updated

Environment variables

# Add a variable
vercel env add VARIABLE_NAME

# List variables for a project
vercel env ls

# Remove a variable
vercel env rm VARIABLE_NAME

Variables are stored on Vercel's side and injected automatically at each deployment. Your .env.local file stays on your computer, never in the GitHub repo.

Custom domain

vercel domains add my-domain.com

Vercel then tells you which DNS records to configure. Propagation takes anywhere from a few minutes to 48 hours. Vercel automatically generates the SSL certificate.

Vercel via GitHub: automatic connection

  1. Go to vercel.com and connect your GitHub account.
  2. Import your repository.
  3. Vercel configures the project automatically.
  4. Every git push origin main triggers an automatic redeployment.

You no longer need to type vercel --prod manually. Every change pushed to the main branch is in production within seconds.

Victor Soussan

Lead Product Designer

I help design teams integrate Claude Code into their workflows: workshops, pair sessions, project setup.