Amazon EC2 (Elastic Compute Cloud) lets you launch virtual machines in the cloud. If you are new to AWS, this is one of the fastest ways to deploy your first server and run an app on the internet.
This guide walks through the first EC2 launch flow and how to connect to your instance using SSH.
Search for EC2 in the AWS Console.
After opening EC2, you will reach the EC2 dashboard.
Click Launch instance to start creating your server.
Now fill in the required fields in the launch form.
The main fields you should focus on:
The key pair is important because you will use it later to SSH into your server.
AWS commonly offers:
For beginners, RSA is usually the easiest choice due to wider compatibility and simpler setup.
When you create a key pair, download the .pem file and store it securely on your local machine.
Review your configuration and launch the instance.
At this point, your instance is running.
Copy your instance public IP, then run SSH from your terminal.
For Amazon Linux:
For Ubuntu:
Example:
Before connecting, fix key permissions:
Example:
After login, your prompt will look similar to:
Now you can clone your repository, install dependencies, and run your app on the server.