Skip to content

For Astro

Astro sites, served from the edge

Build to dist/, sync it to a bucket and serve it from 988 locations with no origin server. When a route needs to run on demand, add the Node adapter on a small VM.

Free to sign up. No egress fees on any product.

Why Astro on Edge

Content-first sites deserve a content-first host

Most Astro pages are HTML by the time they ship. Serve them from a bucket and the edge, and only run a server where you really need one.
  • 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

Prerendered pages come straight from a bucket. Routes that opt out of prerendering run on the Node adapter. For a fully static site, leave the VM out.
  • 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

The first three steps are the whole story for a static site. Steps four and five are there when you need them.
  1. 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/
  2. 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
  3. 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.yml
    on:
      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
  4. 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.ts
    import 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
  5. 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.

The bucket and the CDN do nearly all the work. Add a VM only for the routes that genuinely need one.
  • 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
See compute pricing

Estimated monthly bill on Edge

Docs and marketing site · ~1M page views · 8.5M requests · a few on-demand routes

USD
  • 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
Total$21.39

FAQ

Astro on Edge, answered

Something else? Ask an engineer.
Static-only or server-rendered?
Either. A static build needs only a bucket and a CDN deployment. Routes that set prerender = false need the Node adapter on a small VM, and the CDN still serves everything static.
How do I deploy from CI?
Build in your CI, run edge storage sync --delete ./dist <bucket>/, then edge cdn purge. Or use aws s3 sync with --endpoint-url https://storage.edge.network if you'd rather stick with the AWS CLI.
Does Astro's <Image /> component work?
Yes. Register a small external image service that builds CDN URLs with width, height, quality and format parameters. You keep the component API, and transforms happen at the edge.
Do clean URLs and trailing slashes work?
Yes. The CDN serves index.html for directory paths, so /guides/ returns /guides/index.html from the bucket without any rewrite rules.
Can I host a preview per branch?
Yes. Sync each branch build to its own bucket, add a preview hostname to the CDN deployment, and remove both when the pull request closes. The first two buckets are free.

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.