Recommended Node.js app basics:
- Ensure
package.jsonincludes astartscript that launches your server, e.g."start": "node index.js". - Have your server listen on port
3000(or the port your EB configuration expects).
1 — Create an Elastic Beanstalk application and environment
- In the AWS Console, search for Elastic Beanstalk.
- Create a new application (example name:
nodejs-app) and optionally add a description and tags. - Create a new environment. For this demo select:
- Environment tier: Web server
- Platform: Node.js (choose the version matching your app)
environment-prod) and select the Node.js platform version that matches your runtime.

2 — Prepare and upload your application bundle (zip)
Elastic Beanstalk expects an application source bundle as a zip file. Include all application files, e.g.package.json, index.js, public/ or views/, and any static assets.
Common packaging methods:
- macOS / Linux:
- Windows: right-click the project folder and choose an archive/zip option to create
eb-demo-v1.zip.


1.0.0 before continuing.
3 — Service role, instance profile, and key pair
Elastic Beanstalk requires an IAM service role to operate. If you don’t have one, choose “Create and use new service role” to let Beanstalk provision it automatically. Also select an EC2 key pair if you need SSH access to the instances for debugging.
4 — Networking and subnets
Choose the VPC and subnets where the environment will be deployed. Typical pattern:- ALB in public subnets (internet-facing)
- EC2 application instances in private subnets

5 — Instance volumes and monitoring
Adjust root volume size, IOPS, and enable CloudWatch monitoring if required. Defaults are sufficient for small demos, but increase disk and monitoring for production workloads.
6 — Security groups and Auto Scaling
Attach security groups to the EC2 instances and configure Auto Scaling settings. For load-balanced environments, set a minimum and maximum instance count (e.g., min 1, max 4) and define scaling policies based on CPU/load metrics.
7 — Architecture, instance types, and AMI
Choose instance architecture, instance types (for example,t3.micro, t3.small), and the AMI. Elastic Beanstalk typically uses Amazon Linux 2 for the Node.js platform — suitable for most use cases.

8 — Load balancer settings
For internet-facing apps, place the ALB in public subnets. Configure listeners: ALB listens on port 80 and forwards to the instance port where your app runs (port 3000 in this demo). Set the target process (commonlydefault) mapped to the application process listening on port 3000.

9 — Monitoring, updates, and deployments
Elastic Beanstalk supports multiple deployment policies. Choose the one that fits your availability needs:
For this demo, use a rolling deployment and configure batch size and update behavior.


Rolling deployments reduce downtime by updating instances in batches. If your environment has minimal capacity, ensure the batch size is small enough to keep at least one healthy instance serving traffic.
10 — Review and create environment
Review all configuration settings (service role, networking, scaling, load balancer, etc.) and create the environment. Elastic Beanstalk will provision resources and deploy your application version. This may take several minutes.
Creating an environment typically takes several minutes. Monitor the environment health in the Elastic Beanstalk console; green health indicates the environment is serving traffic successfully.
11 — Verify the deployed environment and AWS resources
When the environment status is healthy (green), open the environment URL from the Elastic Beanstalk console to confirm the app is running. Check the following resources in the EC2 and other AWS consoles:- Instances — EC2 instances created for the environment and the running application.
- Load Balancers — ALB created with listeners forwarding port 80 to target port 3000.
- Target Groups — targets (instances) registered on port 3000.
- Auto Scaling groups — manages instance count for the environment.
12 — Update and redeploy your application
To deploy a new version:- Update application files (for example, change the page header to indicate v2).
- Create a new zip (e.g.,
eb-demo-v2.zip) with the updated content. - In the Elastic Beanstalk environment page click Upload and Deploy, select the new zip, provide a version label (for example,
1.0.1), choose the deployment policy (rolling recommended), and deploy.
index.html for a v2 update:
index.js server (ensure package.json uses "start": "node index.js"):
1.0.1) and maintain healthy status.


If you choose “All at once” for deployments, all instances receive the new version at the same time — this can cause service interruption for users. Use rolling or rolling with additional batch for safer updates when uptime is important.
Conclusion
You have deployed a Node.js application to AWS Elastic Beanstalk, configured networking, scaling, and monitoring, and performed an application update. Elastic Beanstalk offloads environment management so you can focus on application development and iteration. Links and References- AWS Elastic Beanstalk Developer Guide
- Elastic Beanstalk Node.js Platform
- Amazon EC2 Auto Scaling
- Application Load Balancer Overview