Deploy Your Site for AI Coders
Your site works on your computer. Now let's put it on the internet so anyone can visit it. Once live, make sure to check your performance and SEO.
In this chapter
- What deploying actually means and why it's not scary
- The main hosting platforms compared in plain English
- How to buy a domain and connect it to your site
- A walkthrough of going from your laptop to a live URL
What Is Hosting?
Think of it this way: your website is a bunch of files. Hosting is renting a computer that is always on, always connected to the internet, and serves those files to anyone who visits your web address. Three things make it work:
Hosting Platforms Compared
These services take your project and put it on the internet. Most have a generous free tier, so you can launch your first site without paying anything.
Made by the creators of Next.js. Push your code to GitHub and your site is live in seconds. Extremely fast and reliable.
If you built your site with Next.js, Vercel is the easiest choice. Connect your GitHub repo and you are done.
Drag and drop your project folder or connect GitHub. Includes forms, authentication, and serverless functions.
Netlify has a drag-and-drop deploy feature. Just drag your project folder onto their dashboard, no terminal needed.
Host websites, APIs, and databases in one place. Great if your project has a backend or needs a database.
Deploy apps, databases, and background jobs with one click. Very beginner-friendly dashboard. Starts with a 30-day free trial, then a small free allowance or the $5/month Hobby plan.
Completely free hosting for simple websites, directly from your GitHub repository. Perfect for portfolios and landing pages.
GitHub Pages only works for static sites (no backend or database). Perfect for portfolios and simple projects.
Global edge network for blazing-fast performance. Unlimited bandwidth on the free tier. Great for any frontend project.
Cloudflare Pages gives you unlimited bandwidth for free. If you expect lots of visitors, this is a great pick.
Step-by-Step: Deploy with Vercel
Vercel is our recommended platform. Here is how to go from "works on my computer" to "live on the internet" in about five minutes.
-
📤
1
Push to GitHub Upload your project code to a GitHub repository. Your AI tool can do this for you.
-
🔑
2
Sign in to Vercel Go to vercel.com and sign in with your GitHub account.
-
📥
3
Import your repo Vercel will show your GitHub projects. Click the one you want to deploy.
-
🚀
4
Click Deploy Vercel auto-detects your project type. Just click Deploy and wait about 60 seconds.
-
🎉
5
You are live! Your site is now at yourproject.vercel.app. Share the link with anyone.
“I have a project on my computer and I want to put it on the internet using Vercel. Walk me through pushing my code to GitHub and deploying it on Vercel step by step.”
Buying a Domain
A domain is your web address (like yourname.com). You do not need one right away: your hosting platform gives you a free address like yoursite.vercel.app. But when you are ready for a professional look, here is where to buy one. For a deeper dive, see our custom domain guide.
Where to Buy
Tips for Choosing a Domain
Connecting Your Domain
Once you have a domain and a hosting platform, you need to connect them. Think of it like forwarding your mail to a new address. Here are the four steps:
-
1
Buy your domain Pick a registrar (Namecheap, Porkbun, etc.) and purchase your domain name.
-
2
Add domain in host Go to your hosting dashboard (Vercel, Netlify, etc.) and add your custom domain.
-
3
Update DNS records Your host will give you DNS records. Copy them and add them at your domain registrar.
-
4
Wait & verify DNS changes can take 5 minutes to 48 hours. Your host will confirm when it is ready.
“I bought a domain on Namecheap and my site is hosted on Vercel. Walk me through connecting my custom domain step by step, including what DNS records to add.”
Free vs Paid Hosting
Most platforms have a free tier that is perfect for learning and small projects. You can always upgrade later.
Free Hosting
- Perfect for portfolios and side projects
- Includes a free subdomain (yoursite.vercel.app)
- Usage limits, for example on bandwidth or how often you deploy
- Often personal use only (Vercel's free plan is non-commercial)
- SSL/HTTPS included automatically
- Great for learning and prototyping
Paid Hosting
- Needed for business sites and apps with lots of traffic
- More bandwidth, faster builds, better support
- Team collaboration features
- Analytics and advanced features
- Usually $5 to $20 per month
Terminal Basics for Deployment
The terminal (also called the command line) is where deployment often happens. Think of it as texting your computer instead of clicking buttons. You do not need to memorize anything: just tell your AI tool what you need.
“Install the project dependencies”
“Start the development server so I can preview my site”
“Save all my changes with Git and add a message describing what I changed”
“Push my latest changes to GitHub”
“Create a new GitHub repository for this project and push my code to it”
“Build my project for production so it is ready to deploy”
“Check my project for any errors before I deploy”
“Pull the latest changes from GitHub”
Prompt This
Copy-paste these prompts into your AI tool to apply what you just learned.
“Help me deploy my Next.js app to Vercel. Walk me through connecting my GitHub repo, setting environment variables, and going live.”
“My deployment is failing. Here is the error: [paste error]. Help me fix it and get my site live.”
“I have API keys and secrets that my app needs to work. Show me how to set up environment variables in Vercel so my keys stay private but my app can still use them.”
Domains & DNS Explained
These terms come up a lot when deploying. Here is what they mean in plain English.
Frequently Asked Questions
How much does it cost to deploy a website?
Most hosting platforms (Vercel, Netlify, Cloudflare Pages) offer free plans that cover personal projects. You start paying when you get significant traffic, need advanced features, or run a business on it: Vercel's free Hobby plan is for personal, non-commercial projects only. A .com domain costs about $11-15/year.
What's the difference between Vercel and Netlify?
Both are excellent for deploying Next.js and React apps. Vercel is made by the creators of Next.js, so it has the best Next.js support. Netlify has a simpler interface and great form handling. For Next.js projects, Vercel is the most popular choice.
My deploy failed. What do I do?
Check the build logs on your hosting platform: they show the exact error. Common causes: missing environment variables, a package that works locally but fails in production, or TypeScript errors. Copy the error and paste it to your AI tool for a fix.