Linux servers power websites, databases, cloud platforms, enterprise applications, network services, and many other parts of modern IT infrastructure.
Managing a Linux server involves much more than executing terminal commands. A system administrator must understand users and permissions, services, networking, storage, security, monitoring, backups, and troubleshooting.
This guide explains the essential responsibilities of Linux server administration through practical examples and commands. It covers Ubuntu, Debian, and Red Hat Enterprise Linux (RHEL)-based environments, while highlighting differences where commands and configurations vary between distributions.
Whether you are learning Linux administration or maintaining production infrastructure, this guide provides a structured foundation for managing Linux servers reliably.
Linux server administration is the process of installing, configuring, maintaining, securing, monitoring, and troubleshooting Linux-based servers.
A Linux administrator is typically responsible for:
These responsibilities are interconnected.
For example, an application may become unavailable because a systemd service has stopped, a filesystem is full, a firewall blocks its listening port, or DNS resolves the hostname incorrectly.
Effective administration requires understanding how these components interact rather than investigating each problem in isolation.
A Linux server consists of several interacting layers:
Applications and Services
|
v
System Libraries and Utilities
|
v
Linux Kernel
|
v
Hardware or Virtual Resources The kernel manages processes, memory, devices, filesystems, and networking. User-space applications provide services such as web hosting, databases, remote administration, and monitoring.
Different distributions provide different package managers, configuration conventions, release cycles, and security tools.
| Distribution | Package Manager | Common Use |
|---|---|---|
| Ubuntu Server | APT | Cloud servers, applications, general infrastructure |
| Debian | APT | Stable servers and infrastructure services |
| RHEL | DNF | Enterprise environments |
| Rocky Linux | DNF | Enterprise-compatible server environments |
| AlmaLinux | DNF | Enterprise-compatible server environments |
The choice depends on application compatibility, support requirements, operational experience, and organizational policies.
For administrators working with Ubuntu and Debian, understanding APT is essential. RHEL-based systems commonly use DNF and associated repository-management tools.
Linux organizes files and directories under a single root directory:
/
├── etc
├── home
├── root
├── var
├── usr
├── tmp
├── boot
└── opt Some important directories include:
| Directory | Purpose |
|---|---|
/etc | System and application configuration |
/home | Regular users’ home directories |
/root | Root user’s home directory |
/var | Logs, caches, queues, and changing application data |
/tmp | Temporary files |
/usr | User-space applications and shared resources |
/boot | Boot-related files |
Use the following commands to inspect the filesystem:
ls -lah /
df -hT
lsblk -f
findmnt Filesystem layouts, permissions, mounts, and storage management deserve deeper coverage. See the dedicated Linux File System Explained guide.
After installing a Linux server, administrators should verify its identity, updates, time configuration, network connectivity, and administrative access.
hostnamectl
cat /etc/os-release
uname -r These commands display the system hostname, distribution information, and running kernel version.
Set a hostname when needed:
sudo hostnamectl set-hostname server01.example.com The selected hostname should follow the organization’s naming convention and should be consistent with DNS and inventory records.
On Ubuntu and Debian:
sudo apt update
sudo apt upgrade On RHEL-based distributions:
sudo dnf check-update
sudo dnf upgrade Review package changes before applying them to production systems. Updates may require service restarts or a planned reboot.
Check pending reboot requirements according to the distribution’s package and system-management tools.
Accurate system time is important for authentication, logs, certificates, distributed applications, and troubleshooting.
Check the current time configuration:
timedatectl status A production server should use a reliable time synchronization source appropriate for its environment.
Before installing applications, make sure the server has the expected IP configuration, default gateway, and DNS resolution.
Useful commands include:
ip -br addr
ip route
resolvectl status
getent hosts example.com The actual network configuration method depends on the distribution and network-management service.
For more advanced networking, routing, and diagnostic commands, see Linux Network Tools Guide.
User and privilege management is one of the most important parts of server administration.
Every administrative action should be performed through an authorized account with only the privileges required for the task.
A common method on many Linux distributions is:
sudo useradd -m -s /bin/bash adminuser
sudo passwd adminuser The -m option creates a home directory, while -s specifies the login shell.
Distribution-specific account-management utilities may provide additional defaults.
Groups allow administrators to assign shared access permissions to multiple users.
Create a group:
sudo groupadd webadmins Add a user to an additional group:
sudo usermod -aG webadmins adminuser The -aG options append the group membership rather than replacing the user’s supplementary groups.
Verify membership:
id adminuser
groups adminuser The root account has unrestricted administrative privileges.
Instead of using a root login for everyday administration, many distributions encourage using an authorized account with sudo.
For example:
sudo systemctl status ssh On Ubuntu and Debian, administrative users commonly belong to the sudo group. RHEL-based systems commonly use the wheel group.
Always verify the actual sudo policy before granting administrative privileges.
Linux files have three basic permission classes:
The traditional permissions are:
| Permission | Meaning | Numeric Value |
|---|---|---|
Read (r) | Read file or list directory | 4 |
Write (w) | Modify file or directory entries | 2 |
Execute (x) | Execute file or traverse directory | 1 |
For example:
chmod 750 backup.sh This grants:
Change file ownership using:
sudo chown adminuser:webadmins backup.sh Inspect permissions with:
ls -l backup.sh Avoid using chmod 777 as a general permission fix. It gives every local user read, write, and execute permissions and can expose sensitive files or services.
Secure Shell (SSH) is widely used for remote administration of Linux servers.
A basic connection looks like this:
ssh adminuser@192.0.2.10 Replace the example address with the real server address.
SSH key authentication uses a private key on the client and a corresponding public key authorized by the server.
Generate an Ed25519 key pair on the client:
ssh-keygen -t ed25519 -C "admin-laptop" Copy the public key to the server using an approved method. Where available, ssh-copy-id can simplify this process:
ssh-copy-id adminuser@192.0.2.10 Test the key-based login in a separate session before changing authentication settings.
Common SSH security measures include:
SSH server configuration is commonly stored in:
/etc/ssh/sshd_config Additional configuration files may be included from:
/etc/ssh/sshd_config.d/ For example, a security policy may require:
PermitRootLogin no
PasswordAuthentication no Do not disable password authentication until key-based access has been tested and you have a recovery path, such as console or out-of-band access.
After editing the configuration, validate it:
sudo sshd -t Only after a successful validation should you reload the SSH service. The service unit is commonly named ssh on Ubuntu and Debian and sshd on RHEL-based systems.
For the full configuration reference, consult the OpenSSH documentation.
Modern Linux distributions commonly use systemd to manage system services and startup behavior.
A service is a background process that performs a particular task, such as running a web server, database, SSH daemon, or monitoring agent.
systemctl status ssh On a system where the service is named sshd, use:
systemctl status sshd sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx Reload a service’s configuration when the application supports it:
sudo systemctl reload nginx A reload is not the same as a restart. A restart stops and starts the service, while a reload asks the service to read its configuration again.
sudo systemctl enable nginx Enable and start a service together:
sudo systemctl enable --now nginx Check whether a service is enabled:
systemctl is-enabled nginx List currently running service units:
systemctl list-units --type=service --state=running systemd manages different unit types, including:
.service for services..socket for socket activation..timer for scheduled activation..mount for filesystem mount points..target for grouping units.Inspect a service definition:
systemctl cat nginx When a custom unit is created or modified, systemd may need to reload its unit definitions:
sudo systemctl daemon-reload Use the distribution’s systemd documentation and service-specific instructions before changing production unit dependencies or startup behavior.
Logs provide information about system activity, service failures, authentication problems, hardware events, and application behavior.
Many systemd-based distributions use systemd-journald for collecting and querying journal entries.
sudo journalctl View logs from the current boot:
sudo journalctl -b Show recent errors:
sudo journalctl -p err -b Follow new journal entries:
sudo journalctl -f View logs for a particular service:
sudo journalctl -u nginx Show logs from today:
sudo journalctl --since today Some distributions and applications also write logs to files under:
/var/log/ A useful workflow is:
systemctl status nginx
sudo journalctl -u nginx -n 100 --no-pager
sudo nginx -t The last command is specific to Nginx. Other applications have their own configuration-validation commands.
Check the service’s status, examine recent logs, validate the configuration, and identify the underlying failure before restarting repeatedly.
Linux servers rely on network configuration to communicate with users, databases, cloud services, DNS resolvers, and other infrastructure components.
An administrator should understand network interfaces, IP addresses, routing, DNS, listening sockets, and firewall policies.
ip -br addr
ip link show ip route
ip route get 192.0.2.20 These commands display the routing table and the route selected for a destination.
getent hosts example.com
resolvectl query example.com The available resolver tools depend on the system’s configuration.
sudo ss -tulpn This helps identify which services are listening on TCP or UDP ports.
ping -c 4 192.0.2.1 Test an application endpoint:
curl -I https://example.com A failed ping does not always mean a destination is unavailable; ICMP may be filtered. Use application-level tests where possible.
Network configuration may be managed through Netplan, NetworkManager, systemd-networkd, or distribution-specific tools.
For deeper coverage of network namespaces, routing, interfaces, and troubleshooting, use the dedicated CorgiNetwork guides:
A Linux server should expose only the network services required by its role.
Firewall policies help control inbound and outbound traffic, reducing unnecessary network exposure.
On systems using UFW, check the current rules:
sudo ufw status verbose Before enabling the firewall on a remote server, allow the management connection and confirm that the current access method will remain available.
For an SSH service using the default port:
sudo ufw allow 22/tcp Then enable the firewall only after reviewing the policy:
sudo ufw enable Verify the resulting rules:
sudo ufw status numbered The required rules depend on the server role. A web server may need HTTP and HTTPS access, while a database server may need to accept connections only from designated application hosts.
nftables is a native Linux packet-filtering framework used to implement firewall and traffic-filtering policies.
Its rules and chains should be designed according to the network architecture, application requirements, and existing firewall-management tools.
Avoid managing overlapping firewall systems without understanding which service owns the active ruleset.
For more detailed configuration and practical firewall examples, see Firewalls Explained.
Good server hardening practices include:
Linux distributions may use mandatory access-control systems to enforce security policies beyond traditional file permissions.
SELinux is widely used in RHEL-based environments.
AppArmor is commonly used in Ubuntu and other distributions.
These mechanisms can restrict what processes are allowed to access, even when traditional Unix permissions would otherwise permit access.
Do not disable a mandatory access-control system simply because an application fails. Investigate the relevant policy and audit messages before changing enforcement settings.
Administrators must monitor storage capacity, CPU utilization, memory consumption, process activity, and system load.
A server can become unavailable even when its application configuration is correct, simply because it has run out of disk space or memory.
Check mounted filesystems:
df -hT Inspect block devices:
lsblk -f Check directory usage:
sudo du -xhd1 /var Find large files or directories before deciding what can safely be removed.
Never delete files from active database, application, or system directories without understanding their purpose.
Logical Volume Manager (LVM) provides flexible management of storage volumes.
Typical LVM components include:
Inspect existing LVM configuration:
sudo pvs
sudo vgs
sudo lvs Before resizing volumes or filesystems, verify available capacity, filesystem support, and backup status.
Useful commands include:
top
ps aux
uptime For CPU and process scheduling statistics, vmstat may also be useful:
vmstat 1 free -h Linux uses available memory for caching and buffers. Therefore, low values in the free column do not automatically indicate a memory problem.
Review available memory, swap activity, process usage, and system behavior together.
The following command helps identify active listening sockets:
sudo ss -s For more detailed network traffic and performance investigation, use specialized diagnostic tools rather than relying on a single command.
A production Linux server needs a backup and recovery strategy.
A backup should protect important data and configuration while allowing administrators to restore the service after accidental deletion, hardware failure, software errors, or security incidents.
Important backup targets may include:
/etcA robust backup plan should define:
Use a separate backup destination rather than relying only on another directory on the same server.
For a simple file-copy example:
sudo rsync -aHAX --numeric-ids /etc/ /mnt/backup/server01/etc/ This example assumes /mnt/backup is already mounted and is an appropriate destination.
It is not a complete backup strategy. Databases and applications may require application-aware backup procedures to ensure consistent recovery.
A backup is not reliable simply because a scheduled job reports success.
Periodically restore files or services in a controlled environment and verify that the restored data is usable.
Record the recovery procedure and make sure authorized administrators can access the backup destination during an incident.
Automation helps administrators apply consistent configurations and reduce repetitive manual work.
Shell scripts can automate routine tasks such as checking disk usage, collecting system information, and running maintenance commands.
Example:
#!/usr/bin/env bash
set -u
echo "Server: $(hostname)"
echo "Date: $(date)"
echo
echo "Filesystem usage:"
df -hT
echo
echo "Memory:"
free -h
echo
echo "System uptime:"
uptime Save the script as server-report.sh and make it executable:
chmod 750 server-report.sh Run it:
./server-report.sh Scripts that modify production systems should include input validation, logging, error handling, and appropriate permission checks.
Cron can execute recurring commands according to a schedule.
Edit the current user’s crontab:
crontab -e For example, the following entry runs a script at 02:00 every day:
0 2 * * * /usr/local/sbin/server-maintenance.sh A scheduled task should use absolute paths and send output to a controlled logging destination.
A successful cron configuration does not guarantee that the script itself will succeed. Check its logs and exit status.
Ansible can automate configuration across multiple Linux servers.
Common tasks include:
Configuration management is especially valuable when multiple servers must maintain consistent settings.
For more advanced automation and infrastructure deployment, see Infrastructure as Code Explained.
A structured troubleshooting process helps isolate problems before changes are made.
Start by identifying the affected component, checking recent changes, collecting logs, and testing one hypothesis at a time.
Possible causes include:
Check:
systemctl status ssh
sudo ss -tlnp On RHEL-based systems, check sshd instead of ssh when appropriate.
Then investigate firewall rules and network connectivity.
Possible causes include:
Check the service and its logs:
systemctl status nginx
sudo journalctl -u nginx -n 100 --no-pager
sudo ss -tlnp For Nginx, validate the configuration:
sudo nginx -t Test hostname resolution:
getent hosts example.com Query a configured DNS resolver with appropriate tools:
dig example.com A Investigate the resolver configuration, authoritative response, routing, and firewall policy.
See DNS Explained for the broader DNS architecture and How DNS Resolution Works for the query process.
Check filesystem usage:
df -hT Identify large directories:
sudo du -xhd1 /var Inspect log growth, application data, temporary files, and backup retention.
Do not blindly delete logs or database files. Identify the responsible application and use its documented cleanup process.
Check the overall system load:
uptime
top
free -h
vmstat 1 Investigate CPU saturation, memory pressure, swap usage, storage capacity, disk latency, and network activity.
A high load average does not automatically mean CPU utilization is high. The number must be interpreted in the context of the server’s workload and processor capacity.
Check:
systemctl status service-name
sudo journalctl -u service-name -n 100 --no-pager Look for configuration errors, missing dependencies, permission problems, unavailable ports, or application-specific failures.
Identify listening processes:
sudo ss -tulpn Determine which service owns the required port before changing application configuration or stopping processes.
Use the following sequence:
Identify the symptom
|
v
Check recent changes
|
v
Inspect service status
|
v
Review system and application logs
|
v
Check CPU, memory and storage
|
v
Check network, DNS and firewall
|
v
Apply one controlled correction
|
v
Verify the service and document the result The objective is to identify the root cause, not simply to restart the server and hope the problem disappears.
Reliable administration requires consistent operational practices.
Monitor the following areas:
| Area | What to Monitor |
|---|---|
| CPU | Utilization and sustained saturation |
| Memory | Available memory, swap, and pressure |
| Storage | Filesystem capacity and growth |
| Network | Interface errors, traffic, and connectivity |
| Services | Availability and failure states |
| Logs | Repeated errors and security events |
| Backups | Completion and restore verification |
Monitoring should provide enough information to identify problems early and support effective troubleshooting.
Use this checklist when reviewing a new or existing Linux server.
Initial configuration
User management
Security
Operations
Documentation
Linux server administration is the management, maintenance, security, monitoring, and troubleshooting of Linux-based servers.
There is no single best distribution for every environment. Ubuntu Server and Debian are widely used, while RHEL and compatible distributions are common in enterprise environments. The choice depends on support, compatibility, policies, and operational requirements.
Important commands include ip, ss, systemctl, journalctl, df, du, lsblk, free, top, ps, find, and grep.
Use:
systemctl status service-name Replace service-name with the actual systemd service unit.
On systemd-based systems, use:
journalctl -b To inspect a particular service:
journalctl -u service-name Use key-based authentication where appropriate, restrict authorized users, avoid unnecessary root access, apply updates, and validate configuration changes before reloading the SSH service.
Both are Linux mandatory access-control systems. They enforce security policies that restrict what processes can access beyond traditional Unix permissions, but they use different policy models and administration tools.
Common causes include CPU saturation, memory pressure, excessive disk I/O, full filesystems, network problems, and malfunctioning services. Check system metrics and logs before changing configuration.
Security updates should be applied according to the server’s risk, distribution policy, and maintenance process. Production updates should be tested and monitored, with appropriate backup and recovery arrangements.
Yes. Backups are essential for recovering from accidental deletion, hardware failures, software problems, and security incidents. They should be stored separately and tested regularly.
Linux server administration combines operating-system knowledge, networking, security, storage management, automation, and troubleshooting.
A reliable administrator must understand not only how to execute commands, but also how system components interact and how changes can affect production services.
Start with secure user management, SSH, package updates, service administration, and network configuration. Then build stronger skills in monitoring, storage, automation, backups, and recovery.
Consistent documentation, controlled changes, and tested recovery procedures help maintain Linux servers that are secure, available, and easier to operate.
The following official and technical references provide additional information:
Introduction Border Gateway Protocol (BGP) is the routing protocol used to exchange network reachability information…
Introduction A Linux server can experience connection failures even when its network interface is working…
Introduction TCP retransmissions are an important indicator of network reliability and performance. When a Linux…
Open Shortest Path First (OSPF) is a link-state routing protocol widely used in enterprise networks…
Group Policy is one of the most important management features in Windows Server Active Directory…
Windows DNS servers play an essential role in Active Directory environments, allowing computers, servers, applications,…