Why Linux? Troubleshoot Services, Automate Tasks, and Mirror Production Locally
This article explains why Linux is valuable for backend developers and server operators, covering the kernel vs. distributions, troubleshooting services with ps, ss, curl, and journalctl, managing file permissions, automating repetitive tasks with scripts and cron, ensuring local development matches production environments, and a hands-on Python HTTP server demo.
What We Install as Linux
Strictly speaking, Linux is the kernel . Programs request memory, read/write disks, or send/receive data via network cards — all managed by the kernel. Ubuntu, Debian, Fedora are distributions . They package the Linux kernel, a package manager, and common tools into an installable system; some include a graphical desktop.
Because the Linux kernel source is open, distributions can select components and maintenance strategies for different needs. A web server can install only the application and management tools, omitting the desktop entirely. For a laptop, a desktop-enabled variant works. For a long-running server, the length of security updates a distribution provides is a practical selection criterion. Distributions like Debian are free; enterprises may choose commercially supported variants.
Distributions also supply daily maintenance tools. For example, on Ubuntu, APT installs Nginx from configured repositories and pulls in its dependencies. Distributions deliver security updates through repositories, letting teams patch servers as a routine task.
When Services Fail, Follow the Clues
When a site is unreachable, first use ps to check the service process, then ss to verify the expected port is listening, and finally curl to send an HTTP request from the local machine. If local access works but external access fails, trace the request path: check which address the service binds to, or whether the reverse proxy forwards to the correct port.
On a systemd machine, if Nginx is managed by nginx.service, run journalctl -u nginx -n 30 to see recent logs. If the log points to a syntax error on a specific config line, you know where to fix. All these checks work over SSH after remote login.
Once the service runs, assign it a dedicated runtime account. For instance, set the web-root directory read-only and the upload directory writable. File read/write permissions can be tailored to actual needs.
Hand Repetitive Work to Scripts
Backing up a database once is quick. Doing it daily across three machines and tracking which machine failed on which day is another matter. Chain export, compression, and verification in a script, then schedule it with cron or a systemd timer. Periodically test-restore backups to confirm they are usable.
Store scripts and configs in Git to trace changes — e.g., when the backup directory or schedule was altered. When rebuilding a machine, a new teammate can follow the already-verified steps. Log key parameters and results during execution so a failed backup can be traced to the exact step that broke.
Local Development Closer to Server Environment
You write code on Windows but it runs on a Linux server. Code references Config.json while the file is actually named config.json. On a case-insensitive local filesystem the code runs; on a case-sensitive deployment it fails. File permissions and script line endings cause similar issues. Running a test pass in a Linux environment catches these differences early.
If the project uses containers, run the same image locally and in production to keep the application, language runtime, and container dependencies consistent. Database addresses, environment variables, and persistent-data mount paths are configured per environment.
Run a Local Web Service Yourself
In a Linux terminal with Python 3, curl, and ss (from iproute2), you can run a quick experiment. The following commands create a temporary directory, write a page, and start a server listening on 127.0.0.1:8000. If port 8000 is busy, use 8001 and adjust the subsequent commands accordingly.
demo_dir=$(mktemp -d) &&
printf 'Hello, Linux!
' > "$demo_dir/index.html" &&
python3 -m http.server 8000 \
--bind 127.0.0.1 \
--directory "$demo_dir"Keep it running, open another terminal, and run curl http://127.0.0.1:8000/. Seeing Hello, Linux! confirms the local machine can fetch the page. Then run ss -ltn 'sport = :8000' to check which TCP services are listening on that port.
Live test of local HTTP request on Debian
To see what happens when the service stops, return to the first terminal, press Ctrl+C , then run curl again. The web file remains, but the listening process has exited, so the request reports a connection failure.
Should You Switch Your Computer to Linux?
If your goal is deploying websites, running personal services, or learning operations, start with file permissions, processes, ports, and logs. On Windows, use WSL 2 to open an Ubuntu terminal and practice the examples above.
If daily work revolves around office tasks, gaming, or software and peripherals that lack Linux support, check compatibility first. Try a Linux desktop in a virtual machine; switch to it as a primary system only after it feels comfortable.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
