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)