DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk6 min

How to Host a Static Next.js Site on S3 and CloudFront

A Next.js app can run from S3 and CloudFront only if its needed behavior can be generated as static files. Here’s the export workflow, secure origin choice, Amplify alternative and current CloudFront Free plan allowances.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To host a Next.js site on Amazon S3 and CloudFront, first confirm it works as a static export: the pages and assets must be generated at build time, without request-time server features. Configure Next.js with output: 'export', build the project, and publish the generated out directory to S3 behind CloudFront. That can be inexpensive, but “for pennies” is not a guaranteed bill. AWS lists a CloudFront Free flat-rate plan at $0 per month with usage allowances; your architecture, traffic, region and other services still affect the cost.

The practical question is: how do I host a Next.js static site on S3 and CloudFront, and what will it cost? The steps below cover the eligibility check, deployment shape, security choice and managed alternative.

As an Amazon Associate I earn from qualifying purchases.

Check whether your Next.js app can be exported as static files

Static export works when the site can be represented by files produced during a build. Next.js documents static exports as suitable for web servers that serve HTML, CSS and JavaScript, including Amazon S3. Its current configuration is output: 'export'; running next build creates the deployable files in an out directory. Next.js 14 removed the older next export command. See the Next.js static export documentation.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before changing deployment platforms, check every feature your app uses against the framework’s export limitations. Static storage cannot run server code or make pages dynamic at request time. Next.js lists API routes, rewrites, redirects, headers, middleware, ISR, Draft Mode, default image optimization and getServerSideProps among the features not supported in a static export. Dynamic routes that depend on fallback modes are also restricted. Consult the Next.js feature limitations and determine whether any unsupported behavior can be removed, moved to a separate service or replaced.

  • Static export is a fit: pages and assets can be generated at build time, and the site does not rely on unsupported request-time behavior.
  • Static export is not a drop-in replacement: the app needs server rendering, API routes or other unsupported features at runtime. Use a server-capable platform or redesign those parts before deploying to S3.

Build and deploy the static output

For an eligible app, the deployment sequence is straightforward. AWS documents S3 with CloudFront and origin access control as a secure static-site pattern, but your domain, routing, error handling and cache settings still need to match the site.

  1. Check compatibility. Review the app’s routes and features against the Next.js static export limitations before relying on a static deployment.
  2. Enable export. Add output: 'export' to next.config.js, following the current Next.js configuration guidance.
  3. Build for production. Run next build. Next.js generates the static site in out, including route HTML and static assets.
  4. Publish the generated files. Upload the contents of out to an S3 bucket. Plan how changes will be deployed repeatedly rather than treating the initial upload as the whole deployment process.
  5. Put CloudFront in front of the bucket. Configure CloudFront to serve the S3 origin. For a private origin, follow AWS’s secure static website pattern using origin access control.
  6. Verify the live site. Test the home page, nested routes, assets and error behavior through the CloudFront URL or domain. Check that updated files appear as expected under your chosen caching configuration.
  7. Automate release and cache handling. Choose a repeatable upload or build deployment process and decide how CloudFront’s cached copies will be refreshed when files change.

Static hosting serves generated files; it does not make a Next.js app’s server-dependent routes work. Also, cache policy and invalidation details depend on your deployment, so do not assume that uploading a new build alone guarantees every visitor immediately receives every changed object.

Keep the S3 origin private where appropriate

An S3 website endpoint configured for public access and a private S3 bucket served through CloudFront are different architectures. In AWS’s secure pattern, CloudFront uses origin access control to retrieve objects from the bucket, so visitors use CloudFront rather than accessing the bucket directly. AWS explains this approach in its secure static website guide. Do not make a bucket public by default just to serve a site; choose the access model deliberately and follow the AWS configuration for that architecture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose between direct S3 and CloudFront or Amplify Hosting

Direct S3 and CloudFront gives you control over the storage and delivery architecture, but you configure and maintain more of the pieces yourself. AWS recommends Amplify Hosting for static website content stored in S3. Amplify is a managed hosting option with CloudFront-backed delivery, HTTPS, custom domains, monitoring, password protection, and redirects and rewrites, billed under Amplify’s pricing model. See AWS guidance for hosting S3 website content with Amplify.

Consideration S3 and CloudFront directly Amplify Hosting
Static versus SSR Suitable for static output; S3 does not run Next.js server code. Static hosting is available; AWS documents Next.js SSR support through Next.js 15, including features such as image optimization and middleware. Check current version and feature support in AWS’s support documentation.
Infrastructure setup You configure the bucket, CloudFront distribution, access, routing and cache behavior. Managed hosting handles more of the hosting workflow and includes documented features such as HTTPS, custom domains and monitoring.
Deployments You arrange how build output is uploaded and how cached content is refreshed. Offers a managed deployment path. If the site is deployed from S3, changes to S3 objects are not automatically detected; AWS says a redeployment is required for those changes to take effect. See the S3-to-Amplify update procedure.
Routing and redirects You configure the behavior needed for the site’s routes and errors. AWS lists redirects and rewrites among Amplify Hosting features.
Cost model Depends on the selected CloudFront pricing arrangement and the usage and services in your architecture. Uses Amplify’s pricing model; check current pricing against your expected usage.
Availability and feature fit Check the AWS service and feature availability for your chosen region and architecture. Check Amplify’s current regional availability and whether its documented Next.js support covers the framework version and features you need.

If you need Next.js server-side rendering rather than static output, Amplify may be a better fit than static S3 hosting: AWS documents Amplify Hosting support through Next.js 15, including SSR. That is a version- and feature-specific statement, not a guarantee that every future Next.js release or feature is supported. Check the current Amplify Next.js support documentation before choosing.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What “for pennies” can—and cannot—mean

As listed on AWS’s current pricing page checked October 5, 2026, the CloudFront Free flat-rate plan costs $0 per month and includes 1 million requests, 100 GB of data transfer per month, and 5 GB of S3 storage. AWS announced the flat-rate plans on November 18, 2025. The live terms are on CloudFront pricing; the announcement date is documented in AWS’s plan announcement.

These are plan usage allowances, not a prediction that every site’s total AWS bill will be zero or only a few cents. AWS says usage can be monitored in the CloudFront console; see its flat-rate plan documentation. The CloudFront allowance does not establish whether a particular setup’s S3 use, domain registration, deployment pipeline, logs or other selected services will cost extra.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Estimate expected monthly requests and data transfer rather than assuming your site will stay within plan allowances.
  • Check the current CloudFront plan terms and AWS pricing for the region and architecture you intend to use.
  • Account separately for services and costs not established by the CloudFront allowance, including your domain and any chosen deployment or logging services.
  • Compare the relevant Amplify charges if you prefer managed hosting; its billing follows Amplify’s pricing model.

Because traffic, region, object size, domain and deployment choices vary, there is no reliable universal monthly total for “a Next.js site on S3 and CloudFront.” Use the live pricing pages or AWS calculator for your own configuration.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.