Linux Server Monitoring and Maintenance Essentials
Learn to monitor system resources, manage logs, configure automatic security updates, and set up basic alerting with cron jobs on your Ubuntu server.
Need a server? Get $200 free credits on DigitalOcean- A running Ubuntu 24.04 server with sudo access
- Basic familiarity with the command line
- SSH access to your server
You need a running Linux server for this exercise. Any Ubuntu server works, but we recommend DigitalOcean for quick setup.
Get $200 in free credits to get started.
Disclosure: This is an affiliate link. We may earn a commission at no extra cost to you.
- Monitor CPU, memory, and disk usage with standard Linux tools
- Use journalctl to read and filter systemd logs
- Configure logrotate to manage log file sizes
- Set up automatic security updates with unattended-upgrades
- Write a simple monitoring script and schedule it with cron
Monitor System Resources
Get a quick overview of your server's health using built-in tools. These commands are the first thing you run when something feels slow or a service stops responding.
Monitor Processes and Network Connections
Identify what processes are using the most resources and which network ports are in use.
Read and Filter Logs with journalctl
systemd's journal collects logs from all services. journalctl is how you read them. Learning to filter effectively saves a lot of time when debugging.
Configure Log Rotation
Log files grow over time and can fill your disk. logrotate compresses and rotates old logs automatically. Nginx installs its own logrotate config, but you should understand how to create one for custom applications.
Set Up Automatic Security Updates
Keeping your server patched is critical. Ubuntu's unattended-upgrades package can automatically install security updates so you do not have to do it manually every day.
Create a Simple Monitoring Script
Write a shell script that checks disk usage, memory, and load average. If any value crosses a threshold, it writes a warning to a log file. You can later extend this to send email or Slack notifications.
Schedule the Monitoring Script with Cron
Use cron to run the health check script every 5 minutes. Cron is the standard job scheduler on Linux and is useful for any recurring task.
Found an issue?