Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 37 ยท Getting Started

Your First Deploy on Vercel and Netlify

Deploy a site three ways on Vercel and Netlify: import a Git repository, drag a folder, or use the CLI. Learn what each screen asks and what a deployment URL means.

The fastest way to understand a platform is to ship something tiny. In this lesson you will create a three-file website and publish it using each of the three entry points that both platforms offer: importing a Git repository, uploading a folder, and using the command line.

You need a free account on the platform you want to try (signing up with GitHub is the easiest) and Git installed. Because the platforms cannot run on this site, the steps below are described precisely, and the code is yours to run on your own computer.

Step 1: create a tiny site

Make a folder called hello-deploy with these files.

HTML
<!-- index.html -->
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hello deploy</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <h1>It is live</h1>
    <p id="when"></p>
    <script src="app.js"></script>
  </body>
</html>
CSS
/* style.css */
body { font-family: system-ui, sans-serif; max-width: 40rem; margin: 3rem auto; }
JavaScript
// app.js
document.getElementById("when").textContent =
  "Loaded at " + new Date().toLocaleTimeString();

There is no build step here. The folder itself is the output, which is the simplest possible deployment.

Initialize a repository and push it to GitHub:

Terminal
git init
git add .
git commit -m "First version"
git branch -M main
git remote add origin https://github.com/YOUR-NAME/hello-deploy.git
git push -u origin main

On Vercel: from the dashboard choose Add New... > Project, connect GitHub if asked, pick the repository and press Import. The configuration screen shows a Framework Preset (it will say Other for plain HTML), a Root Directory, and Build and Output Settings you can leave empty. Press Deploy.

On Netlify: choose Add new site > Import an existing project, pick GitHub, select the repository. The settings screen asks for a build command and a publish directory. Leave the build command empty and set the publish directory to . (or leave it blank for the repository root). Press Deploy.

After a short wait you receive a URL such as hello-deploy.vercel.app or something-random.netlify.app. From now on every git push creates a new deployment automatically. That is the core loop of both platforms, covered in the next chapter.

Way 2: drag and drop

If you do not want to use Git yet, Netlify offers a drop zone (look for Add new site > Deploy manually, or the Netlify Drop page): drag the folder onto the page and it is published. Vercel's dashboard focuses on Git and the CLI; for a quick one-off without Git, use the CLI below.

Drag-and-drop deploys are handy for demos, but they have no history tied to commits and no previews. Move to Git once the site matters.

Way 3: the command line

Install a CLI with npm. These are the official package names:

Terminal
npm install --global vercel      # Vercel CLI
npm install --global netlify-cli # Netlify CLI

Vercel: inside the folder run vercel. The first time it asks you to log in and answers questions: set up and deploy, which scope (your account or team), link to an existing project or create one, the project name, and the directory. It deploys a preview and prints the URL. Run vercel --prod to publish to production.

Netlify: run netlify login, then netlify deploy. It asks whether to create a new site, then for the publish directory (type .). That creates a draft deploy with a unique URL. When you are happy, run netlify deploy --prod to publish it.

Both CLIs default to a safe, non-production deploy. You must ask for production explicitly with --prod. This is deliberate: a preview is cheap to throw away.

What the URL means

A deployment URL is usually made from several parts. Understanding them helps you recognize which deploy you are looking at.

Node.js Reading a deployment URL (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

A deploy as a record

Each deploy is an immutable snapshot: the files, the build log, the environment values that were used and the Git commit. Immutable means a deploy never changes after it is created, which is why instant rollback works. This stand-in models that idea.

Node.js Immutable deploys (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Common first-deploy mistakes

  • Wrong output directory. The platform serves a folder that does not exist or is empty, so you see a 404. Check the publish/output directory setting.
  • Forgetting to commit the build config. The settings work on your machine only.
  • Case-sensitive file names. Image.PNG and image.png differ on the build servers (Linux) even if Windows tolerates it.
  • Absolute local paths such as C:/... in HTML. Use relative or root-relative paths.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the CLI publish when you run vercel or netlify deploy without extra flags?

    Both CLIs create a non-production deploy by default; add --prod for production.
  2. 2. For a plain HTML folder with no build step, what should the build command be?

    With no build, the folder itself is the output, so no command is needed.
  3. 3. What happens after you connect a repository and deploy once?

    Git integration triggers a deployment on each push.
  4. 4. Why might a file load locally but 404 on the platform?

    A mismatch like Image.PNG versus image.png works on Windows but fails on Linux.

Summary

  • You can deploy by importing a Git repository, dragging a folder (Netlify) or using the CLI.
  • The import screens ask for framework, root directory, build command and output (publish) directory.
  • CLIs make previews by default; add --prod for production.
  • Every deploy is an immutable snapshot with its own URL.
  • Watch for wrong output directories, file-name case and local paths.

Next: Static Sites and Frameworks