Skip to content

Latest commit

 

History

History
160 lines (102 loc) · 2.75 KB

File metadata and controls

160 lines (102 loc) · 2.75 KB

🚀 Cloud Server Setup with AWS EC2 (Ubuntu)

This guide walks you through creating a cloud-based Linux server (EC2 instance) on AWS and connecting to it securely via SSH from your local machine. Perfect for beginners learning cloud infrastructure, DevOps, or Linux administration.


📦 Step 1: AWS EC2 Server Provisioning

✅ Prerequisites

  • A valid AWS account (Create one here)
  • A local computer (Windows/macOS/Linux)
  • Internet access

🔧 EC2 Instance Setup

  1. Sign in to AWS Console
  2. Navigate to: ServicesEC2
  3. On the left sidebar, click Instances
  4. Click Launch instance
  5. Choose an Ubuntu Server (Free tier eligible)
  6. Follow default configuration, name your instance, and download your .pem key file securely
  7. Launch the instance

📷 Refer to screenshot: AWS EC2 Launch


🔑 Step 2: Connecting to the Server (SSH)

🧰 Required SSH Clients

Windows:

  • MobaXterm ✅ recommended
  • Git Bash
  • PuTTY
  • PowerShell

macOS/Linux:

  • Use built-in Terminal

📷 Sample Terminal Screenshot: Mac Terminal


🛡️ Secure Connection Using SSH

  1. Move your downloaded .pem file to a safe location (e.g. Downloads folder)
  2. Open Terminal (or MobaXterm)
  3. Navigate to the .pem file:
cd ~/Downloads
  1. Make your .pem file readable only by you (Linux/macOS only):
chmod 400 ubuntu.pem
  1. Connect to your EC2 instance using:
ssh -i "ubuntu.pem" ubuntu@<PUBLIC_IP_ADDRESS>

📝 Replace <PUBLIC_IP_ADDRESS> with the actual IP shown in your EC2 dashboard.

📷 Expected Output on Successful Connection: SSH Login Success


📦 Step 3: Linux Package Manager (APT/YUM)

🔄 Update Package Index

Ubuntu/Debian:

sudo apt update

Red Hat/Fedora (optional):

sudo yum update

📥 Install Sample Tool: tree

Ubuntu/Debian:

sudo apt install tree

Red Hat/Fedora:

sudo yum install tree

✅ To verify:

tree ~/Downloads

🆙 Upgrade Installed Packages

sudo apt upgrade

❌ Remove Installed Tool

sudo apt remove tree

🧪 Practice Challenge

Install nginx on your Ubuntu server:

sudo apt install nginx

Then verify by checking the Nginx service:

systemctl status nginx

✅ Summary

You now know how to:

  • Launch and configure a Linux server on AWS
  • Securely connect using SSH
  • Use Linux package managers (apt/yum)
  • Install, verify, and remove packages