Create and Login to Your EC2 Instance!
Create and login to your instance!
Introduction
Hi!
After a long time, here is my new post. Yeah, I wrote this for my notes and maybe other classmates can read it and help them pass the first assignment from the Cloud Computing class this semester :D.
Assignment
So, what’s the assignment?
We should configure our EC2 instance, set up a web server, install MySQL and PHP, and then test to ensure that all components are running smoothly.
In this post, we will discuss how to create and log in to an EC2 instance. Let's get started!
Create Cloud Provider Account
We should has a cloud provider account, because the assingment required using AWS we will using AWS in here. You can register through https://aws.amazon.com/
Create Instance
On this project, I choose the Jakarta region (ap-southeast-3). You can set and choose any region that you want.
We will create the instance now, for the name
you can fill it with anything you want. For the OS, I’ll choose Ubuntu 20.04 with 64 bit architecture.
For Instance typ, I’ll go with the t3.micro, this type come with 2 vCPU & 1 GiB Memory. After choosing instance type, we go to the `Key Pair` this one is required, with this key pair you can connect to the instance from your terminal. If you didn’t have the key pair, you can create it.
Next, we will move to the Network Settings. Don’t forget to allow HTTPS traffic & allow HTTP traffic. After that we can click launch instance.
We can see the instance is already created. We should copy the public IPv4 to login with SSH.
While creating key pair before, you will get the file of the key with .pem format. Go to the directory and you can use this command to add your key file to SSH Agent.
ssh add <filename>.pem
and
ssh <username>@instance-ip
or you can directly login with this command
ssh -i /path/key-pair-name.pem instance-user-name@instance-ip
The default username is ubuntu.
After successfully logged in you can update and upgrade the package using this command
sudo apt-get update && sudo apt-get upgrade
That’s all! You’re all set! I’ll write about setup the Nginx, PHP, and MySQL in other post :)
Thanks~