DEV Community

Cover image for πŸš€ My DevOps Journey – Week 1: Mastering the Foundations of Modern Infrastructure
Lav kushwaha
Lav kushwaha

Posted on

πŸš€ My DevOps Journey – Week 1: Mastering the Foundations of Modern Infrastructure

πŸ”– Tags: #devops, #aws, #git, #bash, #MERN, #docker, #pm2

πŸ‘‹ Introduction

In Week 1 of my DevOps journey, I laid a strong foundation by exploring essential tools, systems, and cloud infrastructure practices. DevOps is all about collaboration, automation, and delivering better software, fasterβ€”and this week gave me a deep dive into the basics.**

Here’s what I covered:

βœ… Git & GitHub
βœ… Bash & Terminal mastery
βœ… Virtual Machines
βœ… SSH authentication
βœ… MERN stack hosting
βœ… AWS EC2 deployment
βœ… Reverse proxies & process management
βœ… Streamlined DevOps workflows

Let’s go over each topic in detail.

πŸ—‚οΈ Git & GitHub – The Backbone of Collaboration

Git is a distributed version control system that allows developers to track code changes and collaborate efficiently. GitHub builds on top of Git by offering cloud-based repositories, pull requests, issue tracking, and integrations with CI/CD tools.

πŸ“¦Core Commands:

git init                     # Initialize repo
git add .                   # Stage all changes
git commit -m "message"     # Commit changes
git branch -M main          # Rename branch
git remote add origin URL   # Link remote repo
git push -u origin main     # Push code
Enter fullscreen mode Exit fullscreen mode

Git & GitHub are vital in CI/CD pipelines and code collaboration in DevOps environments.

🧠 Bash & Terminal Mastery

Bash is a Unix shell that lets DevOps engineers write scripts and automate tasks.

πŸ”§ Basic Commands

Command  Description
pwd Print working directory
ls -l   List files with details
cd, mkdir, rm   Navigate/create/delete folders
nano, cat   Edit or view files
sudo, adduser   User permissions & creation
ifconfig, ping  Networking checks


Enter fullscreen mode Exit fullscreen mode

πŸ“¦ Package Management

sudo apt update && sudo apt upgrade
sudo apt install nodejs npm git
Enter fullscreen mode Exit fullscreen mode

Bash scripting will be a key focus next week to automate these workflows.

🧱 Virtual Machines

A Virtual Machine (VM) simulates a physical machine using virtualization. It's used to run isolated environments on the same physical hardware.

Hosted via hypervisors like VirtualBox or cloud platforms like AWS

Ideal for building, testing, and deploying apps in a production-like environment

πŸ” SSH Protocol – Secure Remote Access
SSH (Secure Shell) is used to securely access and manage remote servers.

πŸ”‘ Key Usage:

ssh user@remote-ip
ssh -i ~/.ssh/private-key.pem user@host
Enter fullscreen mode Exit fullscreen mode

SSH is essential for connecting to cloud servers, configuring services, and deploying code remotely.

🌐Hosting Full-Stack (MERN) Projects

Hosting a MERN (MongoDB, Express, React, Node.js) stack involves deploying both frontend and backend with appropriate routing, environment configs, and server process management.

Coming up next: containerizing MERN apps using Docker and deploying them on cloud platforms!

☁️ AWS Fundamentals – Deploying Node.js on EC2
This week, I deployed a backend app on AWS using an EC2 instance.

πŸͺœ Step-by-Step:

1️⃣ Launch EC2 Instance

  • AMI: Ubuntu 20.04 LTS
  • Instance type: t2.micro (free tier)
  • Ports:
  • 22 (SSH)
  • 3000 (App)
  • 80 (HTTP)

2️⃣ Connect via SSH

chmod 400 your-key.pem
ssh -i your-key.pem ubuntu@<ec2-ip>
Enter fullscreen mode Exit fullscreen mode

3️⃣ Install Server Tools

sudo apt update
sudo apt install nodejs npm git
Enter fullscreen mode Exit fullscreen mode

4️⃣ Clone and Setup Project

git clone https://github.com/your-username/your-project.git
cd your-project
npm install
Enter fullscreen mode Exit fullscreen mode

5️⃣ Set Environment Variables

export MONGO_URI="your-mongo-url"
export JWT_SECRET="your-secret-key"
Enter fullscreen mode Exit fullscreen mode

6️⃣ Start Server

node index.js
Enter fullscreen mode Exit fullscreen mode

Bonus: Use pm2 to manage your app in production:

npm install -g pm2
pm2 start index.js

Enter fullscreen mode Exit fullscreen mode

7️⃣ Visit the Live App

`http://<ec2-public-ip>:3000`
Enter fullscreen mode Exit fullscreen mode

πŸ”„ Reverse Proxies & Process Managers
A reverse proxy forwards client requests to your application. It adds a layer of abstraction and security.

πŸ” How Nginx Works:

Listens on port 80

Forwards traffic to backend on port 3000

Enables HTTPS, load balancing, and caching

πŸ”§** Nginx Sample Config:**

server {
  listen 80;
  server_name yourdomain.com;

  location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }
}
Enter fullscreen mode Exit fullscreen mode

pm2 ensures your app stays running even after disconnection or crashes.

πŸ“ˆ Streamlined Workflows & CI/CD Thinking
DevOps isn’t just toolsβ€”it’s about efficiency and automation:

βœ… Using Git branches with meaningful names

βœ… Creating shell scripts for setup

βœ… Setting up .env files with secrets

βœ… Planning CI/CD pipelines (coming next week)

These practices help maintain consistency, speed, and scalability in your projects.

🧠 Summary

This week I:
βœ… Set up Git, GitHub, and learned version control
βœ… Practiced terminal commands and system navigation
βœ… Connected to cloud servers using SSH
βœ… Hosted my backend project on AWS
βœ… Learned the purpose of reverse proxies and process managers

⏭️ What’s Coming in Week 2?

Next, I plan to learn:
πŸ”ΈDocker and DockerHub
πŸ”ΈCI/CD pipeline

πŸ™Œ Final Thoughts

DevOps is a journey, not a destination. It’s a mindset, a toolset, and a continuous practice. Week 1 gave me the confidence to build, deploy, and scale more effectivelyβ€”and I’m just getting started!

Let’s keep building πŸ’»
If you’re on a similar journey, feel free to comment, connect, or collaborate.

✍️ By Lav Kushwaha
πŸ“… Week 1 of My #100DaysOfDevOps

Top comments (0)