Linux Filesystem Hierarchy (FHS): Where Everything Lives
A practical map of the FHS standard directories, what goes in each, and why the layout matters for server administration.
Netbay Infrastructure Team
Netbay Engineering
On this page
When you SSH into a fresh Linux VPS, you are dropped into a maze of directories that all look vaguely familiar but are nothing like Windows drive letters. The Filesystem Hierarchy Standard (FHS) defines where every type of file belongs. Knowing this layout is not academic trivia, it directly affects how you configure services, back up data, and troubleshoot broken deployments.
The Root Directory
Everything starts at /. Unlike Windows, there is no C: drive or D: drive. All mounted filesystems, disks, and network shares appear as subdirectories under root. This unified namespace is one of Linux's greatest strengths, and it is also why you must understand what belongs where.
Essential System Directories
/bin and /sbin contain essential binaries. On modern distributions using systemd, both are often symlinks to /usr/bin and /usr/sbin respectively. /boot holds the kernel, initramfs, and bootloader configuration. Never edit files here unless you know exactly what you are doing.
/etc is the system configuration directory. Every service you install stores its configuration files here. When you edit /etc/ssh/sshd_config or /etc/nginx/nginx.conf, you are working in this tree. Backing up /etc is one of the most important tasks when managing a VPS.
/var is where variable data lives: logs in /var/log, web content in /var/www, mail spools, and database files. This directory can grow significantly and is often placed on a separate partition in production environments.
User Space Directories
/home is where regular users keep their files. Each user gets a subdirectory like /home/deploy. The root user's home is /root, not /home/root. System service accounts often have /nonexistent or /var/lib/anything as their home to prevent them from leaving files around.
/usr contains user-space programs and data. /usr/local is reserved for software you compile or install outside the package manager. If you install Node.js from a tarball, it goes into /usr/local/bin and its libraries into /usr/local/lib.
/opt is for large third-party applications. Some vendors prefer /opt over /usr/local because it keeps all their files in one subtree rather than scattering them across /usr/bin, /usr/lib, and /etc.
Runtime and Temporary Directories
/tmp is world-writable temporary space. Modern systems often mount it as tmpfs, meaning it lives in RAM and is cleared on reboot. /run holds runtime data like PID files and socket files. Systemd mounts this as tmpfs as well.
/proc and /sys are virtual filesystems. /proc exposes process information and kernel parameters. Running cat /proc/cpuinfo shows your CPU details. /sys exposes kernel device and driver information. These directories do not exist on disk; the kernel generates them on the fly.
Putting It Into Practice
When you deploy a web application, its components scatter across the FHS: the application binary goes to /usr/local/bin, configuration to /etc/myapp/, logs to /var/log/myapp/, static files to /var/www/myapp/, and runtime sockets to /run/myapp/. Understanding this layout means you can diagnose issues quickly and set up proper log rotation, backups, and monitoring.
ls -la /etc/nginx/
cat /etc/nginx/nginx.conf
journalctl -u nginx --since "1 hour ago"If a service fails to start, check journalctl -u servicename first, then verify that the configuration files in /etc are syntactically correct, and finally confirm that the binary exists in /usr/bin or /usr/local/bin.
Takeaway
The FHS is a map that turns random directory hunting into structured troubleshooting. Memorize the major directories, know what lives in each, and server administration becomes dramatically more predictable. Start exploring the filesystem on a fresh Netbay Linux VPS at netbayhosts.in.
Keep reading
Follow along on a real VPS
Deploy Linux in under 60 seconds
These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.
Deploy an instance