Deploying applications in the cloud can sometimes feel overwhelming, especially when you have to manage servers, scaling, monitoring, and security on your own. This is where AWS Elastic Beanstalk comes in.
AWS Elastic Beanstalk is a service that makes it easy to deploy, manage, and scale applications on AWS without worrying about the underlying infrastructure. You simply upload your application, and Elastic Beanstalk automatically handles the setup and management for you.
Elastic Beanstalk supports popular platforms such as:
- Java
- .NET
- Node.js
- Python
- PHP
- Ruby
- Docker
How AWS Elastic Beanstalk Works
When you deploy an application using Elastic Beanstalk, AWS automatically provisions and manages the required resources, including:
- Amazon EC2 instances
- Load balancers
- Auto Scaling groups
- Monitoring and health checks
Although Elastic Beanstalk manages these resources for you, you still have access to them if you need more control.
Benefits of AWS Elastic Beanstalk
Some key benefits include:
- Easy deployment – Upload your application and let AWS handle the rest
- Automatic scaling – Your application scales up or down based on traffic
- Cost-effective – You only pay for the AWS resources used
- Less infrastructure management – Focus more on development, less on servers
- Flexible control – You can customize settings when needed
AWS Elastic Beanstalk vs Amazon EC2
A simple way to understand the difference:
Amazon EC2:
You are responsible for managing servers, updates, scaling, and monitoring.AWS Elastic Beanstalk:
AWS manages the infrastructure, while you focus on your application.
Elastic Beanstalk actually runs on EC2, but it removes the complexity of managing everything manually.
When Should You Use AWS Elastic Beanstalk?
AWS Elastic Beanstalk is a good choice if:
- You want a fast and easy way to deploy applications
- You do not want to manage servers directly
- You are new to AWS and want a simpler starting point
- You need automatic scaling and monitoring
Here is a Step-by-Step Guide to Creating an AWS Elastic Beanstalk Application
Step 1: Sign in to the AWS Management Console
Go to the AWS Management Console and sign in with your AWS account.
Step 2: Navigate to Elastic Beanstalk
- In the AWS search bar, type Elastic Beanstalk
- Click Elastic Beanstalk from the services list
Step 3: Create a New Application
- Click Create application
- Enter an Application name (for example:
getting-started-app) - (Optional) Add a description
Step 4: Choose Your Platform
-
Under Platform, select the programming language your app uses
Examples:- Node.js
- Python
- PHP
- Java
- .NET
Choose the platform version (you can leave the default)
Step 5: Upload Your Application Code
-
Under Application code, choose:
- Sample application (recommended for first-time users),
or
-
Upload your code (if you already have an app)
- If uploading your code, select your file (ZIP format)
Step 6: Configure Application Settings (Service Role, Instance Profile, and Key Pair)
Before creating the environment, you need to configure security and access settings so Elastic Beanstalk can manage AWS resources and you can securely access your EC2 instances.
Step 6.1: Configure the Elastic Beanstalk Service Role
The service role allows Elastic Beanstalk to interact with other AWS services on your behalf.
To configure service access
Next, you need two roles. A service role allows Elastic Beanstalk to monitor your EC2 instances and upgrade your environment’s platform. An EC2 instance profile role permits tasks such as writing logs and interacting with other services.
- To create or select the Service role If you have previously created a Service role and would like to choose an existing one, select the value from the Service role drop-down and skip the remainder of these steps to create a Service role.
If you don't see any values listed for the Service role, or you'd like to create a new one, continue with the next steps.
For Service role, choose Create role.
For Trusted entity type, choose AWS service.
For Use case, choose Elastic Beanstalk – Environment.
Choose Next.
Verify that Permissions policies include the following, then choose Next:
AWSElasticBeanstalkEnhancedHealth
AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy
Choose Create role.
Return to the Configure service access tab, refresh the list, then select the newly created service role.
Step 6.2 To create or select an EC2 instance profile
The EC2 instance profile allows EC2 instances in your environment to access AWS services securely.
If you have previously created an EC2 instance profile and would like to choose an existing one, select the value from the EC2 instance profile drop-down and skip the remainder of these steps to create an EC2 instance profile.
If you don't see any values listed for EC2 instance profile, or you'd like to create a new one, continue with the next steps.
Choose Create role.
For Trusted entity type, choose AWS service.
For Use case, choose Elastic Beanstalk – Compute.
Choose Next.
Verify that Permissions policies include the following, then choose Next:
AWSElasticBeanstalkWebTier
AWSElasticBeanstalkWorkerTier
AWSElasticBeanstalkMulticontainerDocker
Choose Create role.
Return to the Configure service access tab, refresh the list, then select the newly created EC2 instance profile.
To finish configuring and creating your application
Step 6.3: Select a Key Pair
A key pair allows you to securely connect to the EC2 instances created by Elastic Beanstalk.
Search for key pair
Under EC2 key pair: Select an existing key pair, or Click Create a new key pair

Download and store the key file securely
Without a key pair, you will not be able to connect to the EC2 instance using SSH.
Optional steps: networking, databases, scaling parameters, advanced configuration for updates, monitoring, and logging.
On the Review page, which shows a summary of your choices, choose Submit.
Step 6.4: Review Other Settings (Optional)
You can keep the default settings for now or adjust them if needed:
- Instance type (EC2 size)
- Auto scaling options
- Environment variables
- Security groups
Beginners can safely proceed with the default configuration.
Step 7: Create the Environment
- Click Create application
-
AWS will automatically set up the required resources, including:
- EC2 instances
- Load balancer
- Auto Scaling group
- Monitoring and health checks
This process may take a few minutes. Once complete, your application will be live.
And your Beanstalk is LIVE
To access the EC2 created
On the AWS Console, search EC2
** Check the dashboard to confirm the instance status is running
Click on the App created and then connect
And here is the EC2 instance that was created while setting up the Elastic Beanstalk
S3 Bucket created
Auto Scaling group created
Step 8: Terminate the Application
** To stop billing: Terminate the environment when you’re done
To delete the application and all associated resources
Delete all application versions.
Open the Elastic Beanstalk console, and in the Regions list, select your AWS Region.
In the navigation pane, choose Applications, and then choose getting-started-app.
In the navigation pane, find your application's name and choose Application versions.
On the Application versions page, select all application versions that you want to delete.
Choose Actions, and then choose Delete.
Turn on Delete versions from Amazon S3.
Choose Delete, and then choose Done.
Terminate the environment.
In the navigation pane, choose getting-started-app, and then choose GettingStartedApp-env in the environment list.
Choose Actions, and then choose Terminate Environment.
Confirm that you want to terminate GettingStartedApp-env by typing the environment name, and then choose Terminate.
Delete the getting-started-app application.
In the navigation pane, choose the getting-started-app.
Choose Actions, and then choose Delete application.
Confirm that you want to delete getting-started-app by typing the application name, and then choose Delete.
Conclusion
AWS Elastic Beanstalk simplifies application deployment by handling infrastructure management for you behind the scenes. It is a great option for developers who want the power of AWS without the complexity of managing servers manually.










































Top comments (0)