How to Setup CentOS 7 on AWS
Enjoying this content? Subscribe to the Channel!
Spin Up a CentOS 7 Server on AWS EC2: The Ultimate Beginner’s Guide
Welcome to Cloud Server Deployment!
Ready to get hands-on experience with one of the most powerful cloud platforms in the world? Deploying a Linux server on Amazon Web Services (AWS) is a fundamental skill for anyone interested in IT, development, or DevOps.
In this comprehensive guide, based on our popular video tutorial, we’re going to walk you through the entire process of creating a CentOS 7 instance using Amazon EC2 (Elastic Compute Cloud). By the end of this tutorial, you will have a live, accessible CentOS server running in the cloud, ready for you to experiment with.
We’ll cover everything from selecting the right image in the AWS Marketplace to securing your connection with a Key Pair and logging in remotely using PuTTY.
Prerequisites: What You Need
Before we dive into the AWS console, make sure you have the following ready to go:
- An Active AWS Account: You will need access to the AWS Management Console. (Remember to utilize the AWS Free Tier if you are just starting out!)
- PuTTY: This is the essential SSH client we will use to connect to our new CentOS instance from a Windows machine.
Step 1: Navigating to EC2 and Selecting Your CentOS AMI
The first step is locating the EC2 service and selecting the foundational image for our server. AWS uses AMIs (Amazon Machine Images) as templates for your instances.
Accessing the EC2 Dashboard
- Log into your AWS Management Console.
- Use the search bar at the top of the page and search for EC2. Click on the service to open the EC2 Dashboard.
- On the left-hand navigation menu, click Instances, then click the Launch Instances button.
Choosing the CentOS 7 AMI
For this tutorial, we will use an official, ready-made image found in the AWS Marketplace:
- In the instance creation wizard, look for the AWS Marketplace tab.
- Search for CentOS 7.
- Select the desired CentOS 7 image (usually offered by the CentOS Project or an officially validated seller). This step is crucial, as it dictates the operating system of your new virtual machine.
- Review the pricing details (ensuring it fits within the Free Tier, if applicable) and click Continue.
Step 2: Configuring Your EC2 Instance
After selecting the AMI, you will move through several configuration steps. We will focus on the basics required to get the server running quickly.
Choosing an Instance Type
- On the ‘Choose an Instance Type’ page, select a suitable machine size. For beginners and standard testing, the t2.micro or t3.micro types are excellent choices, as they are typically eligible for the AWS Free Tier.
- Click Next: Configure Instance Details. (You can generally leave the defaults on this page for simple deployments.)
Storage and Tags
- Add Storage: Ensure the default storage size is sufficient for your needs (usually 8GB is plenty for a basic CentOS installation).
- Add Tags: This is an important best practice! Click Add Tag and use a key of
Nameand a value that describes your server (e.g.,CentOS-7-Tutorial-Server).
Configuring Security Groups
Security groups act as a virtual firewall, controlling inbound and outbound traffic to your instance.
- Click Next: Configure Security Group.
- You must ensure that SSH access is enabled so you can log in remotely. AWS automatically suggests a rule for SSH (Port 22).
- For testing, you can set the source to My IP (best practice for security) or Anywhere (0.0.0.0/0) (less secure, but easier for general learning).
Step 3: Review and Create the Key Pair
This is the most critical security step. To securely connect to your new Linux server, you need a Key Pair.
Launching the Instance
- Click Review and Launch to view a summary of your configuration.
- Click Launch.
Creating and Downloading the Key Pair
A pop-up window will appear asking you to select or create a Key Pair.
- Select Create a new key pair.
- Give your Key Pair a recognizable name (e.g.,
CentOS-Key-2024). - Click Download Key Pair. IMPORTANT: Save this
.pemfile somewhere safe! You will need this file every single time you want to connect to this server. - After downloading, click Launch Instances.
Your instance will now begin the provisioning process. You can monitor its status by clicking View Instances. Wait until the “Instance State” shows Running and the “Status Check” is 2/2 checks passed.
Step 4: Connecting to CentOS 7 Using PuTTY
With your instance running, it’s time to connect! Because we are using PuTTY on Windows, we first need to convert the .pem file we downloaded into a .ppk file using the PuTTYgen tool.
A. Converting the Key
- Open PuTTYgen.
- Click Load and navigate to your downloaded
.pemfile (you may need to select “All Files” in the file explorer to see it). - Once loaded, click Save private key. You will be prompted about saving without a passphrase—confirm Yes.
- Save the new file as a
.ppk(PuTTY Private Key).
B. Connecting with PuTTY
- Find the Public IPv4 address of your running EC2 instance in the AWS console. Copy this address.
- Open PuTTY.
- Paste the Public IP address into the Host Name (or IP address) field.
- In the left-hand menu, navigate to Connection > SSH > Auth.
- Click Browse and select the
.ppkfile you just generated. - Click Open.
C. Logging In
When the PuTTY terminal window opens, you will be prompted to log in.
- Crucial Tip: The default username for official CentOS AMIs on AWS is
centos.
Type centos and hit Enter. If you successfully pointed PuTTY to the correct .ppk key, you will be logged in immediately to your brand new CentOS 7 server! Congratulations—you are now operating a remote Linux server in the cloud.
What’s Next for Your Cloud Server?
You have successfully created a powerful CentOS 7 instance on AWS, configured its security, and logged in remotely. This foundational skill opens the door to hundreds of possibilities, from hosting websites and running applications to building testing environments and practicing complex server administration.
Now that you’re logged in, try running some basic Linux commands like sudo yum update to ensure your system is up-to-date!
If you found this guide helpful, make sure to like the corresponding video and subscribe to Darren’s Tech Tutorials for more clear, actionable guides on AWS, Linux, and all things tech.
Want to master basic Linux commands right away? Grab our Free Linux Cheat Sheet today!