Tutorial

Deploy any site in 60 seconds with Netlify

Drag a folder in, get a live URL. Connect to GitHub, push code, and watch it auto-deploy. Free, fast, HTTPS by default — with forms and functions built in.

Free tier covers 95% of personal projects
Step 1

What Netlify is

Netlify is a hosting platform built for modern websites. It's what you use when you want to put your HTML/CSS/JS project online without touching servers, DNS settings, or terminal commands (unless you want to).

Drag-to-deploy

Drop your site folder onto the dashboard. It's live in seconds with a sharable URL.

Git integration

Connect your GitHub repo. Every push to main auto-deploys. Pull requests get preview URLs.

HTTPS free

Automatic SSL certificates from Let's Encrypt. No config, no renewals.

Global CDN

Your site is cached on servers worldwide. Fast for users in Tokyo and Toronto.

Forms included

Add one attribute to any <form> and Netlify captures submissions for free.

Custom domains

Point yoursite.com at Netlify in minutes. Free subdomain if you don't have one.

100 GB

bandwidth/month
(free tier)

300

build minutes/month
(free tier)

100

form submissions/month
(free tier)

sites you can deploy

Step 2

Method 1 — drag & drop (easiest)

Have a plain HTML/CSS/JS folder? Use this. No Git, no CLI, no account setup beyond a free signup.

1

The 4-step drag-drop flow ~60 seconds

  1. Go to app.netlify.com/drop
  2. Sign in with GitHub, Google, or email (free, 30 seconds)
  3. Drag your entire project folder onto the upload zone
  4. Get a live URL like https://brilliant-cat-123abc.netlify.app
This is what the Netlify drop zone looks like Click to open the real one in a new tab
Heads up: Drag the folder itself, not the contents. And make sure your entry file is named index.html — that's what Netlify serves by default.
Step 3

Method 2 — connect a GitHub repo (pro setup)

This is how real sites ship. Push code → Netlify auto-builds & deploys. Every branch gets its own preview URL. You get rollbacks for free.

2

The GitHub flow ~5 minutes, one-time setup

  1. Push your project to a GitHub repository
  2. In Netlify dashboard, click Add new site → Import from Git
  3. Authorize Netlify to access your GitHub
  4. Pick your repo from the list
  5. For plain HTML/CSS/JS sites, leave build command blank and publish directory as /
  6. Click Deploy — your site is live in 20 seconds
  7. Every future git push to main auto-deploys 🎉

Build settings for common frameworks

Build command:      (leave blank)
Publish directory:  .
Build command:      npm run build
Publish directory:  dist
Build command:      npm run build
Publish directory:  .next

# Netlify auto-detects Next.js and installs the adapter
Build command:      npm run build
Publish directory:  dist
Step 4

Method 3 — the Netlify CLI (for power users)

When you want to deploy from your terminal, preview locally, or script deploys into CI.

# Install the CLI once, globally
npm install -g netlify-cli

# Log in (opens a browser for auth)
netlify login
# From inside your project folder:

# Deploy a draft URL (safe — doesn't overwrite production)
netlify deploy

# Deploy to production
netlify deploy --prod
# Runs your dev server + Netlify Edge locally.
# Forms, functions, and redirects all work as they would in production.
netlify dev
Step 5

Rename your site — ditch the random URL

When you first deploy, Netlify gives you a charming-but-random subdomain like brilliant-cat-123abc.netlify.app. That's fine for a test, but not for sharing with a client, a professor, or on your résumé. Rename it in 30 seconds.

Option A — Rename from the dashboard (most common)

1

Change the site name & subdomain via Project configuration

  1. Open your site in the Netlify dashboard
  2. Click Project configuration (in the left sidebar — older UIs say "Site settings")
  3. Under Site details → Site information, find Site name and click Change site name
  4. Type your new name. Rules:
    • Lowercase letters, numbers, and hyphens only
    • Must be globally unique across all of Netlify
    • 3–37 characters
  5. Click Save — your URL instantly becomes your-new-name.netlify.app
Good site names: jane-gilliam-portfolio, acme-coffee-nyc, cs200-final-project.
Skip: generic names like my-site or portfolio — they're almost certainly taken.

Option B — Use netlify.toml for build + env config

A netlify.toml file at your project root lets you version-control build settings, redirects, headers, and environment variables. It's perfect for team projects — settings move with the repo.

# Save this as netlify.toml at your project root

[build]
  # Folder Netlify serves after the build finishes
  publish = "dist"

  # Command Netlify runs to build your site
  command = "npm run build"

  # Base directory (only for monorepos — usually omit)
  # base = "packages/web"

[build.environment]
  # Node version used during the build
  NODE_VERSION = "20"

  # Any env vars your build needs
  VITE_API_URL = "https://api.example.com"

# Pretty URLs — strip .html from every page
[[redirects]]
  from = "/:page.html"
  to   = "/:page"
  status = 301

# Security headers for every response
[[headers]]
  for = "/*"
  [headers.values]
    X-Frame-Options = "DENY"
    X-Content-Type-Options = "nosniff"
    Referrer-Policy = "strict-origin-when-cross-origin"
[build]
  publish  → Which folder to deploy (dist, build, public, .)
  command  → Shell command to produce that folder
  base     → Only for monorepos; where to run npm install

[build.environment]
  Build-time only env vars. For runtime vars
  (Netlify Functions), use the dashboard UI.

[[redirects]]
  Double brackets = list — you can add as many as you want.
  Each needs from / to / status.

[[headers]]
  Same double-bracket pattern for response headers.
  Apply security, caching, CORS rules per path.

# Tip: comments start with # and are ignored.
# netlify.toml is TOML format (similar to INI files).
Note on the site name: The name field is not set in netlify.toml — it lives only in the dashboard (or via netlify api updateSite from the CLI). The .toml file handles build configuration; the dashboard handles site identity.
Step 6

Netlify Forms — no backend required

Add data-netlify="true" to any form. Submissions land in your dashboard, with optional email notifications and spam protection.

<form name="contact"
      method="POST"
      data-netlify="true">

  <!-- Hidden input required by Netlify to name the form -->
  <input type="hidden" name="form-name" value="contact">

  <label>Name
    <input type="text" name="name" required>
  </label>

  <label>Email
    <input type="email" name="email" required>
  </label>

  <label>Message
    <textarea name="message" required></textarea>
  </label>

  <button type="submit">Send</button>
</form>
<form name="contact"
      method="POST"
      data-netlify="true"
      data-netlify-honeypot="bot-field">

  <!-- Hidden field humans skip, bots fill in — silent spam filter -->
  <p style="display:none;">
    <label>Don't fill this out: <input name="bot-field"></label>
  </p>

  <!-- ...rest of your form -->
</form>
After you deploy: Go to Forms in the Netlify dashboard to see submissions. Turn on email notifications under Form settings → Notifications.
Step 7

Custom domain in 3 clicks

Netlify gives you a .netlify.app URL free. To use your own domain:

  1. In your site dashboard → Domain settings → Add a custom domain
  2. Type your domain (e.g. yourname.com) and click Verify
  3. Either point your DNS to Netlify (they give you the nameservers) or add a CNAME record at your registrar. Both work.
  4. SSL certificate is issued automatically within a few minutes
Don't have a domain yet? Namecheap, Porkbun, and Cloudflare all sell .com domains for $8–$12/year. Netlify also resells them directly if you want one-click setup.
Step 8

Redirects, headers, and _redirects

Drop a _redirects or netlify.toml file in your project root for advanced routing.

# Old URL → new URL (permanent, 301)
/old-page    /new-page    301

# Short URL → external link
/github      https://github.com/yourname    302

# SPA fallback — any unmatched route goes to index.html
/*           /index.html  200
# netlify.toml lives at the project root

[build]
  publish = "dist"
  command = "npm run build"

[[redirects]]
  from = "/old-page"
  to   = "/new-page"
  status = 301

[[headers]]
  for = "/*"
  [headers.values]
    X-Frame-Options = "DENY"
    X-Content-Type-Options = "nosniff"
Step 9

Why Netlify is perfect for students

Genuinely free

The free tier isn't a trial. Personal sites, portfolios, and small class projects all fit comfortably inside it.

Shareable URLs

Every deploy has a unique URL. Send it to your instructor, include it on résumés — it just works.

Instant rollbacks

Every deploy is saved. Break something? Click "restore" next to the last good build.

Deploy previews

Every pull request gets its own live URL. Perfect for group projects — review before merging.

Get started: app.netlify.com/signup — use GitHub sign-in if you have it, it connects your repos automatically.