shahriyar.dev
Back to blog
VercelCLI deploymentcommand-lineweb developmenthostingbeginner guide

Deploy Like a Developer: Zero-Config Deployment from Your Terminal with Vercel CLI

·3 min read

You've probably spent a lot of time perfecting your project, and now you're ready to share it with the world. One of the fastest and most developer-friendly ways to get your site online is with Vercel. It’s a cloud platform that builds, deploys, and scales your applications with zero configuration required. In this guide, you'll walk through deploying directly from your command line, giving you full control over the process.

The first step is to make sure you have a Vercel account. Head over to vercel.com and sign up if you haven't already. You can keep your account logged into your default browser, as this will streamline the later steps. Once your account is ready, you'll need to install the Vercel Command Line Interface (CLI) globally on your system.

Open your terminal (or command prompt) and run the following command:

sh
npm i -g vercel

This will install the vercel command globally, allowing you to access it from any project directory. After installation completes, you must authenticate your local machine with your Vercel account. In your terminal, run the login command:

sh
vercel login

You will see a prompt similar to this:

sh
Vercel CLI 37.7.1
? Log in to Vercel (Use arrow keys)
> Continue with GitHub
  Continue with GitLab
  Continue with Bitbucket
  Continue with Email
  Continue with SAML Single Sign-On
 ─────────────────────────────────
  Cancel

Use the arrow keys to select the authentication method you used to create your Vercel account. For example, if you signed up with GitHub, select Continue with GitHub and press Enter.

This action will automatically open a browser window and attempt to log you in. If you're already logged into Vercel in that browser, you'll see a confirmation message: Vercel CLI Login Success. Back in your terminal, you will also see a corresponding success message.

Now, open your project folder in Visual Studio Code or any terminal of your choice. Ensure your project is ready to build (for example, it has a package.json or is a static site). To deploy to production, run the following command from your project's root directory:

sh
vercel --prod

This command will link your local project with a Vercel project, prompt you for any required settings (like the project name or team), and then build and deploy your site to production. The output will include a live site link that you can share immediately.

Follow this GIF for a visual walkthrough

Vercel CLI Deployment Example

After the deployment completes, visit your Vercel dashboard at vercel.com/dashboard. You will see your new project listed, complete with a live site URL, deployment history, and environment settings. You can now share that link with anyone or continue to add custom domains and environment variables from the dashboard.

Comments