For Astro
Astro sites, served from the edge
Free to sign up. No egress fees on any product.
Why Astro on Edge
Content-first sites deserve a content-first host
Static-first delivery
Build to dist/, sync it to Edge Storage and put the CDN in front. Most pages never touch a server at all.On-demand routes when you need them
Set prerender = false on the routes that need it and run @astrojs/node on a small VM. Everything else stays static.<Image /> without the meter
A small external image service points astro:assets at the CDN. Resize, crop and AVIF/WebP from the URL, with no per-image fee.Global CDN, zero egress
Every page and _astro/ asset is cached in 988 locations. A launch-day spike never becomes a bandwidth invoice.CI-friendly deploys
Build in GitHub Actions, sync the bucket with the Edge CLI, purge the CDN. A few lines of YAML and no lock-in.SSL, handled
Add your domain and a Let's Encrypt certificate is issued and renewed for you. No certbot, no expiry reminders.
Reference architecture
How Astro maps to Edge
Readers
resolved by Edge DNS
docs.acme.dev
prerendered pages + _astro/*
app.acme.dev
on-demand routes, not cached
acme-docs
dist/ from astro build
dist/server/entry.mjs
@astrojs/node · optional VM
- Storage
Holds the built dist/ bundle and any uploaded media.
- CDN
Serves the whole static build worldwide, with zero egress fees.
- Compute
Optional: runs Astro's Node adapter for on-demand routes.
- Image optimisation
Backs <Image /> through an external image service: resize, crop, AVIF/WebP.
- DNS
Anycast DNS for the apex, www and preview hostnames.
- Shield
Guards newsletter and contact forms without a CAPTCHA bundle.
- Assist
Answers visitor questions from the pages Astro already renders.
Deploy
From astro build to live in five steps
- 01
Build and sync to a bucket
The CDN serves index.html for directory paths, so Astro's default directory output works as-is.
shell$ npx astro build $ edge storage create acme-docs $ edge storage sync --delete ./dist acme-docs/ - 02
Serve the bucket through the CDN
Point the domain's CNAME at cdn.edge.network. A certificate is issued within about a minute.
shell$ edge cdn create --name acme-docs $ edge cdn domains add cdn-7a19f2 \ --domain docs.acme.dev \ --origin-type storage \ --storage-bucket acme-docs \ --jit-image - 03
Deploy on every push
Build, sync, purge. The CLI reads EDGE_API_KEY from the environment, so a dedicated CI key is all it needs.
.github/workflows/deploy.ymlon: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npm ci && npx astro build - run: curl -fsSL https://edge.network/install.sh | sh - env: EDGE_API_KEY: ${{ secrets.EDGE_API_KEY }} run: | edge storage sync --delete ./dist acme-docs/ edge cdn purge cdn-7a19f2 - 04
Point <Image /> at the CDN
Register this as image.service.entrypoint in astro.config.mjs. The <Image /> API stays the same; transforms happen at the edge.
src/edge-image.tsimport type { ExternalImageService } from 'astro' const service: ExternalImageService = { getURL(options) { const { src: img } = options const src = typeof img === 'string' ? img : img.src const q = new URLSearchParams({ format: 'auto', quality: '75' }) if (options.width) q.set('width', String(options.width)) if (options.height) q.set('height', String(options.height)) return `https://docs.acme.dev${src}?${q}` }, } export default service - 05
Optional: add on-demand routes
Pages with export const prerender = false run on a VM. Serve dist/client from the bucket and the server entry from the VM.
shell$ npx astro add node $ edge compute create --name astro-ssr --size s-2vcpu-4gb \ --image ubuntu-24 --region london --script nodejs $ npx astro build $ rsync -a dist/ root@<vm-ip>:/srv/site/ $ ssh root@<vm-ip> "pm2 start /srv/site/server/entry.mjs"
Prefer to hand it off? Give the job to your AI agent or have our engineers do it.
What it costs
Static pages cost pennies. Servers are optional.
- Fully static? Drop the VM and the bill is $2.15
- No build minutes, seats or bandwidth tiers
- Image transforms included with the CDN
- Billed hourly from a prepaid balance, with optional hard caps
Estimated monthly bill on Edge
Docs and marketing site · ~1M page views · 8.5M requests · a few on-demand routes
- Storage$0.1515 GB of build and media: first 5 GB free, 10 GB × $0.015
- CDN$2.008.5M requests: first 500k free, 8M × $0.25 per million
- Compute$19.24Standard VM for on-demand routes · 2 vCPU · 4 GiB
- DNS$0.00Apex, www and preview records
- Egress$0.00
FAQ
Astro on Edge, answered
Static-only or server-rendered?
How do I deploy from CI?
Does Astro's <Image /> component work?
Do clean URLs and trailing slashes work?
Can I host a preview per branch?
Drop-in services
Add these without touching the stack
- Edge ShieldBot protection
POST /siteverify → score: 94Guard newsletter and contact forms with one server-side check. No CAPTCHA bundle on pages you worked hard to keep light.
Free for most sites. No puzzles, no widget to style.Explore - Edge AssistAI answers
<script src="…/assist.js">Content sites are Assist's home ground. It answers from the pages Astro already renders, with one script tag in your base layout.
Free tier: 250 answered questions a monthExplore
Put your Astro site on Edge
A bucket, a CDN deployment and a DNS zone. Add a VM only when a route needs one.
Free tiers hard-cap. Nothing bills until you add a card.