← Back to all Posts

Deploying Astro to Netlify

Why Netlify?

Netlify is one of the most popular platforms for deploying static sites. It offers:

  • Automatic deployments from Git
  • Free SSL certificates
  • Edge CDN
  • Serverless functions

Prerequisites

  • Astro project ready to build
  • Git repository hosted on GitHub, GitLab, or Bitbucket
  • Netlify account

Step 1: Connect Your Repository

  1. Log in to Netlify
  2. Click "Add new site" → "Import an existing project"
  3. Select your Git provider and authorize Netlify
  4. Choose your Astro repository

Step 2: Configure Build Settings

Netlify should auto-detect Astro, but verify these settings:

  • Build command: npm run build
  • Publish directory: dist

Step 3: Deploy

Click "Deploy site". Netlify will build and deploy your Astro site in under a minute.

Custom Domains

Go to Site settings → Domain management to add your custom domain. Netlify automatically provisions an SSL certificate.

Continuous Deployment

Every push to your main branch triggers a new build and deployment. You can preview deploys for pull requests too.

That's it — your Astro site is live on the internet!