Linux for DevOps: What to Learn and What to Skip
By Branko Petric - Updated - About 4 weeks at 10 hours a week
The short answer
For DevOps, you need enough Linux to run and repair a server from the command line. That means logging in over SSH, managing users and permissions, running services with systemd, and finding out why something failed. You can skip kernel tuning and distro-hopping. Plan on about 4 weeks at 10 hours a week.
Why Linux comes first
Almost everything later on this roadmap runs on Linux. Docker containers use Linux features. Kubernetes nodes and most cloud servers usually run it too. When any of those break, you end up at a Linux command line, reading logs.
It also gives you fast feedback. You type a command and see what happens. That makes it a better first step than a large tool like Kubernetes, where one error can have many causes.
What to learn, in order
- Move around in the terminal. Learn
ls,cd,cat,less,grep, and pipes (|, which send one command's output into another). Every later step uses these. - Connect with SSH. SSH is how you log in to a remote server. Set up a key pair, because many servers turn off password login.
- Users and permissions. Learn
chmod,chownandsudo. Permission errors are among the most common failures you will meet. - Processes. Learn
ps,topandkill, so you can see what is running and stop it. - Services with systemd. systemd is the program that starts and watches services on most Linux servers. Learn
systemctland how to write a small unit file (the config file for a service). - Logs. Learn
journalctland/var/log. Most troubleshooting starts here. - Disk and memory. Learn
df,duandfree. A full disk is a classic cause of outages. - Packages. Learn
apton Ubuntu, so you can install and update software.
What to skip for now
- Kernel tuning and compiling your own kernel.
- Deep disk topics such as LVM (a way to manage disks) beyond knowing that it exists.
- Linux certifications such as RHCSA.
- Trying lots of distros or customizing your desktop.
None of these will help you pass the test on this page. Some may matter later on the job.
Common mistakes
- Using
chmod 777to make an error go away. It gives everyone full access to the file. Find out which user needs access, then give access only to that user. - Restarting before reading the logs. A restart can hide the cause. Read the logs first, so you know what you are fixing.
- Only watching videos. You do not learn this by watching. Type every command on a machine you can break.
Your project
Create a virtual machine. Set up a user, SSH, and one service. Write down each step as a runbook (a list of steps someone else could follow). Then delete the machine and rebuild it from your notes, twice. Keep the runbook, because you will put it in Git at step 3.
You are done when
You can do all of this with no notes. If you already can, skip this step.
- On a fresh virtual machine, you create a user who logs in with an SSH key, not a password.
- You set file permissions so only that user can read a file, and you can explain the numbers in
chmod 640. - You install a package, run it as a service with systemd, and make it start after a reboot.
- You break that service on purpose, then find the reason in
journalctl -u <service>. - A disk fills up, and you find what is using the space with
df -handdu. You do the same for memory withfree -handtop.
Learn it and test it
Free guides
- Linux for DevOps: The Fundamentals
- Linux File Permissions
- Linux Process and Job Management
- Service Management With systemd
- Linux Logging: journald, syslog, and Log Files
Practice scenarios
- Disk Is at 100% and the App Is Down. rm -rf?
A server is out of disk and the app is down. A teammate wants to rm -rf the logs to free space fast. Defend what you actually do first.
- Deploy Fails with Permission Denied. chmod 777 Everything?
A deploy fails with permission errors and a teammate wants to chmod -R 777 the app directory so it never happens again. Defend fixing the actual ownership mismatch instead.
Common questions
How much Linux do I need for DevOps?
Enough to pass the test on this page: run a service, fix it when it breaks, and find what is using the disk or memory. You do not need to be a Linux administrator before moving on. You will keep learning Linux at every later step.
Which Linux distro should I use to learn DevOps?
Use Ubuntu Server LTS (LTS means long-term support, so it gets updates for years). It is easy to find help for, and the skills carry over to other distros. The main thing that changes between distros is the package manager. Do not spend time comparing distros at this stage.
Can I learn Linux for DevOps on Windows or a Mac?
Yes. On Windows, WSL runs Linux inside Windows. On either system, you can use a virtual machine (a computer simulated inside your computer). A virtual machine is better for this step, because you can break it and rebuild it without any risk to your own computer.
Practice defending your decisions
DevOps Ledger is a scenario-based DevOps and SRE interview practice platform: you pick a real production incident, defend your decision in a chat against a senior-engineer AI that pushes back, and get scored against an answer key written before you started.
One payment. 12 months of access. No subscription, nothing renews.
Get full access - $19