🚀 The Complete Step-by-Step Guide

Deploy Your Website
to Vercel

From local code to a live site with custom domain and free SSL — in about 10 minutes. Everything you need, nothing you don't.

⏱️ Setup: ~10 min
💰 Cost: $0 / free tier
🔄 Auto-deploy: every git push
🔒 SSL: automatic
🗺

The Big Picture — How It All Fits Together

Here's the full deployment flow at a glance. Your code lives on GitHub, Vercel watches for changes, builds your site automatically, and serves it worldwide via a global CDN. You just point your domain and you're done.

📌 End-to-End Deployment Mind Map

🚀 Deploy Website Your Live Site 🐙 GitHub Source Code Create Repo git init Push Code git push main branch production 🌐 Custom Domain yourdomain.com DNS Settings A / CNAME SSL / HTTPS Auto by Vercel Propagation ~minutes-48h ▲ Vercel Hosting Platform Import GitHub Repo Connect Auto Deploy on git push Preview URLs per branch
← swipe to see full diagram →
⚡ Instant builds

Vercel's edge network builds and deploys in ~30 seconds for most projects. No waiting, no configuration.

🌍 Global CDN

Your site is served from data centers around the world, so users load it fast no matter where they are.

🔒 Free SSL forever

HTTPS certificates are issued and renewed automatically. No Let's Encrypt scripts, no nginx configs.

🔍 Preview per branch

Every pull request gets its own preview URL so you can test changes before merging to production.

Before You Start — Prerequisites

Make sure you have these set up first. Most take less than 2 minutes each.

💻

A Computer

macOS, Windows, or Linux. You'll use the terminal (Terminal on Mac, PowerShell or CMD on Windows).

📦

Git Installed

Download from git-scm.com. Verify with git --version.

🟢

Node.js (optional)

Only if using React, Next.js, Vite, etc. Get LTS from nodejs.org. Check with node -v.

📁

Your Project Files

Plain HTML/CSS/JS, or a framework project. At minimum an index.html in your project root.

💡

First time with Git? After installing, run git config --global user.name "Your Name" and git config --global user.email "you@example.com" once so Git knows who's making commits.

1

Set Up Your GitHub Repository

GitHub is where your code lives. Vercel reads from it and redeploys every time you push changes.

1

Create a GitHub Account & New Repository

Go to github.com → Sign up (free) → Click "New Repository" (green button, top right) → Name it (e.g. my-website) → Set to Public (free tier) or Private → Leave README/gitignore unchecked for now → Create repository.

💡

Naming tip: Use lowercase letters, numbers, and hyphens only. Avoid spaces and special characters (e.g. portfolio-v2, not My Portfolio!).

2

Initialize Git & Push Your Code

Open your terminal, navigate to your project folder, and run these commands one by one:

Terminal — First-time Setup
# Navigate to your project folder
cd /path/to/your-project

# Initialize Git in this folder
git init

# Stage all files for commit
git add .

# Save a snapshot with a message
git commit -m "Initial commit"

# Link to your GitHub repo (replace YOU/REPO)
git remote add origin https://github.com/YOU/REPO.git

# Rename default branch to 'main'
git branch -M main

# Push code to GitHub
git push -u origin main
⚠️

First push asking for a password? GitHub requires a Personal Access Token (PAT) instead of your password. Go to GitHub → Settings → Developer settings → Personal access tokens → Generate new. Use the token as your password when prompted, or install GitHub CLI (gh auth login) for an easier flow.

3

Add a .gitignore (recommended)

Create a file named .gitignore in your project root to prevent uploading junk like node_modules and secrets:

.gitignore
# Dependencies
node_modules/
.pnp
.pnp.js

# Build output
dist/
build/
.next/
out/

# Environment variables (NEVER commit these)
.env
.env.local
.env.*.local

# Editor / OS
.DS_Store
Thumbs.db
.vscode/
.idea/

# Logs
*.log
npm-debug.log*
4

Verify on GitHub

Open github.com/YOUR_USERNAME/YOUR_REPO in your browser — you should see all your files listed there. ✅

📊 The Git Push Pipeline

💻
Local Files
📦
git add .
📝
git commit
🐙
GitHub Repo
Vercel Auto-Deploy
← swipe to see full pipeline →
2

Connect GitHub to Vercel

Four clicks and your site is live. Vercel handles the build, CDN, SSL, and scaling for you.

🔗

1. Sign Up

Go to vercel.com → "Sign Up" → "Continue with GitHub" → Authorize Vercel to access your repos.

📂

2. Import Project

Click "Add New → Project" → Find your GitHub repo in the list → Click "Import".

⚙️

3. Configure

Vercel auto-detects your framework. For plain HTML, leave defaults. Add env vars if needed → Click "Deploy".

🎉

4. Go Live!

In ~30 seconds your site is live at yourproject.vercel.app. Every future push auto-redeploys!

💡

Pro tip: Every git push triggers Vercel to rebuild and redeploy automatically — no manual steps needed! Pushes to other branches create preview URLs, and pushes to main update production.

▲ Vercel Deployment Architecture

👨‍💻 You git push origin main 🐙 GitHub Webhook triggered ▲ Vercel Build & Optimize CDN • SSL • Edge ~30 seconds 🌐 Live Site yoursite.com Worldwide CDN push trigger deploy Every git push triggers this entire pipeline automatically
← swipe to see full architecture →

Framework-Specific Settings

Vercel auto-detects most popular frameworks. Here are the default build settings it uses — and how to override them if your setup is custom. Click a tab below.

SettingValue
Framework PresetOther
Build Command(none)
Output Directory./ (root)
Install Command(none)

Just ship index.html and assets. No build step needed. Vercel serves files directly from your repo root.

SettingValue
Framework PresetNext.js
Build Commandnext build
Output Directory.next
Install Commandnpm install

Vercel built Next.js — zero config. Server components, API routes, ISR, image optimization, and middleware all work automatically.

SettingValue
Framework PresetCreate React App
Build Commandnpm run build
Output Directorybuild
Install Commandnpm install
ℹ️

Heads up: Create React App is no longer actively maintained. For new projects, consider Vite or Next.js instead.

SettingValue
Framework PresetVite
Build Commandnpm run build
Output Directorydist
Install Commandnpm install

Works with React, Vue, Svelte, Solid, and more. Vercel auto-detects Vite from your package.json.

SettingValue
Framework PresetAstro
Build Commandnpm run build
Output Directorydist
Install Commandnpm install

For server-side rendering, install the Vercel adapter: npm install @astrojs/vercel, then add it to astro.config.mjs.

⚙️

Custom config? You can create a vercel.json file in your repo root to override anything — build commands, redirects, headers, rewrites, and more.

3

Connect Your Own Domain

Got a custom domain? Here's how to point it to your Vercel site. Works with any registrar — GoDaddy, Namecheap, Google Domains, Cloudflare, etc.

A

Add Your Domain in Vercel

Go to your project dashboard → Settings → Domains → Enter your domain (e.g. yourdomain.com) → Click Add. Vercel will show you the DNS records you need to add at your registrar.

B

Update DNS Records at Your Registrar

Log in to your registrar (GoDaddy, Namecheap, Cloudflare, etc.) → Find DNS Settings (sometimes called "Manage DNS" or "Zone File") → Add these two records:

TypeName / HostValue / Points ToUse Case
A@76.76.21.21Root (yourdomain.com)
CNAMEwwwcname.vercel-dns.comwww subdomain
⚠️

Naming varies by registrar: Some call Name "Host" and Value "Points To" or "Target". Always use the exact values shown on your Vercel dashboard — they occasionally differ based on your setup.

C

Wait for DNS Propagation

DNS changes take anywhere from a few minutes to 48 hours to propagate worldwide. Vercel automatically issues a free SSL certificate once it detects the records.

Check propagation status at dnschecker.org — type your domain to see if DNS resolves correctly from multiple locations around the world.

🌐 Domain Connection Mind Map

🌐 Your Domain yourdomain.com 🏪 Registrar GoDaddy / Namecheap Add A Record @ → 76.76.21.21 Add CNAME www → vercel-dns ▲ Vercel Project → Domains Add Domain Settings → Domains Auto SSL Cert Free HTTPS ✅ Site Goes Live! https://yourdomain.com
← swipe to see full diagram →
🌩️

Using Cloudflare? Set the DNS record to "DNS only" (grey cloud), not "Proxied" (orange cloud). Vercel handles the CDN — a double proxy causes SSL errors.

🔐

Environment Variables & Secrets

API keys, database URLs, and any secret values should never be committed to GitHub. Use environment variables instead.

1

Local Development

Create a .env.local file in your project root (and make sure it's in .gitignore):

.env.local
# API keys (keep server-side, never expose)
DATABASE_URL="postgres://user:pass@host/db"
STRIPE_SECRET_KEY="sk_live_..."

# For Next.js: NEXT_PUBLIC_ prefix = exposed to browser
NEXT_PUBLIC_API_URL="https://api.example.com"

# For Vite: VITE_ prefix = exposed to browser
VITE_SUPABASE_URL="https://xyz.supabase.co"
2

Add to Vercel

In your project dashboard → Settings → Environment Variables → Enter key and value → Choose which environments to apply to:

EnvironmentWhen it applies
ProductionDeploys from main branch
PreviewDeploys from PRs and other branches
DevelopmentLocal dev via vercel dev
3

Redeploy to Apply

Environment variables only take effect on new deployments. After adding them, trigger a new deploy via the Vercel dashboard (Deployments → Redeploy) or push a new commit.

🚫

Never commit secrets to Git. If you accidentally push an API key, rotate it immediately at the provider's dashboard — the key is forever public once it's in Git history, even if you delete the file later.

4

Update Your Site (Ongoing)

After initial setup, updating is just three commands. No SSH, no FTP, no file managers.

Terminal — Update & Deploy
# After making changes to your files:

# 1. Stage all changes
git add .

# 2. Commit with a descriptive message
git commit -m "Update: describe your changes"

# 3. Push → Vercel auto-deploys!
git push

# Live site updates in ~30 seconds ✅
🔀 Preview deployments

Create a branch, push it, open a PR — Vercel gives you a unique preview URL so you can test before merging.

⏪ Instant rollback

Bad deploy? Go to Deployments → find the previous working one → click "Promote to Production". Zero downtime.

📊 Analytics built-in

Enable Web Analytics in the dashboard to see real-time visitor counts, page views, and Core Web Vitals.

📡 Deployment logs

Check build and runtime logs in the Vercel dashboard to debug errors or monitor what's happening.

✅ Full Deployment Checklist

  • GitHub account created + new repo made
  • Code pushed to GitHub (git init → add → commit → push)
  • .gitignore set up (no secrets or node_modules)
  • Vercel account created via "Continue with GitHub"
  • GitHub repo imported in Vercel → first deploy successful
  • Environment variables added (if using any)
  • Domain added in Vercel (Settings → Domains)
  • A Record added at registrar: @ → 76.76.21.21
  • CNAME added: www → cname.vercel-dns.com
  • DNS propagated (wait up to 48 hours)
  • Vercel auto-issued free SSL (HTTPS) certificate
  • Site live at yourdomain.com 🎉
🛠

Troubleshooting Common Errors

Hit a wall? These are the most common deployment issues and how to fix them fast.

❌ Build failed: "Command failed with exit code 1"

Open the build log in Vercel (Deployments → click the failed one → view logs). Scroll to the red error text. Most common causes:

  • Missing dependency — run npm install <pkg> locally, commit the updated package.json, push.
  • TypeScript errors — fix them locally or temporarily set ignoreBuildErrors: true in your config.
  • Wrong Node version — set it explicitly in Project Settings → General → Node.js Version.
❌ 404 Not Found on page refresh (SPA routing)

Single-page apps (React Router, Vue Router) need a rewrite rule so all routes fall back to index.html. Add a vercel.json in your repo root:

vercel.json
{
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ]
}
❌ Domain stuck on "Invalid Configuration"

DNS records haven't propagated yet or are pointing wrong. Quick checks:

  • Go to dnschecker.org and verify your A record resolves to 76.76.21.21.
  • Remove any conflicting AAAA (IPv6) records at your registrar.
  • On Cloudflare, set the DNS record to "DNS only" (grey cloud), not "Proxied".
  • Wait 1-48 hours. In the Vercel dashboard, click Refresh on the domain row periodically.
❌ Environment variables not working

Three things to check:

  • Redeploy after adding them — existing deployments won't pick up new vars.
  • Correct prefix for client-side use — Next.js needs NEXT_PUBLIC_, Vite needs VITE_, CRA needs REACT_APP_.
  • Right environment — a var only set for "Production" won't appear in Preview builds.
❌ "Module not found" error on deploy but works locally

Usually a case-sensitivity mismatch. macOS and Windows filesystems aren't case-sensitive by default, but Vercel's Linux build servers are. Check that your import paths match file names exactly:

  • import Button from './Button' won't find ./button.jsx.
  • Also check that the module is in dependencies (not just devDependencies) if it's needed at runtime.
❌ Site deploys but shows blank page

Open your live site, then open browser DevTools → Console. Look for red errors:

  • Asset paths with leading slash — relative paths like src="./img.png" usually work better than src="/img.png" unless you're sure about your base URL.
  • Wrong output directory — verify the built index.html is actually in the directory you specified.
  • Missing base path — Vite / CRA / Next projects sometimes need a base setting if not deploying to the domain root.

Frequently Asked Questions

Is Vercel really free?

Yes, for personal projects and hobby use. The Hobby plan includes generous limits on bandwidth, build minutes, and deployments. You only need a paid plan (Pro) if you want commercial use, team features, priority support, or have high traffic. Check current limits at vercel.com/pricing.

What's the difference between Vercel and Netlify?

Both are excellent. Vercel is built by the Next.js team and is the best choice for Next.js projects (zero config, first-class support). Netlify is more framework-agnostic and has slightly different serverless function pricing. For most static sites, either works great.

Can I use Vercel without GitHub?

Yes. Vercel also supports GitLab and Bitbucket. You can also deploy directly from your terminal using the Vercel CLI: npm i -g vercel, then run vercel in your project folder.

How do I buy a domain?

You can buy from any registrar — popular options: Namecheap, Porkbun, Cloudflare Registrar (at-cost pricing), or directly through Vercel (Vercel → Domains → Buy). Prices range from $10-15/year for .com, more for fancier TLDs.

Can I deploy a backend / API to Vercel?

Yes, via Serverless Functions or Edge Functions. Create an api/ folder (Next.js API routes) or configure serverless functions in your framework of choice. Vercel handles scaling automatically, but note the Hobby plan has execution time limits (check their docs).

What if I want to delete my deployment?

Go to Project → Settings → General → Delete Project. This removes the deployment but keeps your GitHub repo. To also disconnect Vercel from GitHub, revoke access at GitHub → Settings → Applications → Authorized OAuth Apps.

How do I add a password to a preview deployment?

Password protection and team-only access are available on the Pro plan. Go to Project → Settings → Deployment Protection. For the free plan, you can use Vercel's "Vercel Authentication" to require login with your Vercel account.

Will my data / users be safe?

Vercel is SOC 2 Type 2 compliant and uses HTTPS by default. That said, you're still responsible for your own application security — sanitize user input, validate auth, keep dependencies updated, and never commit secrets to Git.

📌

Quick Reference — Key URLs & Commands

🐙

github.com

Create repos, push code, manage branches and pull requests.

vercel.com

Import GitHub repo, manage deployments, add domains, set env vars.

🔍

dnschecker.org

Check if your DNS records have propagated globally across regions.

📘

vercel.com/docs

Official documentation — deep dives on every feature and framework.

🔒

Auto SSL

Vercel automatically handles HTTPS — no extra setup or renewal needed.

Vercel CLI

Install: npm i -g vercel. Deploy from terminal with vercel.