This is a minimal Next.js app prepared for deployment on AWS Elastic Beanstalk (EB) using the Node.js platform.
- Pages Router (pages/)
- MUI baseline in
_app.js - SSR test on
/viagetServerSideProps - Procfile to bind EB-provided
$PORT postinstallbuilds on EB.ebignoreto reduce bundle size
npm install
npm run dev
# visit http://localhost:3000Production-mode sanity check:
npm run build
PORT=3000 npm run startpip install --user awsebcli
# ensure ~/.local/bin is on PATH
# from next-app directory
eb init
# select region and Node.js 20 (or 18) on Amazon Linux 2023
eb create my-next-env --single
# wait for green status
eb deploy- Client-visible vars must be prefixed with
NEXT_PUBLIC_. - Server-only secrets should NOT be prefixed.
- Set vars in EB using
eb setenv NAME=value.
- Health check path
/returns 200 by default. - If you later add Amplify/Auth, add your EB URL to Cognito callback URLs.