DEV Community

alok-38
alok-38

Posted on

Things to do after creating an EC2 instance and connecting to it using SSH

Connected to an EC2 Instance Using SSH. Now What?

🧭 Big Picture First

At this point, you’ve already:

  • Created an EC2 instance
  • Connected to it via SSH

Now you’re inside the server. Before installing anything or making changes, you need to understand what you’re running.


🧱 Phase 1 β€” Identify the System

1️⃣ Check the OS & Kernel

uname -a
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Identify OS type

  • Kernel version

  • Architecture

  • Environment (AWS)

Why it matters

  • Determines which tools you use (dnf, systemctl)

  • Avoids wrong commands (e.g., apt on Amazon Linux)

πŸ“¦ PHASE 2 β€” Package Management Basics

2️⃣ Update system packages

sudo dnf update
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Bring all installed software up to date

  • Apply security patches

Why it matters

  • Security

  • Stability

  • Best practice on new servers

3️⃣ Query installed kernel

rpm -q kernel
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Check kernel version via package database

Why it matters

  • Kernel is installed like any other package

  • Helps during upgrades & debugging

4️⃣ Install nginx

sudo dnf install nginx
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Download and install nginx from trusted repos

Why it matters

  • Teaches how software is installed properly

  • Dependency resolution happens automatically

5️⃣ Verify nginx is installed

rpm -q nginx
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Confirm nginx exists at the RPM level

Why it matters

  • Installation β‰  running

  • Always verify installs

βš™οΈ PHASE 3 β€” Service Management (systemd)

6️⃣ Check nginx service status

sudo systemctl status nginx
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Show whether nginx is running

  • Show logs, PID, uptime, config validation

Why it matters

  • Services must be monitored, not assumed

7️⃣ Start nginx (if needed)

sudo systemctl start nginx
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Start the nginx service

Why it matters

  • Installed services don’t auto-run

🌐 PHASE 4 β€” Verify Functionality

πŸ”Ÿ Test locally

curl localhost
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Verify nginx responds internally

Why it matters

  • Separate Linux issues from AWS networking issues

πŸ”Ÿ (AWS) Open port 80

Action

  • Security Group β†’ Allow HTTP (80)

Purpose

  • Allow external traffic

Why it matters

  • AWS firewall blocks traffic by default

πŸ“ PHASE 5 β€” Understand Configuration Safely

1️⃣1️⃣ View nginx config safely

sudo less /etc/nginx/nginx.conf
Enter fullscreen mode Exit fullscreen mode

Purpose

  • Read main nginx config (read-only)

Why it matters

  • Understand before modifying

  • Avoid breaking production configs

🧠 KEY CONCEPTS YOU’VE LEARNED (WITHOUT NOTICING)

You now understand:

  • Linux kernel vs OS

  • Package managers (dnf, rpm)

  • Installed vs running software

  • systemd & services

  • Safe config inspection

  • Zero-downtime reloads

  • Cloud networking basics

  • Production hygiene

This is real DevOps knowledge, not theory.

🧩 MENTAL MODEL (VERY IMPORTANT)

EC2 instance
 β”œβ”€β”€ Linux OS
 β”‚    β”œβ”€β”€ kernel (rpm)
 β”‚    β”œβ”€β”€ packages (dnf)
 β”‚    └── services (systemctl)
 β”‚
 β”œβ”€β”€ nginx installed (rpm)
 β”œβ”€β”€ nginx running (systemd)
 β”œβ”€β”€ nginx configured (/etc/nginx)
 └── traffic allowed (AWS SG)
Enter fullscreen mode Exit fullscreen mode

🎯 WHERE YOU ARE NOW

You are exactly at:

β€œI can operate and reason about a Linux service on the cloud.”

That’s the foundation of:

  • Docker

  • Kubernetes

  • CI/CD

  • SRE

  • Platform engineering

Top comments (0)