DEV Community

Cover image for Creating an Amazon EC2 Instance
     Faith Aneke Ada
Faith Aneke Ada

Posted on

Creating an Amazon EC2 Instance

đź’» INTRODUCTION

Amazon Elastic Compute Cloud (EC2) is a web service that provides resizable compute capacity in the cloud.It also lets you launch virtual servers in the cloud.It provides flexible computing resources to run applications, host websites, or perform tasks without physical hardware.
This procedure shows how to create and access an EC2 instance.

đź”’ IMPLEMENTATION STEPS

How to Create an EC2 Instance

đź”— Objective

To launch and configure a virtual server using Amazon Elastic Compute Cloud (EC2) for running applications in the cloud.

⚙️ Materials/Requirements

•AWS account with appropriate permissions
•Internet access
•SSH client (for Linux) or RDP (for Windows)
•Key pair for secure login

🛠️ Procedure

1.Login to AWS
•Open the AWS Management Console.
•Navigate or search for EC2 under the “Compute” section and select.
Search EC2

2.Launch an Instance
•Click “Launch Instance”.
Launch instance

•Give your instance a name for easy identification.
Instance name

•Select an Amazon Machine Image (AMI) (e.g., Amazon Linux 2, Ubuntu, Windows Server).
image

3.Select an existing key pair or create a new one.
new key pairs

•If you are creating a key-pair ,give it a name (e.g., Name: Adaorakey)and create key.
name the keypair

4.Click “Launch Instance” to start your EC2 instance.
Launch Instance

5.Connect to Your Instance
i.By clicking “connect to instance”(Browser SSH):
select instance

ii.Then click “Connect”, (browser-based SSH).
click connect

iii.A black terminal window will appear in your browser.
black window

iv.Once connected, type:
“sudo su”
Type Sudo su

•This switches you to the root user, giving full administrative privileges.

V.You can now run commands and configure your instance as needed.

📝 Note:

For Windows instances, you would still use RDP via the Connect button and your key pair.

👩‍💻 Results/Expected Outcome

•A running EC2 instance visible in the EC2 dashboard.
•Ability to securely connect to the instance via SSH or RDP.
•Instance can host applications, web servers, or databases as configured.
•Billing begins only while the instance is running (stop when not in use to save cost).

📝 Notes/Best Practices

•Always use a secure key pair; never share your private key.
•Tag instances for easy identification in large environments.
•Stop or terminate instances when not needed to avoid unnecessary charges.

Top comments (0)