---
title: "Deploy Astro on Edge | Content-first sites at the edge"
description: "Deploy Astro static and SSR sites to Edge — global CDN with zero egress, S3-compatible storage for assets and on-the-fly image optimisation."
url: https://edge.network/solutions/astro/
---

# Deploy Astro on Edge | Content-first sites at the edge

For Astro

# Astro sites, edge-delivered

Build with Astro, serve from Edge. A global CDN with zero egress
fees, S3-compatible storage for assets and a small VM for SSR
when you need it. (We use this stack ourselves.)

[Start free](https://edge.network/account) [Read the deploy guide](https://edge.network/docs/cdn/getting-started)

# Build the site

$ astro build

# Sync to Edge Storage

$ aws s3 sync ./dist s3://my-site \

--endpoint https://storage.edge.run

# Front it with the CDN

$ edge cdn create example.com \

--origin s3://my-site

# Purge on every deploy

$ edge cdn purge example.com

✓ Live, globally cached

## Why Astro teams pick Edge

We built our own marketing site with this exact stack — so we know
the deploy story works at speed and at scale.

### Static-first delivery

Build to `dist/`, push to Edge Storage, front it with the global CDN. Most pages never touch a server — and they fly.

### SSR when you need it

Run Astro's Node adapter on a small VM for dynamic routes. Static pages stay on the CDN, dynamic ones fall through to your origin.

### Image optimisation, included

Use Astro's `<Image />` with our URL-based optimiser. Resize, crop, AVIF/WebP — at the CDN, no per-image fees.

### Asset storage that scales

S3-compatible Edge Storage for media, downloads and content imports. The same bucket the CDN serves from.

### CI-friendly deploys

Build in GitHub Actions, sync to Storage with the AWS CLI, purge the CDN. A handful of YAML, no platform lock-in.

### Built on Astro ourselves

edge.network runs on Astro, hosted on Edge. We test our docs, blog and marketing on the same stack we sell.

Reference architecture

## How Astro maps to Edge

For a static-only site you don't even need a VM — just a bucket and
a CDN deployment. Add Compute later if and when you need SSR.

Storage Holds the built `dist/` bundle and any uploaded media

CDN Serves the entire static build with zero egress fees

Compute Optional: runs Astro's Node adapter for SSR routes

Image Optimization Powers `<Image />` with on-the-fly transforms

DNS Anycast DNS for the apex, www and preview branches

# .github/workflows/deploy.yml

- run: npm ci && npm run build

- run: |

aws s3 sync dist s3://$BUCKET \

--endpoint $EDGE_ENDPOINT \

--delete --cache-control max-age=31536000

- run: |

curl -X POST $EDGE_API/cdn/deployments/$ID/purge \

-H "Authorization: Bearer $TOKEN"

## Common questions

### Static-only or SSR?

Either. Pure static sites need only a Storage bucket and a CDN deployment. SSR sites add a small VM running Astro's Node adapter — the CDN still handles all the static work.

### How do I deploy from CI?

Build in your CI of choice, then `aws s3 sync ./dist s3://your-bucket --endpoint https://...` and trigger a CDN purge via the Edge API. We have ready-made GitHub Actions snippets.

### Does Astro's ` ` work?

Yes — point Astro at our image optimisation service via a custom service / loader. You get the same component API, with transforms happening at the CDN.

### Can I host previews per branch?

Yes. Push each branch build to a `branch-name/` prefix in Storage, alias a `branch.preview.example.com` subdomain to it via DNS + CDN. Tear it down on PR close.

By Stack

## Other stacks on Edge

[View all stacks →](https://edge.network/solutions/stacks)
[Static Sites Hugo, Eleventy, Jekyll — straight to the CDN](https://edge.network/solutions/static-sites)[Laravel Production VMs, S3 storage and CDN](https://edge.network/solutions/laravel)[Django Python web apps, no surprise bills](https://edge.network/solutions/django)[Rails Classic VPS workflow, modern network](https://edge.network/solutions/rails)

## The site you're reading runs on this

Astro on Edge — built, deployed and delivered with the exact stack on this page. Try it.

[Start free](https://edge.network/account) [Talk to an engineer](https://edge.network/contact)
