Amazon is one of the most important infrastructure services provider. This includes computing power, storage, networking and databases among the a lot of others. One of the computing service that it offers are the EC2 instances. In this post I am going to explain how to set up an Ubuntu server using an EC2 instance.
First of all go to AWS console and log in. From there it is important to select the Region where you want your services. You should select somewhere that is close to the locations that will receive most traffic. In my case I will use UE (London)
since is close to where I live.
Using the AWS navigation go to EC2
and press Launch Instance
. I would suggest you start with a Ubuntu Server 18.04 LTS
.
For the configuration of the instance I suggest the following:
t2.micro
(it is included in the free tier) or t3.micro (not in free tier but cheaper than t2
family). You can change it later to a more powerful instance if needed.t3
family disable the T2/T3 Unlimited
to reduce costs..pem
file).Some people have a dynamic IP. If this is your case and you have restricted the access to the instance you should update periodically the Security Group so that you can allways access the instance.
You can access your instance through an SSH connection. I suggest using the open source PuTTY.
After installing PuTTY open PuTTYgen
to transform the .pem
file with the key to a .ppk
.
.pem
file.Save private key
and store the ppk
file.ppk
file key so that it gets loaded into PuTTY.Open
Yes
)ubuntu
as user. The key you just imported should serve as password (you should not write anything)If you did all the above correctly you should have a fully working Ubuntu
instance and a connection with PuTTY through SSH
.
From here you can do whatever you want with it.
Since I use python in almost every project I will include how to set it up.
First check that you have python 3 installed with the command:
python3 # It should open python 3.X if it has worked you can closed it with: exit()
Then install pip3
as a python package manager with:
sudo apt-get update
sudo apt install python3-pip -y
pip3 freeze # To check it has worked
Right now you can use python calling python3
and install packages with pip3 install X
And that's it, you have your own server!
In the next posts I will explain some things you can do with that server.