---
title: "Astro 6 just works on Netlify"
description: "Astro 6 is here with Vite 7, a brand new dev server, and more. Deploy it on Netlify today."
source: "https://www.netlify.com/changelog/2026-03-10-astro-6/"
last_updated: "2026-07-04T01:43:00.000Z"
---
[Astro 6](https://astro.build/blog/astro-6/) is out today, and it just works on Netlify on day one. To upgrade, run:

```
npx @astrojs/upgrade
```

This will update Astro, the [Netlify adapter](https://docs.netlify.com/frameworks/astro/), and all other official integrations together.

## What’s new

Some highlights include:

-   **Vite 7 and a redesigned dev server** — Faster builds and a better dev server built from the ground up.
-   **Content Layer API** — Legacy content collections are fully removed. All collections must now use the [Content Layer API](https://docs.astro.build/en/guides/content-collections/).
-   **Node 22** — Node 18 and 20 are no longer supported.

Check the full [upgrade guide](https://docs.astro.build/en/guides/upgrade-to/v6/) for all the details.

## Watch out for import.meta.env

One change worth calling out: `import.meta.env` values are now **always inlined at build time** in Astro 6. This means if you were relying on `import.meta.env` to read environment variables at runtime in your server-side code, those values will be baked into your build output instead.

To read environment variables at runtime, use `process.env` instead:

```
- const apiKey = import.meta.env.API_KEY;+ const apiKey = process.env.API_KEY;
```

This is especially important for secrets. If a secret is inlined into your server bundle, it’s no longer secret. The good news: Netlify’s [smart secret scanning](https://docs.netlify.com/manage/security/secret-scanning/) will automatically detect exposed secrets in your build output and fail the build before it goes live, so you’ll know right away if something slipped through.

## Deploy an Astro 6 site on Netlify

If you want to get started with a new site, start with the [Astro on Netlify](https://docs.netlify.com/build/frameworks/framework-setup-guides/astro/) doc, or just click this button:

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/netlify-templates/astro-platform-starter)