Look, Vercel CLI is basically a deployment tool that doesn't completely suck. If you've ever spent 3 hours configuring Docker containers just to deploy a React app, you'll appreciate what this thing does.
Built by the Next.js team, it's opinionated as hell but in a good way. You run vercel
, it figures out what you're trying to deploy, and usually just works. When it doesn't work, you'll know immediately because it fails fast and loud.
What Actually Happens When You Deploy
Here's the real story: Vercel CLI tries to be smart about your project. It looks at your files and goes "oh, this is a Next.js app" or "this looks like a static site" and configures everything automatically.
Framework Detection: Works for 30+ frameworks including the obvious ones (React, Vue, Svelte) and some you probably haven't heard of. If you're using something weird, you might be SOL.
Edge Network: Your stuff gets deployed to a CDN with 300+ edge locations. This means your site loads fast from basically anywhere, which is nice until you see the bandwidth bill.
Serverless Functions: API routes deploy as Lambda functions automatically. No Docker, no Kubernetes bullshit, just functions that run when needed. Cold starts can be annoying though - first request after a while takes like 500ms to wake up. Could be longer depending on your function size.
Getting This Thing Installed
You need Node.js 20+ since Node 18 was deprecated September 1, 2025. If you're still on Node 18 or 16, update your shit - things will break.
npm install -g vercel
Global install means you can run vercel
from anywhere. If you hate global packages (smart):
npm install vercel --save-dev
npx vercel
First time you run it, vercel login
opens your browser for OAuth. On headless servers, you get a URL to copy-paste. The auth token gets stored in ~/.vercel
so you don't have to log in every time.
Commands You'll Actually Use
Most of the time you'll use like 4 commands:
vercel
- Just deploys your shit. Interactive, asks questions, usually works. This is what you use 90% of the time.
vercel dev
- Local development server that actually mimics production. Unlike npm run dev
, this one runs your serverless functions locally so you can test API routes without deploying first.
vercel env
- Manage environment variables. Because the dashboard is slow and you're already in the terminal anyway.
vercel logs
- When your deployment breaks in production and you need to see what went wrong. Saves you from digging through the web dashboard.
Why vercel dev
Doesn't Completely Suck
vercel dev
is actually useful, which is rare for local development tools. It runs your API routes as actual serverless functions instead of just Node.js scripts, so you catch issues before they blow up in production.
Serverless Functions Work Locally: Your /api
routes run in the same runtime as production. Cold starts, timeouts, the whole deal. Finally, no more "works on my machine" for serverless apps.
Environment Variables Just Work: Loads from .env.local
, .env.development
, and your Vercel project settings automatically. No more copying variables between 5 different files.
Multiple Projects: Runs on different ports so you can have multiple Vercel projects running simultaneously. Port 3000 taken? It picks 3001. Actually intelligent.
One Annoying Thing: It's slower to start than npm run dev
because it has to set up the serverless environment. Takes like 10-15 seconds instead of 3. Not a huge deal but noticeable.
How Deployments Actually Work
Just run vercel
in your project directory. It figures out what you're building and deploys it. First time might ask a few questions about project name and whether you want it linked to a Git repo.
Preview URLs: Every deployment gets a unique URL like project-abc123.vercel.app
. Perfect for testing and showing to clients without touching production. These URLs include all your backend functions too.
Production Deployments: vercel --prod
deploys to your actual domain. Or just push to your main branch if you have Git integration set up.
Build Process: Vercel optimizes your build automatically. Images get compressed, assets get CDN'd, functions get bundled. You don't have to think about it.
When You Need Custom Configuration
Most projects work with zero config, but sometimes you need a vercel.json
file:
{
"functions": {
"api/heavy-task.js": {
"maxDuration": 60
}
},
"redirects": [
{ "source": "/old-page", "destination": "/new-page" }
]
}
Custom Build Commands: Override the default build if you're doing something weird. Usually you don't need this.
Domain Management: vercel domains
handles DNS and SSL certificates. Easier than fighting with registrar dashboards.
Team Features: If you're on a team plan, you get role-based access and shared environment variables. Pretty standard enterprise stuff.
The CLI gets updated regularly with new features. Recent additions include AI development tools and better monorepo support. It's actively maintained, which is nice.