AWS Basics for DevOps: Complete Step by Step Guide to Setup Linux Machine
By Braincuber Team
Published on March 23, 2026
To create an application like WhatsApp or Facebook, you'd need many servers (30-40), operating system licenses, routers, cables, switches, gateways, air conditioning units, and employees for maintenance. All this can be expensive and time-consuming, and there is no guarantee that the application will be successful in the market.
But by using cloud services like AWS, you can avoid the upfront costs and complexity of building and managing your own data center infrastructure. Instead, you can pay for the infrastructure on a pay-as-you-go basis, which means you only pay for the resources you use. This makes things more flexible and affordable.
What You'll Learn:
- Benefits of using cloud services like AWS for DevOps workflows
- How to create an AWS account and navigate the console
- Step by step process to launch EC2 instances
- How to set up SSH keys and configure PuTTY for remote access
- Best practices for managing and terminating AWS instances
Benefits of Using Cloud Services
Cloud services like AWS offer a number of benefits that can make it easier and more cost-effective to create applications. Let's explore the key advantages:
Reduced Upfront Costs
Cloud services like AWS allow you to avoid the upfront costs of purchasing and maintaining your own data center infrastructure, eliminating the need for expensive hardware investments.
Increased Flexibility
Cloud services can be scaled up or down as needed, which gives you more flexibility to meet changing demand. You can easily add or remove resources based on your requirements.
Improved Reliability
Cloud services are typically more reliable than traditional on-premises infrastructure, as they are backed up by multiple data centers providing redundancy and high availability.
Enhanced Security
Cloud services offer a number of security features that can help protect applications from unauthorized access, including built-in security groups, encryption, and compliance certifications.
Create Account on AWS
Let's start by creating your AWS account. This is your gateway to accessing all AWS services including EC2 for virtual machines.
Sign Up for AWS Account
Click on the Create an AWS Account button and sign up with your email address. You will receive an email verification code at your email address that you need to enter to proceed.
Create Password and Enter Details
Once your email address is verified, create a strong password. Enter your personal details and choose the Personal - for your own projects option for individual use.
Add Payment Information
Enter your credit card information. Don't worry, you will not be charged anything. As part of the AWS Free Tier, you get 750 hours of Linux and Windows t2.micro instances each month for one year.
Select Region and Login
Choose the nearest region to you for better performance. Log back in as Root user and check your billing dashboard regularly to monitor usage and avoid unexpected charges.
Important Billing Note
Always terminate your instances when not in use. Although you have 750 free hours monthly, running instances continuously will incur charges beyond the free tier.
How to Launch the Instance
Now let's create a Linux machine using AWS EC2. Linux is the operating system of choice for many DevOps practitioners and is widely used in production environments.
Navigate to EC2 Service
In the AWS Management Console, search for EC2 service and click on it. Navigate to the Instances tab where you'll see 0 running instances initially.
Launch New Instance
Click on the Launch Instances button to start creating your EC2 instance. Choose the Amazon Linux 2 AMI as it's free tier eligible and perfect for learning.
Create Key Pair
Create a new key pair for SSH access. Give it a name, select RSA type, and choose .pem format. This key will be used for secure SSH connections to your instance.
Configure Security Settings
Configure security group rules to allow SSH access (port 22) from your IP address. This ensures secure remote access to your Linux machine.
Launch and Verify Instance
Click Launch Instance and wait for it to initialize. Once running, copy the public IPv4 address - you'll need this for SSH connection setup.
How to Create the Linux Machine
We have successfully launched the instance in the AWS console. Now, we'll download PuTTY and PuTTYgen to run the Linux machine remotely.
Download PuTTY Tools
Download PuTTY and PuTTYgen for Windows from the official site. PuTTY is an SSH client for remote connections, while PuTTYgen is used for key management.
Convert Key with PuTTYgen
Open PuTTYgen, click Load, select "All files" to see your .pem file, then save the private key in .ppk format. PuTTY only supports PPK format for SSH keys.
Configure PuTTY Connection
Open PuTTY, paste the public IPv4 address in the hostname field. Navigate to SSH > Auth > Credentials and browse to select your .ppk key file.
Connect to Linux Machine
Click Open to establish the SSH connection. Login as ec2-user (the default username for Amazon Linux 2). You'll see a black terminal window where you can run Linux commands.
Switch to Root User
Use the sudo su command to switch to root user for full system permissions. The prompt changes from $ to # indicating root access. Use root privileges carefully.
sudo su
| Prompt Symbol | User Type | Permissions |
|---|---|---|
$ |
Regular User (ec2-user) | Limited permissions, needs sudo for admin tasks |
# |
Root User | Full system permissions, can execute any command |
How to Terminate or Stop an Instance
Managing your instances properly is crucial to avoid unnecessary charges. Here's the difference between stopping and terminating:
Stop Instance
Moves the instance to stopped state where it can be restarted later. Data on attached volumes is preserved, but you still pay for storage.
Terminate Instance
Deletes the instance and all associated data. Cannot be recovered. This is recommended when you're done to avoid all charges.
Go to EC2 Console
Navigate to the Amazon EC2 console in your AWS Management Console where you can see all your running instances.
Select Instance
In the navigation pane, choose Instances and select the instance that you want to terminate or stop by clicking the checkbox next to it.
Choose Action
Choose Instance State from the menu, then select either Terminate Instance or Stop Instance based on your needs.
Confirm Action
In the confirmation dialog box, choose Terminate or Stop to complete the action. The instance will be processed accordingly.
Frequently Asked Questions
What is the difference between PEM and PPK files?
PEM files are standard SSH key formats used by OpenSSH, while PPK files are PuTTY-specific formats. PuTTY requires PPK format, so you need to convert PEM keys using PuTTYgen.
How much does AWS EC2 cost for beginners?
AWS offers a free tier with 750 hours of t2.micro instances monthly for one year. This is perfect for learning and small projects without any cost.
Why should I terminate instances instead of just stopping them?
Stopped instances still incur storage charges for attached volumes. Terminating completely removes all resources and stops all charges, making it cost-effective for unused instances.
Can I access my EC2 instance without PuTTY?
Yes, you can use the AWS Management Console's browser-based SSH client, or use native SSH clients on macOS/Linux with your PEM key file directly.
What happens to my data when I terminate an instance?
When you terminate an instance, all data on the instance's local storage is permanently deleted. However, if you have EBS volumes attached, you can choose to keep them.
Ready to Master AWS DevOps Basics?
Congratulations! You've learned how to set up AWS EC2 instances and connect to them using SSH. This is a fundamental skill for DevOps engineers and cloud practitioners.
Remember to always monitor your usage and terminate instances when not in use to avoid unnecessary charges. Your Linux machine is now ready for your DevOps projects!
