Netlify CLI Deployment and Configuration

Deploy your website to the internet in minutes using Netlify's powerful CLI

30 min
Beginner
75% completion rate
50% popularity
netlify
deployment
hosting
claude-code
cli-tools

Module 4: Netlify CLI Deployment

Overview

Your website lives on GitHub—but only developers can see it there. Time to share it with the world! Using Netlify CLI with Claude's guidance, you'll deploy your site to a real web address that anyone can visit. No server setup, no complex configuration—just pure deployment magic.

What You'll Learn

  • Installing and setting up Netlify CLI
  • Deploying directly from your terminal
  • Understanding the deployment process
  • Setting up custom domains
  • Managing and updating deployments

Prerequisites

  • Completed Modules 1-3
  • Website in GitHub repository
  • Netlify account (free at netlify.com)
  • 30 minutes to go live
  • Excitement to see your site online!

Why Netlify?

The Modern Web Platform

Netlify offers:

  • Instant deployment: Seconds, not hours
  • Global CDN: Fast everywhere
  • HTTPS included: Secure by default
  • Custom domains: Professional URLs
  • Continuous deployment: Auto-updates

CLI vs Web Interface

Web interface:

  • Leave terminal
  • Drag and drop files
  • Click through options
  • Manual process

CLI with Claude:

  • Stay in terminal
  • Deploy with commands
  • Automation ready
  • Professional workflow

Installing Netlify CLI

Quick Installation

Ask Claude:

⚡ Install Netlify CLI for me. I want to deploy my website project.

Claude will:

npm install -g netlify-cli

Then verify:

netlify --version

First-Time Authentication

⚡ Help me authenticate with Netlify. I have an account but 
haven't used the CLI before.

The process:

  1. Run netlify login
  2. Browser opens
  3. Authorize CLI access
  4. Return to terminal
  5. Ready to deploy!

Your First Deployment

The Magic Moment

In your project directory:

⚡ Deploy my website to Netlify. This is my first deployment.

Claude runs:

netlify deploy

You'll see:

  1. "This folder isn't linked to a site yet"
  2. "Create & configure a new site"
  3. Choose team
  4. Optional: custom site name

Understanding the Process

⚡ Explain what just happened during the deployment. 
What did Netlify do with my files?

Claude explains:

  • Files uploaded to CDN
  • Unique URL generated
  • Draft deployment created
  • Not live yet (preview only)

Preview Deployments

Testing Before Going Live

After initial deploy:

⚡ Open my Netlify draft deployment so I can preview it.

Claude runs:

netlify open:site

Your browser shows the preview URL!

Checking Everything Works

⚡ What should I check in my preview deployment before going live?

Claude suggests testing:

  • All pages load
  • Images appear
  • Links work
  • Responsive design
  • Forms function

Going Live

Production Deployment

Once satisfied with preview:

⚡ My preview looks perfect. Deploy it to production so it's live.

Claude runs:

netlify deploy --prod

That's it! Your site is live at: https://[your-site-name].netlify.app

Your Live URL

⚡ Show me my live website URL and help me share it.

Claude helps you:

  • Find your URL
  • Open in browser
  • Copy for sharing
  • Celebrate! 🎉

Custom Domain Setup

Professional Web Address

I want to use a custom domain instead of .netlify.app. 
Guide me through the process.

Claude explains:

  1. Buy domain (if needed)
  2. Add to Netlify
  3. Configure DNS
  4. Wait for propagation
  5. HTTPS automatic

Free Netlify Subdomain

⚡ Can I change my Netlify subdomain to something more memorable?

Change from amazing-einstein-a1b2c3 to your-project-name!


Deployment Configuration

netlify.toml File

⚡ Create a netlify.toml configuration file for my site. 
Explain what it does.

Claude creates:

[build]
  publish = "."

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Headers and Redirects

⚡ Add security headers and create a redirect from /home to /

Learn advanced configuration!


Updating Your Site

The Update Workflow

Make changes and redeploy:

⚡ I updated my website. Walk me through the complete process 
to get changes live.

Claude guides:

  1. Save changes
  2. Git commit
  3. Git push to GitHub
  4. Deploy to Netlify
  5. Verify updates

Quick Deploy

Is there a faster way to deploy changes while I'm developing?

Learn about:

  • Draft deployments
  • Production when ready
  • Continuous deployment (next module!)

Essential Netlify Commands

CLI Command Reference

Show me the most useful Netlify CLI commands with examples.

Key commands:

# Deploy draft
netlify deploy

# Deploy production
netlify deploy --prod

# Open site
netlify open:site

# Open admin
netlify open:admin

# View site info
netlify status

# Link to existing site
netlify link

# Unlink site
netlify unlink

Environment Variables

Secure Configuration

⚡ How do I add environment variables to my Netlify site? 
When would I need them?

Learn about:

  • API keys
  • Configuration values
  • Secure storage
  • Access in code

Setting Variables

⚡ Add an environment variable for my contact form endpoint.

Claude shows both CLI and UI methods.


Deployment Features

Deploy Previews

⚡ What are deploy previews and how do they work?

Understand:

  • Every deploy has unique URL
  • Test before production
  • Share specific versions
  • Rollback capability

Instant Rollbacks

I deployed a broken version! How do I quickly go back 
to the previous working version?

Crisis management with Claude!


Forms and Functions

Netlify Forms

⚡ My site has a contact form. Set it up to work with 
Netlify's form handling.

Claude adds:

  • Form detection attribute
  • Spam protection
  • Submission handling
  • Email notifications

Serverless Functions

⚡ Can I add backend functionality to my static site?

Discover Netlify Functions basics!


Performance Optimization

Asset Optimization

⚡ How can I make my Netlify site load faster?

Claude explains:

  • Image optimization
  • CSS/JS minification
  • Caching strategies
  • CDN benefits

Analytics

Set up Netlify Analytics to see who visits my site.

Learn about privacy-friendly analytics.


Troubleshooting

Common Issues

"Page not found" errors

⚡ Some pages show 404 errors on Netlify but work locally. 
Help me fix this.

"Deploy failed"

⚡ My deployment failed with an error. Help me understand 
and fix it.

"Changes not showing"

⚡ I deployed but don't see my changes live. What could be wrong?

Checkpoint Task

Your Mission

Deploy your website to the world:

  1. Netlify Setup

    • Install Netlify CLI
    • Authenticate with account
    • Link to your project
    • Configure site settings
  2. First Deployment

    • Deploy to draft URL
    • Preview and test everything
    • Deploy to production
    • Share your live URL
  3. Site Enhancement

    • Add custom site name
    • Configure netlify.toml
    • Set up form handling
    • Test contact form
  4. Update Workflow

    • Make visible change
    • Commit to Git
    • Push to GitHub
    • Deploy to Netlify
    • Verify live update
  5. Professional Touch

    • Add favicon
    • Configure 404 page
    • Set up redirects
    • Optimize performance

Success Criteria

  • ✅ Site live on Netlify
  • ✅ Custom subdomain configured
  • ✅ Contact form working
  • ✅ Can deploy updates
  • ✅ Professional appearance

Celebrating Your Launch

You're Live on the Web!

Your website now:

  • Has a real web address
  • Loads fast globally
  • Updates with commands
  • Looks professional

Share your URL with:

  • Friends and family
  • Social media
  • Professional network
  • Portfolio

What You've Accomplished

From zero to deployed:

  1. Created with AI (Claude Code)
  2. Version controlled (Git)
  3. Backed up (GitHub)
  4. Deployed (Netlify)
  5. Live on the internet!

Next Steps

You've deployed manually—now automate! Module 5 will show you:

  • Connecting GitHub to Netlify
  • Automatic deployments on push
  • Branch deployments
  • Advanced CI/CD workflows

Preparation for Module 5

  1. Site successfully deployed
  2. Comfortable with manual deployment
  3. Ready for automation
  4. GitHub and Netlify connected

Ready to automate deployments? Module 5 sets up continuous delivery!

Your Progress

Not started