Netlify
How to Deploy an Astro Website to Netlify
Netlify is one of the most popular static hosting platforms. It offers free hosting, automatic Git deploys, and a global CDN.
This guide walks you through deploying your Blacks project to Netlify.
Netlify Deploy

Step 1 — Create a Netlify Account
Go to netlify.com and sign up. You can register directly with your GitHub account — this simplifies the connection later.
Step 2 — Create a New Project
From your Netlify dashboard:
- Click Add new site → Import an existing project
- Select GitHub and authorize Netlify
- Choose your Blacks repository from the list
Step 3 — Configure Build Settings
Set the build settings:
| Setting | Value |
|---|---|
| Framework | Astro |
| Build command | npm run build |
| Publish directory | dist |
Then click Deploy site.
Your site goes live at:
https://your-project.netlify.appEvery future push to your Git repository triggers an automatic build and deploy.
Add a Custom Domain
If you want to use your own domain name:
- Go to your Netlify project dashboard
- Click Domain settings → Add custom domain
- Enter your domain name
- Add Netlify’s nameservers to your domain registrar
Netlify provides a free SSL certificate automatically once DNS is configured.
How to Set Up Netlify DNS
- In Netlify, go to Domain management
- Click Add domain
- Copy Netlify’s nameservers (they look like
dns1.p01.nsone.net) - Log in to your domain registrar (Namecheap, GoDaddy, Cloudflare, etc.)
- Replace your domain’s nameservers with Netlify’s
- Wait for DNS propagation (5 minutes to 24 hours)
After propagation, your domain points to Netlify and HTTPS is enabled automatically.
Build Settings Summary
| Setting | Value |
|---|---|
| Build command | npm run build |
| Publish directory | dist |
| Framework | Astro |
| Node version | 20 or newer |
Troubleshooting
| Problem | Solution |
|---|---|
| Build fails | Check that Node.js version is 20 or newer |
| 404 errors on the live site | Verify publish directory is dist |
| Images not loading | Check site URL in astro.config.mjs |
| Custom domain not working | Wait for DNS propagation, or check nameservers |
| Changes not showing | Hard refresh in your browser (Ctrl + Shift + R) |
Useful Links
Next Step
Explore other hosting options:
👉 Vercel — frontend-focused platform with instant preview deploys