Skip to content

For Next.js

Self-host Next.js without the lock-in

Run next start on a real VM, cache _next/static across 988 locations and point next/image at on-the-fly optimisation. Everything you'd want from Vercel, minus the per-invocation bill.

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

Why Next.js on Edge

The Next.js you know, on infrastructure you control

Predictable VM pricing, real CPU and memory, and nothing on the invoice that scales with function calls.
  • Standalone or next start

    Build with next build and run the output on any Edge VM. No proprietary runtime, no adapter, no vendor wrapper.
  • next/image without the meter

    A four-line custom loader points next/image at the CDN. AVIF and WebP on the fly, with no per-image fees.
  • S3-compatible storage

    Uploads, ISR snapshots and static overflow live in an Edge Storage bucket. The AWS SDK works unchanged.
  • Global CDN, zero egress

    _next/static and public assets cache in 988 locations. Launch day never shows up as a bandwidth line.
  • Your CI, your way

    Deploy from GitHub Actions, GitLab CI or one SSH command. The Edge CLI and API script everything else.
  • Agent-deployable

    Tell your coding agent to deploy to example.com. The agent API provisions the VM, DNS, CDN and SSL, then reports the cost.

Reference architecture

How Next.js maps to Edge

Four standard products and no glue services. Everything is vanilla Node and vanilla S3, so you can move it any time.
  • Compute

    Runs next start (or your standalone server) on a VM near your users.

  • Storage

    Holds uploads, ISR snapshots and anything too big for the build.

  • CDN

    Caches _next/static, public assets and cacheable route handlers worldwide.

  • Image optimisation

    Backs next/image through a custom loader: resize, AVIF/WebP, fit modes.

  • DNS

    Anycast DNS for the apex, www and preview subdomains.

  • Shield

    Scores signups and form posts from a route handler. No CAPTCHA widget.

  • Assist

    One script tag in the root layout adds answers grounded in your pages.

Deploy

From next build to live in four steps

Standard tooling throughout. Swap the rsync for your CI of choice once it works by hand.
  1. 01

    Build a standalone output

    The standalone build ships its own minimal server, so the VM needs nothing but Node.

    next.config.js
    module.exports = {
      output: 'standalone',
      images: {
        loader: 'custom',
        loaderFile: './edge-loader.js',
      },
    }
  2. 02

    Point next/image at the CDN

    Keep the <Image /> component. The CDN resizes and converts on request, then caches every variant.

    edge-loader.js
    export default function edgeLoader({ src, width, quality }) {
      const q = quality || 75
      return `https://app.acme.com${src}?width=${width}&quality=${q}&format=auto`
    }
  3. 03

    Create a VM and start the server

    The nodejs library script installs Node 22, PM2 and an Nginx reverse proxy on first boot.

    shell
    $ edge compute create --name web --size s-2vcpu-4gb \
        --image ubuntu-24 --region london --script nodejs
    
    $ rsync -a .next/standalone/ root@<vm-ip>:/srv/web/
    $ rsync -a .next/static/ root@<vm-ip>:/srv/web/.next/static/
    $ ssh root@<vm-ip> "cd /srv/web && pm2 start server.js"
  4. 04

    Front it with the CDN

    One deployment, one domain. SSL is issued in under a minute; --jit-image turns on image transforms.

    shell
    $ edge cdn create --name acme-web
    $ edge cdn domains add cdn-a1b2c3 \
        --domain app.acme.com \
        --origin https://<vm-ip> \
        --jit-image

Prefer to hand it off? Give the job to your AI agent or have our engineers do it.

What it costs

The Vercel maths, without the surprises

Once a Next.js app passes a million page views, usage-based platforms turn into four-figure invoices. Here it's a VM, a CDN deployment and a bucket.
  • No per-invocation, per-transform or per-seat lines
  • Image optimisation included with the CDN
  • Billed hourly from a prepaid balance, with optional hard caps
  • Vanilla Node and S3: move providers whenever you like
See compute pricing

Estimated monthly bill on Edge

About 3M page views and 500 GB of images a month, with ISR

USD
  • Compute$38.47Performance VM: 4 vCPU, 8 GiB RAM, 160 GB NVMe
  • CDN$0.633M requests, first 500k free, then $0.25 per million
  • Storage$0.7550 GB of uploads and ISR cache at $0.015/GB
  • DNS$0.00Zone, records and preview subdomains
  • Egress$0.00
Total$39.85

Indicative monthly cost for a medium-traffic Next.js app

  • Vercel Pro + overages~$300–800
  • AWS (EC2 + CloudFront + S3)~$120–250
  • Edge (VM + CDN + Storage)~$30–60

Indicative figures based on public pricing. Run your own numbers on the free tier.

FAQ

Next.js on Edge, answered

Something else? Ask an engineer.
Do server components and server actions work?
Yes. Next.js runs as a normal Node process on an Edge VM, so server components, server actions, middleware and route handlers behave exactly as documented.
What about ISR and on-demand revalidation?
Built-in ISR works out of the box on a single VM. Across several VMs, persist the cache to Edge Storage with a custom cache handler, or call your revalidate endpoint from a CI step.
Can I use next/image without paying per transform?
Yes. Configure a custom loader that points at the CDN. You keep the <Image /> component and get resizing and AVIF/WebP conversion at CDN prices, with no per-image fee.
How do preview deployments work?
Spin up a small VM per branch from CI, point a test.network subdomain at it and tear it down when the pull request closes. The Edge CLI and agent API make that a few lines of YAML.
Can I move from Vercel without downtime?
Yes. Run the app on Edge alongside Vercel, test it on a staging hostname, then switch the DNS record. Our Expert Services team can run the migration for you.

Ship Next.js on your terms

Bring an existing app or start from scratch. Keep the framework, lose the per-invocation bill.

Free tiers hard-cap. Nothing bills until you add a card.