How To Create An Linux Server Using Aws For Free

Shashikant Dwivedi
SKDBLOG
Published in
5 min readMay 21, 2020

--

Photo by Taylor Vick on Unsplash

Hello, everyone, I am Shashikant Dwivedi and in this article, I’m going to demonstrate, how you can create your own Linux server using AWS.

If you know what AWS is then its good and if you don’t know about what AWS is then here is a general intro of AWS for you.

AWS — It is a cloud service provider. That provides you with a large number of cloud services like computing, storage, database, networking etc. online.

Before heading forward there is a pre-requisite that you must have.

An AWS account (Must be under free tier, if you want your server created for free).

So if you have an AWS account, then log in and open AWS console.

Steps

  1. On AWS management console search for EC2 and open it.

2. Now on EC2 dashboard click on Launch Instance button.

3. Now on choose AMI window select Ubuntu Server 18.04 LTS (HVM).

So here we are selecting Ubuntu Server. You can select any other Linux distro server according to your convenience. And remember, if you want your server under free tier, then select only those server in which the label of free-tier eligible is there.

4. Now on Choose Instance type window select t2.micro as it is free tier eligible and click on Next: Configure Instance Details button.

Instance Types represent the different-different system configurations. So choose according to your requirements. But remember if you want your server under free tier use instance type with the free-tier tag only.

5. Now on Configure Instance window leave it as it is and click on Next: Add Storage button

You don’t need to disturb these settings.

6. Now on Add Storage window, you can change storage up to 30 GB as it is free tier eligible and then click on Next: Add Tags button.

You can add storage according to your use.

7. You can leave add Tags window default as it is not needed that much and click on Next: Configure Security Groups button.

You can add tags to a server, to categorize them.

8. Now here on Configure Security Group window change the ssh source to anywhere to access it from anywhere in the world. You can also restrict ssh access to your IP address from the source option. After that click on Review and Launch button.

Ok talking about security groups. It is one most important setting because it decides your server openness to the world. You want to host your web application in the server that you also have to allow HTTP and HTTPS in security groups.

9. In Review window you can see all details related to your server that you are going to launch. Now press the Launch button.

Now just preview all the configuration of your server before final launch.

10. Key pair is used to connect to your server or if I say your ec2 instance. So you can select the option Create a new key pair and give that key pair a name and click on the checkbox and firstly download the key pair and then click on Launch Instances button.

11. Finally, your server has been launched. Now click on View Instance button.

12. Now place your downloaded private key file or key pair into a safe location and open the terminal on that location. After opening terminal restrict access to the private key file by change mode command

chmod 400 key_filename.pem

13. Now open your Instances window again and see if Instance State is running or not. If Instance state is running then copy the IPv4 Public IP and open terminal again in the same location. And types this command to connect to your Ubuntu server

ssh -i key_filename.pem user-name@your-server-ip

In Ubuntu server by default username is ‘ubuntu’ so your command will be

ssh -i key_filename.pem ubuntu@your-server-ip

14. Now if asked for yes or no type yes.

15. Now finally you are connected to your ubuntu server.

16. You can type ‘exit’ to disconnect for the server and if you want to close the server permanently go to Instances on AWS management console and select the server, and then press Actions button in which press on Instance State in which press Terminate.

And that’s it. This is how you can create a Linux server on aws.
Hope you have liked the article. And if you have any problem, you can ask me in the comment section.

--

--

Shashikant Dwivedi
SKDBLOG

I am full time developer, working for DeviceDoctor.IN. I write articles on topics that I learn daily by doing.