π 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
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
π¦ Package Management
sudo apt update && sudo apt upgrade
sudo apt install nodejs npm git
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
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>
3οΈβ£ Install Server Tools
sudo apt update
sudo apt install nodejs npm git
4οΈβ£ Clone and Setup Project
git clone https://github.com/your-username/your-project.git
cd your-project
npm install
5οΈβ£ Set Environment Variables
export MONGO_URI="your-mongo-url"
export JWT_SECRET="your-secret-key"
6οΈβ£ Start Server
node index.js
Bonus: Use pm2 to manage your app in production:
npm install -g pm2
pm2 start index.js
7οΈβ£ Visit the Live App
`http://<ec2-public-ip>:3000`
π 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;
}
}
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)