How to connect Elastic Beanstalk instance via SSH

- Advertisment -
- Advertisement -

The easiest method to connect and manage Amazon (AWS) Elastic Beanstalk instances via SSH Command line from Windows, Linux or macOS.

Elastic Beanstalk is one of the many services provided by Amazon Web services (AWS). It is meant to provide a cloud platform where administrators and developers can easily deploy their codes or apps with automation.  It provides scalability, monitoring, supports to Go, Java, .NET, Node.js, PHP, Python, and Ruby.

We already have done a tutorial where we had discussed the way to install WordPress on AWS Elastic Beanstalk. While implementing any project on Beanstalk, we definitely get a situation where we need to connect Elastic Beanstalk instance command line. Although we can use AWS official EB CLI tool that one needs to set up to connect Beanstalk. We tried to use that and it was cumbersome for use, thus we decided to use SSH to connect Elastic Beanstalk. Here we have explained the same step by step, in case someone wants to try it out.

1: Go to Elastic Beanstalk EC2 Instance

I am assuming that you already have created or in the process of creating an environment for your Beanstalk app. So, to use SSH, first, we need to create a private key. That will use to authenticate the instance from a remote SSH tool like putty.

Go to EC2 Home, on the left side pane scroll down to find out Network & Security services. Click on Key Pairs option given under that.

Create a key pari for Elastic Beanstalk

2: Creating a Private key for SSH

On the Key Pairs page, you will see an option “Create Key Pair” click on that.

Create Key Pair

Give some name to your Key. It could be anything you want. Here we are giving it a name: H2stestkey

key pair name

The moment you will click on the Create button, a pop-up will appear to download the created private key on your local system. Store it somewhere safe because we are going to use it later to connect to BeanStalk.

3: Access BeanStalk environment Configuration

Security settings of BEanstalk envrioenment

Now, go to Elastic Beanstalk and click on your created App’s environment, on the left side of that you will see an option called Configuration. Scroll and find out Security Category and there will be a Modify button just exactly in front of that. Click on that to modify its settings.


4: Attach Private Key pair to Elastic BeanStalk Instance

Select the created Private key from the Drop-down box of EC2 Key pair and then click on Apply.

Note: If you are trying to attach a key to some already existing EC2 Beanstalk instance, the settings will not take effect immediately. Each of your existing EC2 instances will be replaced and your new settings will take effect then.

Attach private key to EC2 Beanstalk instance

5. Connect Elastic Beanstalk via SSH

Now again go to EC2 instance home page where you have created Key pairs and this time from left side panel select Instance option.

Instances EC2

On the right side, you will see all your running instance; select the one which is being in use by Beanstalk. Select that and click on the Connect button.

SSH connect Beanstalk using putty

You can use EC2 Instance browser-based SSH connection, however, it didn’t work for us, thus we used our local application called MobaXtream, one of the best apps to connect server via SSH.

You can use any other app like Putty or simply your Command Terminal or prompt to connect Beanstalk.

Username, for Instance, is- ec2-user

Port is: 22

Hostname: Mentioned on the pop-up when you click on the Connect button, as shown in the above screenshot.

Connect SSh using MobaXterm

SSH connection to AWS elastic Beanstalk 2


Sarbasish Basu
From B.Tech (Hons.) Electronics & Instrumentation Engineer to Photography and Writing blogs; he ultimately has answers to everything. Oh, and he's also quite good in rapidly building a relationship and set up the trust; his articles are proof of that...


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Posts

Zebronics launches ZEB-Juke Bar 9000 sound bar with Dolby Digital Plus

Zebronics that has been working in the audio industry for a very long time recently has launched its new...

List of Best SQL Server Monitoring Tools with free trial in 2020

Monitoring database server not only for SQL but all kind of database systems is really a crucial task and need...

How to run Chrome extensions on Microsoft Edge Chromium browser

It is long since we know about Microsoft Edge, which is Microsoft's endeavour to dominate the market of browsers....

How to get dark mode on WhatsApp to keep eyes stress free

WhatsApp keeps adding new features to the app, and most features turn out to be useful for us, except...
- Advertisement -

73% of software developers willing to invest Rs 10-20k per year for upskilling

The rapid development in the technology area is compelling the firms and developers to gear up their technology skills...

Sony accidentally confirmed a massive News leak on PS5

The PlayStation 5 launch is just around the corner. Also, the rumours are about an upcoming meeting of Sony...

- Advertisment -
- Advertisement -

You might also likeRELATED
Recommended to you