In this guide, we'll walk you through the process of setting up your very own EC2 instance on Amazon Web Services (AWS). Whether you're a seasoned pro or just getting started with cloud computing, these steps will help you get your server up and running in no time.
Step 1: Sign in and Select Your Region
First things first, you'll need to either sign up for a new AWS account or sign in to your existing one. Once you're in, the first thing you should do is select the AWS region where you want to launch your instance. For this example, we'll be using the Ireland region.
Step 2: Navigate to the EC2 Console
Next, head over to the search bar at the top of the AWS console and type in "EC2". You'll see the EC2 service option pop up. Click on it to go to the EC2 service console.
Step 3: Launch a New Instance
Once you're in the EC2 console, click on "Instances" in the left-hand navigation menu. Then, in the top-right corner of the screen, click the "Launch Instances" button to start the process of creating your new virtual server.
Step 4: Name Your Instance
Now it's time to give your instance a name. In the "Name and tags" section, you can enter a descriptive name for your server. For this tutorial, we'll call it ‘docker-server’.
Step 5: Choose an Amazon Machine Image (AMI)
After naming your instance, scroll down to the "Application and OS Images (Amazon Machine Image)" section. Here, you'll select the operating system for your server. A good choice for many applications is Amazon Linux 2 AMI.
Step 6: Select an Instance Type
Next, you'll need to choose an instance type. The instance type determines the hardware resources (CPU, memory, etc.) that your server will have. If you're planning on running Docker, a t2.small instance is a good starting point as it provides 2GB of memory.
Step 7: Configure a Key Pair for SSH Access
To securely connect to your EC2 instance, you'll need a key pair. You have a few options here:
Use an existing key pair: If you already have a key pair in your account, you can select it from the dropdown menu.
Create a new key pair: If you don't have a key pair, you can create a new one. When creating a new key pair, it's recommended to use the RSA algorithm and the .ppk format if you're on Windows and plan to use a tool like PuTTY to connect. If you're using a Linux or macOS terminal, you can use the .pem format.
Proceed without a key pair: If you don't need to connect to your instance via SSH, you can select the "Proceed without a key pair" option.
Step 8: Configure Network Settings
For the network settings, you can leave the default VPC and subnet settings as they are. However, you will need to create a new security group to allow traffic to your instance. To allow web traffic, make sure to add a rule for HTTP. You can always modify the security group settings later on.
Step 9: Configure Storage
By default, your EC2 instance will come with 8GB of storage. You can increase this amount depending on your needs.
Step 10: Attach an IAM Instance Profile (Optional)
If you need to access your EC2 instance using AWS Systems Manager Session Manager, you'll need to attach an IAM instance profile. This gives your instance the necessary permissions to communicate with the SSM service. You can create a new IAM role with the AmazonSSMManagedInstanceCore policy and then attach it to your instance.
Step 11: Add User Data (Optional)
The "User data" field allows you to run scripts or commands on your instance when it's first launched. For example, you could use this to automatically install a web server like Apache.
Step 12: Launch Your Instance
Finally, click the "Launch instance" button to create your EC2 instance. After a few moments, your new server will be up and running and ready for you to use.
I hope this guide was helpful. Let me know if you have any questions
Provision EC2 on AWS Cloud
💼 Ready to Find Your Dream Job?
Browse 1000+ verified fresher jobs and internships — updated daily.
Browse Latest Jobs →