Your Progress
Linux SysAdmin Deep Dive: Building a Production-Ready Server from Scratch
From blank Ubuntu VM to fully monitored, hardened, Dockerized server
This project documents my journey of setting up an Ubuntu Server 24.04 ARM64 virtual machine on UTM (MacBook Air), then systematically learning and applying every fundamental Linux sysadmin skill: filesystem navigation, user management, bash scripting, process control, networking, security hardening, disk management, monitoring, and Docker. Every phase includes real scripts I wrote, real terminal output, and real lessons learned.
Before vs. After This Project
❌ Basic Student Project
✅ Production-Ready Project
✗Afraid of the terminal
✓Comfortable navigating any Linux system
✗No idea how permissions work
✓Can audit and fix file permissions confidently
✗Copy-paste bash commands
✓Write production-ready bash scripts from scratch
✗No understanding of systemd
✓Create and manage custom systemd services
✗Server security is a mystery
✓Hardened SSH, firewall rules, fail2ban setup
✗No disk management knowledge
✓LVM, inode monitoring, swap management
✗No monitoring or alerting
✓Automated metrics collection and threshold alerts
✗Docker is just a buzzword
✓Build images, run containers, port mapping
✗Afraid of the terminal
✓Comfortable navigating any Linux system
✗No idea how permissions work
✓Can audit and fix file permissions confidently
✗Copy-paste bash commands
✓Write production-ready bash scripts from scratch
✗No understanding of systemd
✓Create and manage custom systemd services
✗Server security is a mystery
✓Hardened SSH, firewall rules, fail2ban setup
✗No disk management knowledge
✓LVM, inode monitoring, swap management
✗No monitoring or alerting
✓Automated metrics collection and threshold alerts
✗Docker is just a buzzword
✓Build images, run containers, port mapping
Technologies Used
Ubuntu Server
24.04 LTS ARM64
Bash
Shell scripting
SSH
Secure remote access
UFW
Firewall management
systemd
Service management
Docker
Containerization
cron
Task scheduling
LVM
Logical Volume Manager
Lab Environment
- OS: Ubuntu Server 24.04 LTS (ARM64)
- Hypervisor: UTM on MacBook Air (Apple Silicon)
- Connection: SSH from macOS terminal into the VM
- Username: charith
- IP Address: 192.168.64.3
Key Takeaway
The entire project runs on a headless Ubuntu Server VM with no GUI. Everything is done through SSH and the command line. This is how real servers work in production — there is no desktop environment, just a terminal.
Phase 1: Linux Foundations
Before you can manage a Linux server, you need to understand its foundations: the filesystem hierarchy, user and group management, file permissions, and the package management system. This phase explores all of these through hands-on scripts and exercises.
Click the Play button above to start!
Watch the commands execute step by step
/etc is the city hall (all the configuration), /var/log is the security cameras (all the logs), /home is the residential area, and /tmp is a whiteboard that gets erased each night.Key Takeaway
Permissions matter more than you think. chmod changes file permissions, chown changes file ownership. SUID (Set User ID) lets a file run as its owner — that is why /usr/bin/passwd can modify /etc/shadow even when run by a normal user. SGID works the same way but for group permissions. Always audit SUID binaries on production servers.
Warning
chmod 777 on any file. This gives read, write, and execute permissions to everyone on the system. It is the equivalent of leaving your front door wide open with a sign that says "come on in." If you see 777 permissions in production, treat it as a security incident.Did You Know?
/ (called "root"). Unlike Windows, there are no drive letters like C: or D:. Everything, including external drives and network shares, is mounted somewhere under this single tree. The command mount shows you where every device is attached.Phase 2: Bash Scripting
Bash scripting is the duct tape of system administration. It lets you automate repetitive tasks, build monitoring tools, and chain commands together into powerful workflows. In this phase, I moved beyond running individual commands and started building real tools — a log analyzer, a backup system, and a live system monitor.
Click the Play button above to start!
Watch the commands execute step by step
Key Takeaway
Always start your scripts with set -euo pipefail. This is your safety net. -e exits on any error, -u treats unset variables as errors, and -o pipefail catches failures in piped commands. Without this, a script can silently fail halfway through and keep running, causing real damage on a production server.
Did You Know?
cmd1 | cmd2 | cmd3) is one of the most powerful ideas in computing. Each command does one small thing well, and the pipe connects them. For example, grep "error" syslog | sort | uniq -c | sort -rn | head -5 finds errors, sorts them, counts unique entries, sorts by count, and shows the top 5 — all in a single line. This "small tools connected by pipes" philosophy is the Unix Way.Phase 3: Process & Service Management
Everything running on a Linux system is a process. Understanding how processes work, how to inspect them, how to manage them with systemd, and how to troubleshoot stuck or zombie processes is essential for any sysadmin. This phase covers the entire lifecycle: from PID 1 (systemd) to creating your own custom services.
Click the Play button above to start!
Watch the commands execute step by step
Key Takeaway
kill vs kill -9: know the difference. By default, kill sends SIGTERM (signal 15), which politely asks a process to shut down and lets it clean up (save files, close connections, release locks). kill -9 sends SIGKILL, which immediately terminates the process with no chance to clean up. Always try SIGTERM first. Only use SIGKILL as a last resort when a process is truly unresponsive.
Did You Know?
wait() system call). You can spot them with ps aux | grep Z. A few zombies are harmless, but thousands of them can exhaust the PID table and prevent new processes from starting. The fix is usually to kill or restart the parent process.Restart=always does in a unit file.Phase 4: Networking & Security
A server connected to a network is a target. This phase covers hardening the server against attacks: configuring the UFW firewall, locking down SSH, running a comprehensive security audit, and understanding fail2ban. Security is not a one-time task — it is a continuous process of auditing, hardening, and monitoring.
Click the Play button above to start!
Watch the commands execute step by step
Warning
Click the Play button above to start!
Watch the commands execute step by step
Key Takeaway
SSH hardening checklist: (1) Disable root login with PermitRootLogin no. (2) Limit auth attempts with MaxAuthTries 3. (3) Disable password auth with PasswordAuthentication no. (4) Require SSH keys with PubkeyAuthentication yes. These four settings eliminate the vast majority of SSH-based attacks.
Did You Know?
/var/log/auth.log) in real time and adds temporary firewall rules to block offending IPs. The default configuration bans an IP for 10 minutes after 5 failed SSH attempts. On internet-facing servers, fail2ban blocks thousands of brute-force attempts per day — it is one of the first things you should install on any public server.Phase 5: Storage & Disk Management
Running out of disk space at 3 AM is every sysadmin's nightmare. This phase covers LVM (Logical Volume Manager) for flexible disk management, inode monitoring, swap configuration, and building an automated disk monitoring script that catches problems before they become outages.
/home partition fills up, you are stuck even if /var has plenty of free space. With LVM, you can dynamically grow or shrink volumes without downtime.Click the Play button above to start!
Watch the commands execute step by step
Key Takeaway
Inode exhaustion is a silent killer. Every file and directory on a Linux filesystem uses one inode. You can run out of inodes even when you have plenty of disk space — this typically happens when an application creates millions of tiny files (like mail queues or session files). The command df -i shows inode usage. If IUse% hits 100%, no new files can be created even if the disk is 50% empty.
Did You Know?
rm on a large file, the disk space is not immediately freed if any process still has the file open. Linux only releases the space when the last file descriptor is closed. This is why df sometimes shows a disk as full even after you have deleted files. The fix is to restart the process that had the file open, or use lsof +L1 to find deleted files still held open.df -i command is like checking how many blank catalog cards remain.Phase 6: Monitoring, Alerting & Docker
The final phase ties everything together. First, we build an automated monitoring and alerting system that collects metrics via cron and triggers alerts when thresholds are breached. Then, we explore Docker to containerize applications on our server. This phase represents the transition from managing a server to operating one.
Monitoring & Alerting
Docker Containerization
Click the Play button above to start!
Watch the commands execute step by step
Key Takeaway
Port mapping: -p 8080:80 means "connect port 8080 on the host to port 80 inside the container." The format is always HOST_PORT:CONTAINER_PORT. When you visit http://server:8080, the traffic enters port 8080 on the host machine, Docker forwards it to port 80 inside the container, and Nginx (listening on port 80 inside the container) handles the request.
Did You Know?
What I Learned The Hard Way
Always test firewall rules before enabling UFW
I locked myself out of my own VM once by enabling UFW without allowing SSH first. Had to access the VM console through UTM to fix it. On a remote cloud server, this mistake could mean a support ticket and hours of downtime.
rm -rf / protection exists for a reason
Modern Linux distributions have safeguards against rm -rf /, but rm -rf /* (with the asterisk) bypasses them. I learned to always double-check destructive commands, use rm -i for interactive confirmation, and never run anything as root unless absolutely necessary.
Bash scripts fail silently without set -euo pipefail
I had a backup script that was silently failing for weeks because a directory did not exist. Without set -e, the script continued past the error and reported success. The backups were empty. Now every script starts with set -euo pipefail.
Log files can fill up a disk faster than you think
A misconfigured service was logging every request at DEBUG level, generating 2 GB of logs per hour. The disk filled up overnight. I learned to always configure log rotation (logrotate) and monitor /var/log sizes.
Docker containers are ephemeral by default
I stored important data inside a container, then ran docker rm and lost everything. Containers are disposable — any data that needs to persist must be stored in Docker volumes or bind mounts, not inside the container filesystem.
Final Quiz: Test Your Knowledge
10 questions covering every phase of the project. Score 80% or higher to celebrate!
Linux SysAdmin Deep Dive — Final Quiz
What directory stores all system configuration files on Linux?
Review Flashcards
15 flashcards to help you memorize key Linux sysadmin concepts. Click a card to flip it.
Linux SysAdmin Key Concepts
Click any card to flip and reveal the definition.
View Source Code
All scripts, configuration files, and documentation from this project are available on GitHub. Explore the complete source code, try the scripts on your own VM, and follow along with each phase.
View on GitHub