← Back to Blog
AWSNext.jsDevOps

Deploying Next.js on AWS the Right Way in 2026

Daniel Casale · March 7, 2026 · 9 min read

The Problem

Next.js is the dominant React framework and AWS is the dominant cloud platform, but getting them to play nicely together is still harder than it should be. Vercel makes deployment trivial, but many companies need (or want) to run on AWS for compliance, cost, or integration reasons.

After deploying Next.js to AWS for dozens of clients, here is what we have learned about each approach.

Option 1: AWS Amplify Hosting

Best for: Marketing sites, blogs, simple apps without complex backend requirements.

Amplify Hosting has gotten significantly better. It supports App Router, server components, and ISR. Deployments are git-push simple.

Pros:

Cons:

Our take: Great for getting started fast. We use it for client marketing sites and internal tools. Not ideal for high-traffic apps where you need fine-grained control over caching and compute.

Option 2: ECS Fargate with CloudFront

Best for: Production SaaS applications that need reliability, scalability, and full control.

This is our default recommendation for serious production apps. You run Next.js as a Docker container on ECS Fargate, put CloudFront in front for caching and edge distribution, and use ALB for load balancing.

Pros:

Cons:

Our take: This is what we deploy for 80% of our SaaS clients. The operational overhead is minimal once the infrastructure is templated, and the reliability and performance are worth it.

Option 3: Lambda@Edge / CloudFront Functions

Best for: Static-heavy sites that need occasional server-side logic at the edge.

Pros:

Cons:

Our take: We rarely recommend this for full Next.js apps. It works for specific use cases like A/B testing at the edge or geolocation-based routing, but trying to run a full Next.js app on Lambda@Edge is fighting the platform.

Our Standard Stack

For most clients, we deploy:

The entire stack is templated. We can spin up a new environment in under an hour.

The One Thing Everyone Gets Wrong

Caching. Most teams either cache nothing (slow and expensive) or cache everything (stale data and bugs). The right approach is:

  1. Static assets get long cache TTLs with content hashing
  2. Server-rendered pages get short TTLs (60-300 seconds) with stale-while-revalidate
  3. API routes are not cached at the CDN level unless explicitly designed for it
  4. Use CloudFront cache policies - do not rely on Next.js headers alone

Get this right and your AWS bill drops by 30-50% while your site gets faster. For a deeper dive on reducing your cloud spend, check out our AWS Cost Optimization guide.

If you are running Next.js on AWS and fighting performance or cost issues, reach out - or learn more about our AWS cloud consulting and migration service. We have probably seen your exact problem before.

Want to Talk About Your Project?

We write about what we do every day. If any of this resonates, let's chat.

Book a call See pricing