---
title: "Install the Vercel CLI"
description: "Install the Vercel CLI and verify that it can access the intended Vercel account before opening the starter project."
canonical_url: "https://vercel.com/academy/python-on-vercel/install-vercel-cli"
md_url: "https://vercel.com/academy/python-on-vercel/install-vercel-cli.md"
docset_id: "vercel-academy"
doc_version: "1.0"
last_updated: "2026-09-29T18:31:24.420Z"
content_type: "lesson"
course: "python-on-vercel"
course_title: "Python on Vercel"
prerequisites:  []
---

<agent-instructions>
Vercel Academy — structured learning, not reference docs.
Lessons are sequenced.
Adapt commands to the human's actual environment (OS, package manager, shell, editor) — detect from project context or ask, don't assume.
The lesson shows one path; if the human's project diverges, adapt concepts to their setup.
Preserve the learning goal over literal steps.
Quizzes are pedagogical — engage, don't spoil.
Quiz answers are included for your reference.
</agent-instructions>

# Install the Vercel CLI

# Install and authenticate the Vercel CLI

That CLI you installed for a workshop may still be the one your terminal finds. Before we open either app, we'll install the current Vercel CLI and connect it to the account we intend to use.

## Outcome

Install the Vercel CLI and verify that it can access your Vercel account.

## Hands-on exercise 1.1

### Install

The CLI ships as an npm package. Install it globally so you can run it from anywhere:

```bash
npm install -g vercel@latest
```

The CLI requires Node.js. If `node --version` fails, install the LTS release from [nodejs.org](https://nodejs.org) before continuing.

### Authenticate

Log into your Vercel account:

```bash
vercel login
```

The CLI starts an [OAuth device flow](https://vercel.com/changelog/new-vercel-cli-login-flow) and prints a verification URL. Open the URL on any browser-capable device, check that the location and request time match, then approve the login. The terminal confirms when authentication finishes:

```
> Success! Authentication complete.
```

### Verify

Confirm the CLI is installed and authenticated:

```bash
vercel --version
vercel whoami
```

The first command prints the CLI version. The second confirms which account is active.

\*\*Note: Token-based auth\*\*

In CI, authenticate with a Vercel access token instead of an interactive
login. Pass the token to CLI commands with the `--token` option.

## Try It

Run both commands and check the output:

```bash
vercel --version
```

```
Vercel CLI 60.1.3
```

Use the current Vercel CLI for this course. An older CLI may support FastAPI but lack support for the [Services](https://vercel.com/docs/services) configuration and service bindings we'll use. Your version may be newer than the example above.

```bash
vercel whoami
```

```
your-vercel-username
```

If `vercel whoami` returns your username, authentication worked. If the command reports that you're logged out, run `vercel login` again.

\*\*Warning: Multiple accounts\*\*

The CLI stores one active session at a time. If you have a personal and a work
Vercel account, `vercel login` will switch you to whichever you authenticate
as. Run `vercel whoami` any time you're unsure which account is active.

## Commit

We haven't changed any project files, so there is nothing to commit yet.

## Troubleshooting

**`vercel login` waits for approval:** Open the verification URL printed in the terminal and enter the device code if prompted. The browser can be on another device.

**`vercel: command not found` after install:** The global npm bin directory may be missing from your `PATH`. Run `npm config get prefix` to locate it, then add its `bin` directory to your `PATH`. You can also run the CLI through `npx vercel`.

## Done-When

- [ ] `vercel --version` prints a version number
- [ ] `vercel whoami` returns your Vercel username

## Solution

```bash
npm install -g vercel@latest
vercel login
vercel --version  # check the installed version
vercel whoami     # prints your Vercel username
```


---

[Full course index](/academy/llms.txt) · [Sitemap](/academy/sitemap.md)
