Common Linux Server Issues and Solutions

A guide to troubleshooting frequent problems on Linux servers

1. High CPU Usage

Issue: Server is running slow due to high CPU usage

Symptoms: Slow response times, high load average, processes using excessive CPU

Solution:

  1. Identify high CPU processes: top or htop
  2. Check process details: ps aux | grep [process_name]
  3. Analyze system load: uptime
  4. Review CPU info: lscpu
  5. Consider terminating or restarting problematic processes
  6. Investigate potential malware or cryptojacking

2. Disk Space Issues

Issue: Server running out of disk space

Symptoms: "No space left on device" errors, system instability

Solution:

  1. Check disk usage: df -h
  2. Find large files/directories: du -sh /* | sort -rh | head -n 10
  3. Clear package manager cache (e.g., apt clean for Debian-based systems)
  4. Remove old log files: find /var/log -type f -name "*.log" -mtime +30 -delete
  5. Clear temporary files: rm -rf /tmp/*
  6. Uninstall unnecessary packages
  7. Consider expanding disk space if needed

3. Network Connectivity Problems

Issue: Server can't connect to network or specific services

Symptoms: Unable to ping, slow or no internet access, service timeouts

Solution:

  1. Check network interface status: ip a
  2. Verify DNS resolution: nslookup example.com
  3. Test connectivity: ping 8.8.8.8
  4. Check routing table: route -n
  5. Verify firewall rules: iptables -L or ufw status
  6. Restart network service: systemctl restart networking
  7. Check for hardware issues (cables, network card)

4. Memory (RAM) Issues

Issue: Server running out of memory or experiencing high memory usage

Symptoms: Out of memory errors, system slowdowns, frequent swapping

Solution:

  1. Check memory usage: free -m
  2. Identify memory-hungry processes: top (sort by memory usage)
  3. Analyze detailed memory info: vmstat
  4. Check for memory leaks: valgrind (for specific applications)
  5. Adjust kernel swappiness: sysctl vm.swappiness=10
  6. Consider increasing RAM or optimizing applications

5. Permission and Ownership Problems

Issue: Access denied errors or applications failing due to permissions

Symptoms: "Permission denied" errors, services unable to read/write files

Solution:

  1. Check file permissions: ls -l [file/directory]
  2. Verify file ownership: ls -ln [file/directory]
  3. Modify permissions if needed: chmod [permissions] [file/directory]
  4. Change ownership if required: chown [user]:[group] [file/directory]
  5. Check SELinux status (if applicable): getenforce
  6. Review application logs for specific permission errors

6. Service Failures

Issue: Critical services (e.g., web server, database) not starting or crashing

Symptoms: Service-specific errors, application downtime

Solution:

  1. Check service status: systemctl status [service_name]
  2. Review service logs: journalctl -u [service_name]
  3. Verify configuration files for syntax errors
  4. Check for conflicting processes or port usage: netstat -tulpn
  5. Restart the service: systemctl restart [service_name]
  6. Investigate dependencies and ensure they're running

Additional Resources






Scroll to Top