How to install Ubuntu on AWS
Enjoying this content? Subscribe to the Channel!
Launch Ubuntu on AWS EC2: The Ultimate Step-by-Step Setup Guide (with Putty/Puttygen)
Hi there! This is Darren from Darren’s Tech Tutorials, and today we’re tackling one of the most fundamental skills in cloud computing: getting an Ubuntu Linux server up and running on Amazon Web Services (AWS) EC2.
If you’re a Windows user, we’ll also cover the essential step of converting your secure key so you can easily connect using Putty. Let’s dive right in and get your virtual server deployed!
1. Getting Started with AWS EC2
The first step is locating the service that hosts our virtual servers.
- Navigate to EC2: Once logged into your AWS Console, click on Services and search for EC2 (Elastic Compute Cloud). This is where we manage our virtual servers.
- Launch Instance: On the EC2 dashboard, click the Launch Instance button.
- Select the Ubuntu AMI: You will now be asked to choose an Amazon Machine Image (AMI). In the search bar, type
ubuntuand hit Enter. - Choose the Free Tier Eligible Image: Select the official Ubuntu Server image that is marked as Free Tier Eligible. Click Select.
2. Configuring Instance Details
We will keep the instance size small and ensure we can connect externally.
- Choose Instance Type: We’ll stick with the
t2.microtype, which is also Free Tier Eligible. Click Next: Configure Instance Details. - Ensure Public IP: Leave most settings at their defaults, but it is critical to ensure that Auto-assign Public IP is enabled. This public IP address is how we will access the server later.
- Add Storage: Click Next: Add Storage. The default 8 GB is usually sufficient for a test server, but you can always add more here if needed.
- Add Tags (Optional but Recommended): Click Next: Add Tags. Adding tags helps you organize your resources. A good starting tag is
Key: NameandValue: Darren’s Test Server.
3. Configuring Security and Generating the Key Pair
Security is paramount. Before launching, we need to create a secure key and lock down the connectivity.
Restrict SSH Access
The default rule allows SSH (Port 22) access from anywhere, which is a major security risk. We need to lock this down to only our current location.
- Click Next: Configure Security Group.
- Select Create a new security group.
- In the rule list, find the SSH (Port 22) rule. Under the Source dropdown, change the setting from ‘Anywhere’ to My IP.
- AWS will automatically detect your current public IP address and restrict access to just you. This is critical for security!
Launching the Instance and Downloading the Key
- Click Review and Launch. Verify all your settings, and then click Launch.
- Create a New Key Pair: When prompted, select Create a new key pair. Give it a memorable name, such as
Darren’s New Key. - Download Key Pair: Click Download Key Pair. This file (a
.pemfile) is your only way to securely access the server. Save it somewhere safe! - Click Launch Instance.
Your instance should now be in a ‘pending’ state. Give it a minute or two to start up and transition to the ‘running’ state.
4. Converting the PEM Key to PPK using Puttygen
Windows users connecting via Putty cannot use the standard .pem file directly. We need to convert it into the Putty Private Key (.ppk) format using a tool called Puttygen.
Need Putty? You can download Putty and Puttygen from the official source: https://www.putty.org/
- Open Puttygen: Launch the Puttygen application.
- Load the Key: Click the Load button. You might need to change the file type filter in the bottom right corner from “Putty Private Key files” to “All Files (*.*)” to see your downloaded
.pemfile. - Select
Darren’s New Key.pemand click Open. - Save the Private Key: Click Save private key. When prompted about saving without a passphrase, click Yes (though adding a passphrase is recommended for production servers).
- Name the new file something like
Darren’s Test Key.ppkand save it.
You now have the key format needed for Putty!
5. Connecting to Your Ubuntu Instance via Putty
With the instance running and the key converted, it’s time to establish our SSH connection.
- Get the Public IP: Return to your EC2 Instances dashboard. Select your running instance and copy the Public IPv4 Address.
- Open Putty: Launch the Putty application.
- Paste IP: Paste the Public IPv4 Address into the Host Name (or IP address) field. Ensure the Port is set to 22 and Connection Type is SSH.
- Load the PPK File: In the left-hand navigation pane, expand SSH, then click on Auth.
- Click Browse and select the
.ppkfile you just saved (Darren’s Test Key.ppk). - Open Connection: Navigate back to the top Session pane, and then click Open.
- Login: A terminal window will open. If you receive a security alert about the host key, click Yes. When prompted for
login as:, type the default Ubuntu username:ubuntu.
If everything was configured correctly, you will now be logged into your new Ubuntu server running securely on AWS EC2!
Conclusion
And there you have it—a fully operational Ubuntu server running in the cloud! We walked through the critical steps, from launching the instance and securing port 22 to converting the key and establishing a connection using Putty.
This powerful setup is the foundation for virtually any project you want to run in AWS.
If you found this tutorial useful, please consider giving the video a like and subscribing to Darren’s Tech Tutorials for more clear, practical guides. Your support helps us keep the tutorials coming!
- Check out my Patreon for exclusive content and support: https://www.patreon.com/darrenstechtutorials
- Don’t forget to like and subscribe! Happy computing!