> For the complete documentation index, see [llms.txt](https://stakpak.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stakpak.gitbook.io/docs/archive/deploy-nextjs-app-to-aws-with-opennext.md).

# Deploy NextJS App to AWS with OpenNext

## Overview

Most teams start by deploying their Next.js apps to **platforms like Vercel or Amplify** because it’s fast but that simplicity comes with limits. When you need deeper control over caching, scaling, or compliance, those platforms quickly become bottlenecks.\
\
The **OpenNext + AWS + IaC** offers the same developer experience, but with full control of infrastructure, cost, and performance.\
\
Using Stakpak’s **Next.js AWS Deployment Rule Book**, you can deploy production ready Next.js workloads on AWS

## Problem

### Business Impact

*

## How Stakpak Helps?

## Step-by-Step Guide

### Prerequisites

1. [Install Stakpak](/docs/get-started/install-stakpak.md)
2. Cloud provider credentials configured

Now we can start

1. Open your terminal.
2. Open Stakpak by typing `stakpak`
3. Then just ask it to "Deploy this next js app using open next in aws"

<figure><img src="/files/jXtGkVDl3HnUv8TUP333" alt=""><figcaption></figcaption></figure>

Here, stakpak made a to do list for what it's going to work on&#x20;

<figure><img src="/files/4XcgeBF5jwdaWgBdGOT3" alt=""><figcaption></figcaption></figure>

## Extra Resources:

### References

* [Install Stakpak](/docs/get-started/install-stakpak.md)
* [Next.js AWS Deployment Options Comparison](/docs/how-it-works/rulebooks/next.js-aws-deployment-options-comparison.md)
* [Next Js Documentation](https://nextjs.org/docs)
* [Open Next Documentation](https://opennext.js.org/)
* [AWS Pricing Documentation](https://aws.amazon.com/pricing/)
* [AWS Amplify Documentation](https://docs.aws.amazon.com/amplify/)
* [AWS Lambda Documentation](https://docs.aws.amazon.com/lambda/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://stakpak.gitbook.io/docs/archive/deploy-nextjs-app-to-aws-with-opennext.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
