DEV Community

Cover image for Creating a linux EC2 Instance
Nushynells
Nushynells

Posted on

Creating a linux EC2 Instance

AWS platform is a great platform that is used for many cloud computing activities. It has over 200 services and grasping their key concepts is a better way to easily launch applications on it.
I shall be uploading tutorials that enable beginners to easily maneuver the AWS platform as they gather more practical skills on it.

Creating a Linux EC2 instance
Log in to the AWS environment. After you have logged in, go over the EC2 services tab, and it will take you to the EC2 dashboard.

EC2 dashboard
To start a new instance, select the Launch Instance tab. It will take you to the Launch an Instance page.

Launch an Instance

In the Name and Tags section, add the name of your server. You can add other tags here.

Naming an instance

Note:
Tags are specified as Key/Value pairs. They are not mandatory although it is useful to tag all of your AWS resources in production environments to stay organized.

In the Application and OS Images section, select the Amazon Linux option under Quick Start:

AMI selection

Amazon provides many AMIs, including the most popular versions of Linux and Windows, often in 32-bit and 64-bit variants.

Select the Instance type in the Instance Type section on every selected instance type, you can see the summary of the hardware resources on the right such as the CPU type, number of virtual CPUs, memory, and pricing.

In the Key pair section, click on Create new key pair, enter yourkeypairname for the Key pair name. Choose the preferred value for Key pair type and Private key file format, and click Create key pair.
Creating a Keypair
The key pair will begin downloading a file named yourkeypairname.pem on your local system. It contains a private key that you can use to connect to the EC2 instance via SSH.

Keypair
Network settings section, under Security groups (Firewall), Allow SSH traffic by checking the box Anywhere is selected:

Security Group Set up

Note: The Warning from AWS is letting you know the default configuration for the security group that is about to be created will grant SSH access from any source IP address (0.0.0.0/0). Production environments should be more restrictive.

Tip: A handy feature for testing purposes is to select My IP from the Source drop-down. That will restrict SSH access to only your current IP address. In network environments with Dynamic Host Configuration Protocol (DHCP), multiple routers or firewalls, and other features that make IP addresses subject to change, this setting is not a permanent security feature. However, it is sometimes a helpful feature while you perform various tests using your EC2 instance.

In the Configure storage section, select the GiB and Root volume.

Instance Storage
Note: This is where you can change storage settings such as additional volumes, encrypt volumes, or change any other settings if needed.

EC2 storage settings
Click on Advanced details to expand the section, here you can configure more options such as spot instances, purchasing options, and start and stop settings among others.

EC2 storage settings
Note: For further information on each section, hover over the i information icon next to it for a basic description. The help text also includes a link to related documentation.

Review the Summary section on the right, and click Launch instance when ready:

A confirmation page will let you know that your instance is launching:

Confirmation

Click the View all instances (lower right) to close the confirmation page and return to the Instances screen of the EC2 console.

EC2 Console
You can view the status of your instance on the Instances screen of the EC2 console:

Instance list
The Details tab below has information about your instance. When you launch an instance, its initial Instance state defaults to Pending. After the instance starts, its Instance state transitions to Running, and it receives a Public IPv4 address and Public IPv4 DNS name. It typically takes about 30 - 60 seconds for the AWS Linux instance to transition to a running state.

Congratulations...you just launched your first EC2 instance!

Top comments (0)