Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A minimal example for deploying a Next.js app on AWS Lambda with Apex Up, including a custom Express server.

A full-stack Next.js TypeScript template focused on functionality over UI, featuring Zustand, TanStack Query, and ESLint 9 support.
This boilerplate repository demonstrates how to deploy a Next.js application to AWS Lambda using Apex Up, complete with a custom Express server and a ready-to-use up.json configuration.
This is a minimal example project created by mattdamon108 that shows how to take a Next.js application and deploy it to AWS Lambda using the Apex Up CLI. It takes a Next.js codebase, adds a custom Express server in server.js, and produces a Lambda-deployable service through a up.json proxy configuration. The repository includes the IAM policy that Up requires, an .upignore rule, and a full up.json with Lambda memory, runtime, and stage settings.
up command creates the AWS resources needed to run the app, based on the IAM policy and up.json included.up.json sets memory to 256 MB (minimum 128 MB), runtime to nodejs8.10, a 25-second proxy timeout, and a 15-second listen timeout.~/.aws/credentials file using the profile field, avoiding hardcoded keys.yarn dev while the default stage runs npm start, giving you parity between local and deployed behavior.This template is aimed at developers who want to run Next.js on AWS Lambda and need a small, working reference rather than a full framework. It suits developers who are new to Apex Up, engineers who need a minimal custom server setup, and anyone who wants to see the exact IAM permissions Up requires to manage Lambda, API Gateway, CloudFront, and related services.
yarn build, create .upignore, and execute up.yarn dev, which runs the custom Express server with hot reloading through Next.js's dev mode, or the development stage in up.json.up.json for your own app's constraints.The workflow is fully documented in the README: install the Up CLI via curl, store AWS credentials in ~/.aws/credentials, attach the provided IAM policy, create an up.json that names your AWS profile and region, then build with yarn build. Because Up ignores dotfiles by default, the example adds an .upignore rule that negates .next so the compiled Next.js output is packaged. Finally, running up provisions the infrastructure and returns your serverless app URL.
Yes, the README instructs you to create an AWS account and set up IAM credentials with programmatic access so Up can deploy resources on your behalf.
The example sets Lambda memory to 256 MB, with a comment noting the AWS minimum is 128 MB and Up's default is 512 MB.
The author links to a separate lambda-warmer repository that keeps functions warm by sending periodic requests, reducing the latency of the first invocation.
Yes, the entire example is based on a custom Express server; you would replace the routes in server.js with your own app's routes.