Show HN: Deploy Next.js to AWS
54 points| jayair | 4 years ago
We are the founders of SST, an open source framework that makes it easy to build serverless apps on AWS: https://github.com/serverless-stack/serverless-stack
We found that many people in the community were looking for a better way to deploy Next.js apps to their own infrastructure and they were unhappy with the options. These were not easy to customize (Amplify Next.js) or would pass your code and credentials via a 3rd party service (Serverless Next.js component). So we decided to fix it.
There are a couple of things to note, specifically the AWS integration.
- Completely open source and free
- Deploys directly to your AWS account
- Import environment variables from your AWS services
- Easily manage permissions to your AWS resources
- Works with any CI service, supports PR/preview deployments
- Uses AWS CDK to define your infrastructure as code
We wrote about how to get started and compared the various deployment options: https://serverless-stack.com/examples/how-to-create-a-nextjs-app-with-serverless.html. You can also check out the docs: https://docs.serverless-stack.com/constructs/NextjsSite
We'd appreciate if you took it for a spin and gave us some feedback!
leerob|4 years ago
To make sure I'm understanding SST, it builds off serverless-nextjs[3], correct? And then ads the features listed above on top, most notably CDK support?
[1]: https://nextjs.org/docs/deployment#nodejs-server
[2]: https://nextjs.org/docs/deployment#docker-image
[3]: https://github.com/serverless-nextjs/serverless-next.js
jayair|4 years ago
It's pretty much to run it on serverless infrastructure as opposed to on containers. And to take advantage of Lambda@Edge.