How to Deploy a Website on Vercel (Next.js, React or HTML), Step by Step

Short answer

To deploy a website on Vercel, push your project to GitHub, go to vercel.com/new, import the repository, confirm the framework preset and click Deploy. Vercel builds it and gives you a .vercel.app URL; add your own domain under Settings, Domains. Every later push to the main branch redeploys automatically.

Vercel is the platform behind Next.js and one of the simplest ways to put a site online. We use it to host our own site and client builds, so this is the process as we actually run it, including the parts the quick-start pages skip.

Before you start

You need three things:

  • Your project working locally (npm run dev shows it in the browser).
  • A free GitHub account, with the project pushed to a repository.
  • A Vercel account (sign up with GitHub for the shortest route).

Check that a production build works on your machine first, because Vercel runs the same command:

npm install
npm run build

If this fails locally it will fail on Vercel. Fix it here, where the error is easier to read.

  1. Push your code to a GitHub repository.
  2. Go to vercel.com/new and choose Import next to your repository. Grant access if asked.
  3. Vercel detects the framework (Next.js, Vite, Create React App, Astro, plain HTML). Leave the preset as detected.
  4. Open Environment Variables and add any secrets your app needs, such as a database URL or an email key. Never commit these to the repository.
  5. Click Deploy. In a minute or two you get a URL like your-project.vercel.app.

From now on every push to your main branch deploys to production, and every other branch or pull request gets its own preview URL. That is the whole deployment pipeline.

Method 2: Deploy from the command line

Useful for projects that are not on GitHub:

npm install -g vercel
vercel login
vercel          # creates a preview deployment
vercel --prod   # deploys to production

The first run asks a few questions (project name, directory) and links the folder to a Vercel project.

Settings by project type

ProjectBuild commandOutput
Next.jsnext build (detected)Handled automatically
Vite or Reactnpm run builddist
Create React Appnpm run buildbuild
Plain HTML, CSS, JSnoneproject root

Add your own domain

  1. Open the project, then Settings → Domains, and enter your domain.
  2. Vercel shows the DNS records to add at your registrar. Use the exact values it displays for your project.
  3. Add the records at your registrar (GoDaddy, Hostinger, Namecheap and so on). Our domain connection guide walks through this.
  4. Wait for the check to turn green. HTTPS is issued automatically.

Pick one version as primary (usually the non-www or the www) and let Vercel redirect the other, so search engines see a single address.

Environment variables and secrets

Variables set in the dashboard are available at build time and runtime. Remember:

  • Anything prefixed NEXT_PUBLIC_ is exposed to the browser. Never put a secret there.
  • Add variables to the right environment (Production, Preview, Development).
  • After changing a variable, redeploy, because running builds keep the old value.

Common deployment errors and fixes

  • "Module not found" only on Vercel. Vercel runs on Linux, where file names are case sensitive. import Header from './header' works on Windows if the file is Header.jsx, and fails on Vercel. Match the case exactly.
  • Build passes locally, fails online. Usually a missing environment variable or a different Node.js version. Set the Node version under Settings, or in package.json under engines.
  • 404 on refresh in a React single-page app. Add a vercel.json rewrite sending all routes to index.html.
  • API route times out. Serverless functions have time limits on each plan. Move long tasks to a queue or background job.
  • Images do not load. Check paths are relative to public/, and that remote image domains are allowed in your Next.js config.
  • Site works but changes do not appear. You may be looking at a preview deployment, or a cached page. Check the Deployments tab for the Production badge.

Important: free plan limits for businesses

Vercel's free Hobby plan is meant for personal, non-commercial use. If the website is for a business, read the current terms and plan to use a paid plan, or choose a host whose free tier allows commercial sites, such as Cloudflare Pages. Check the latest terms before you decide, because plans change.

Should you deploy it yourself?

If you are comfortable with GitHub and a terminal, the steps above take under an hour. If the site is a business asset and you would rather not manage DNS, SSL, environment variables and deploys, we set up the whole pipeline, with the accounts in your name, as part of every web development project.

FAQ

Frequently asked questions

Is Vercel free?

Vercel has a free Hobby plan for personal, non-commercial projects, and paid plans for teams and commercial use. Limits and prices change, so check the current pricing page before relying on it for a business site.

How do I deploy a Next.js app on Vercel?

Push it to GitHub, import the repository at vercel.com/new and click Deploy. Vercel detects Next.js and uses next build.

How do I deploy a static HTML website on Vercel?

Import the folder as a project with the framework preset set to Other and no build command. Vercel serves the files as they are.

Can I deploy to Vercel without GitHub?

Yes. Use the Vercel command line: install it, run vercel login, then vercel --prod in the project folder.

How do I connect my own domain to Vercel?

Add it under Settings, Domains, then create the DNS records Vercel shows at your registrar. HTTPS is enabled automatically once the records are detected.

Why does my Vercel build fail?

The most common causes are a missing environment variable, an import whose letter case does not match the file name, and a Node.js version mismatch. Read the build log from the top; the first error is the real one.

Can you deploy my website for me?

Yes. We set up repositories, Vercel, domain, DNS and business email, and hand over the accounts. Message us on WhatsApp.

Want this done properly for your business? Tell us what you need.