DEV Community

Cover image for Linux First: Your Step-by-Step DevOps Foundation Guide
Melody Mbewe
Melody Mbewe

Posted on • Originally published at techquestershub.hashnode.dev

57 6 3 4 2

Linux First: Your Step-by-Step DevOps Foundation Guide

After my post about learning Linux before diving into Kubernetes, some of you asked for more specific guidance. Shout out to KC, who perfectly captured what many were thinking: "Can you detail those 5 steps? I've been using WSL but had no idea you could build a web server in it."

Challenge accepted! Let's break down how to build that Linux foundation that makes everything else in DevOps click—whether you're on Windows, macOS, or already running Linux.

Step 1: Install a Linux distro (and actually use it daily)

The goal here isn't just having Linux—it's making it part of your daily workflow until it becomes second nature.

Windows Users:

WSL (Windows Subsystem for Linux) is your best friend. Here's how to get started:

  1. Open PowerShell as administrator and run:
   wsl --install
Enter fullscreen mode Exit fullscreen mode

This installs Ubuntu by default, which is perfect for beginners.

  1. After installation, create your Linux user and password when prompted.

  2. Make WSL part of your daily routine:

    • Set up Windows Terminal to open WSL by default
    • Keep a terminal open while coding
    • Challenge: Try doing your git operations from the WSL terminal instead of GUI tools for a week

macOS Users:

You're already on a Unix-based system, which is helpful, but I still recommend a Linux VM for the full experience:

  1. Install UTM (free) or Parallels (paid) to run Linux VMs
  2. Install Ubuntu or Debian and allocate at least 2GB RAM
  3. Or if you prefer containers: brew install docker and run a Linux container

Linux Desktop Users:

You're already ahead! Just make sure you're:

  1. Using the command line regularly instead of GUI tools
  2. Learning your distro's package manager inside out
  3. Managing your system via the terminal

Step 2: Learn Bash (it's your DevOps superpower)

I used to think Bash was just "that thing where I type commands." Now I know it's the secret weapon of productive DevOps engineers.

Bash Basics to Advanced:

  1. Create a practice.sh file with:
   #!/bin/bash
   echo "Hello, $(whoami)! Today is $(date)"
Enter fullscreen mode Exit fullscreen mode
  1. Make it executable:
   chmod +x practice.sh
   ./practice.sh
Enter fullscreen mode Exit fullscreen mode
  1. Build a real automation script (start simple):
   #!/bin/bash

   # Simple backup script
   SOURCE_DIR="$HOME/projects"
   BACKUP_DIR="$HOME/backups"
   TIMESTAMP=$(date +"%Y%m%d_%H%M%S")

   # Create backup directory if it doesn't exist
   mkdir -p "$BACKUP_DIR"

   # Create the backup
   tar -czf "$BACKUP_DIR/backup_$TIMESTAMP.tar.gz" "$SOURCE_DIR"

   echo "Backup created at $BACKUP_DIR/backup_$TIMESTAMP.tar.gz"
Enter fullscreen mode Exit fullscreen mode
  1. Learn these bash concepts systematically:
    • Variables and environment variables
    • If/else conditionals
    • Loops (for, while)
    • Functions
    • Processing command output
    • Exit codes and error handling

I became comfortable with Bash by building small utility scripts for things I did repeatedly, like setting up development environments or cleaning up temp files.

Step 3: Build stuff manually (before automating)

This is the most transformative step. Before containerizing or automating, build it by hand.

Set Up a Basic Web Server in WSL/Linux:

  1. Install Nginx:
   sudo apt update
   sudo apt install nginx
Enter fullscreen mode Exit fullscreen mode
  1. Start the service:
   sudo service nginx start
Enter fullscreen mode Exit fullscreen mode
  1. Create a custom HTML page:
   echo "<html><body><h1>My First Linux Web Server</h1></body></html>" | sudo tee /var/www/html/index.html
Enter fullscreen mode Exit fullscreen mode
  1. Access it:
    • From WSL: curl localhost
    • From Windows host with WSL: Open browser to http://localhost or http://[WSL-IP]

To find your WSL IP: ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1

Other essentials to build manually:

  • Database server (MySQL/PostgreSQL)
  • SSH keys and secure server setup
  • Firewall configuration with ufw or iptables
  • Basic LAMP/LEMP stack
  • Cron jobs for scheduled tasks

When I first set up Nginx manually, I suddenly understood what all those Docker port mappings were doing—it wasn't magic anymore!

Step 4: Google like a pro (and understand what you're copying)

We all Google, but are you doing it effectively?

Sharpen your search skills:

  1. Use specific error messages in quotes
  2. Add your exact Linux distro to searches
  3. Include version numbers
  4. Try site-specific searches like site:stackoverflow.com nginx 403 forbidden

When reading solutions:

  1. Break down each command:
   systemctl status nginx
Enter fullscreen mode Exit fullscreen mode

What is systemctl? What does status do? What's the difference with service nginx status?

  1. Use man pages and --help flags:
   man systemctl
   systemctl --help
Enter fullscreen mode Exit fullscreen mode
  1. Understand permissions and processes:
   ps aux | grep nginx
   ls -la /var/www/html
Enter fullscreen mode Exit fullscreen mode

I keep a personal "command dictionary" where I document commands I've learned and what each flag does. It's become my most valuable resource.

Step 5: Document everything (your future self will thank you)

Documentation isn't just nice—it's necessary. Here's my system:

  1. Set up a personal knowledge base:

    • Use Markdown files in a git repo
    • Try Obsidian or Notion
    • Even a simple Google Doc works
  2. Document even "obvious" things:

   # Setting up Nginx on Ubuntu 22.04

   1. Install: `sudo apt install nginx`
   2. Start service: `sudo service nginx start`
   3. Check status: `sudo service nginx status`
   4. Default config location: /etc/nginx/sites-available/default
   5. Web root: /var/www/html
   6. Logs: /var/log/nginx/
Enter fullscreen mode Exit fullscreen mode
  1. Include what didn't work (and why):
   Note: Initially tried using port 80 but got permission errors.
   Fixed by either:
   - Using port above 1024 (no sudo needed)
   - Or adding capability: `sudo setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx`
Enter fullscreen mode Exit fullscreen mode

I can't tell you how many times my documentation has saved me hours of frustration when revisiting something months later.

Bonus: Little-Known Linux Skills That Made Me Better

These smaller skills dramatically improved my Linux confidence:

1. Process and port management:

# Find what's using port 3000
sudo lsof -i :3000

# Kill a process
kill -9 <PID>

# Check resource usage
htop
Enter fullscreen mode Exit fullscreen mode

2. System monitoring:

# Monitor logs in real-time
tail -f /var/log/nginx/error.log

# Check disk space
df -h
Enter fullscreen mode Exit fullscreen mode

3. Network troubleshooting:

# Test connectivity
ping google.com

# Trace route
traceroute google.com

# DNS lookup
nslookup example.com
Enter fullscreen mode Exit fullscreen mode

4. User and permission management:

# Add user to group
sudo usermod -aG docker $USER

# Change ownership
sudo chown -R user:group /path/to/directory
Enter fullscreen mode Exit fullscreen mode

Putting It All Together

After getting comfortable with these steps, you'll find that:

  1. Docker makes sense because you understand the Linux processes it's containerizing
  2. Kubernetes feels logical because you know how networking and processes work
  3. CI/CD is clearer because you understand the underlying shell commands
  4. Configuration management tools like Ansible are intuitive because you've done the manual steps

Learning Linux first gave me something invaluable: confidence. Not the temporary confidence of following a tutorial, but the lasting confidence of understanding what's happening under the hood.

When things break in production (and they will), you won't freeze—you'll know exactly where to look and how to fix it.

So what are you waiting for? Open that terminal and start building your Linux foundation today. Your future DevOps self will thank you.


If this helped you, let me know what you build first! I'm always curious to see how others are starting their Linux journey. Drop a comment or DM me with your progress or questions.

Postmark Image

"Please fix this..."

Focus on creating stellar experiences without email headaches. Postmark's reliable API and detailed analytics make your transactional emails as polished as your product.

Start free

Top comments (14)

Collapse
 
nevodavid profile image
Nevo David

Damn, the time I wasted not documenting my own stuff, would've saved so many headaches lol

Collapse
 
devnenyasha profile image
Melody Mbewe

Totally hear you! The "future self" gratitude for documentation is REAL. It's like sending yourself a little gift every time you take the time to write things down.

Collapse
 
prakirth profile image
Prakirth Govardhanam

I am currently at step 2 of the detailed process. Thank you very much for this roadmap @devnenyasha ! This reaffirmed my understanding of learning Linux before DevOps. Scripting, monitoring deployed applications and if possible automating troubleshooting common issues are the key goals for me. I hope it is achievable.
Thank you once again :)

Collapse
 
devnenyasha profile image
Melody Mbewe

You're welcome! I'm glad the roadmap helped, and it's great you're already at step 2. Learning Linux is definitely a solid foundation for DevOps. Your goals of scripting, monitoring, and automating troubleshooting are absolutely achievable. Focus on those, and you'll be well on your way. Good luck!

Collapse
 
prakirth profile image
Prakirth Govardhanam

Thank you very much! l will keep my focus on the end goal :)

Collapse
 
chukwuma_nwakpa_595a2a333 profile image
chukwuma nwakpa

Honestly, documenxtation has to be the major part that got me in this post. Thank you once again for reiterating this very matter.

Collapse
 
devnenyasha profile image
Melody Mbewe

You're very welcome! I'm glad to hear the emphasis on documentation resonated and helped you secure the position. It's often an overlooked but crucial skill.

Collapse
 
kc900201 profile image
KC • Edited

Glad I could help @devnenyasha. Wish we could dive into deeper about the potential usage of WSL. Since I use zsh with WSL nowadays compared to bash, maybe it would be an interesting topic in future about learning other kinds of shell scripts for self customization.

Collapse
 
devnenyasha profile image
Melody Mbewe

Absolutely, KC! A deep dive into WSL and shell customization (especially zsh) sounds like a fantastic follow-up—I’ll definitely explore that soon. If you’ve got any favorite zsh tricks or pain points you’d want covered, let me know! Would love to make it practical for folks who are already leveling up their terminal game.

Collapse
 
kc900201 profile image
KC

Yes, will let you know if I've come up with any ideas. Meanwhile, congratulations on being on one of top 7 featured dev posts of the week

Collapse
 
josephj11 profile image
Joe

I don't do full stack, but I do bash... Documentation is undervalued. It can make good software ten times better because people can figure out how to use it and allows programmers to jump in way faster without making as many design mistakes.

Have you checked out warp-terminal (AI for the CLI)? I haven't used it much yet, but I expect to on my new notebook.

Collapse
 
shadowruge profile image
izaias

Is Debian diatros not use "ethx" interfas use "enp1sx"... your article is great...

Collapse
 
jayden_lee_3c9e95e50152a1 profile image
Jay lee

good job

Collapse
 
jayden_lee_3c9e95e50152a1 profile image
Jay lee • Edited

Good Job
I am also a fullstack web developer.
Please send your email to me.
jaylee518.watcher@gmail.com

Image of Datadog

Get the real story behind DevSecOps

Explore data from thousands of apps to uncover how container image size, deployment frequency, and runtime context affect real-world security. Discover seven key insights that can help you build and ship more secure software.

Read the Report

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay