Docs / Security / Configuring Automatic Security Updates on Ubuntu

Configuring Automatic Security Updates on Ubuntu

By Admin · Apr 8, 2026 · Updated Apr 24, 2026 · 9 views · 2 min read

Managing unattended-upgrades effectively is a crucial skill for any system administrator. This tutorial provides step-by-step instructions for security configuration, along with best practices for production environments.

Installation and Configuration

The default configuration works well for development environments, but production servers require additional tuning. Pay particular attention to connection limits, timeout values, and logging settings.


# Install and configure unattended-upgrades
sudo apt update && sudo apt install -y unattended-upgrades

# Backup existing config
sudo cp /etc/unattended-upgrades/unattended-upgrades.conf /etc/unattended-upgrades/unattended-upgrades.conf.bak

# Edit configuration
sudo nano /etc/unattended-upgrades/unattended-upgrades.conf

These commands should be run as root or with sudo privileges. If you're using a non-root user, prefix each command with sudo.

Advanced Settings

It's recommended to test this configuration in a staging environment before deploying to production. This helps identify potential compatibility issues and allows you to benchmark performance differences.

Creating Security Rules

Before making changes to the configuration, always create a backup of the existing files. This ensures you can quickly roll back if something goes wrong during the setup process.


# Check security status
sudo unattended-upgrades --check
sudo systemctl status unattended-upgrades

# View logs for security events
sudo journalctl -u unattended-upgrades --since "1 hour ago"
sudo tail -f /var/log/unattended-upgrades.log

The configuration above sets the recommended values for a VPS with 2-4GB of RAM. Adjust the memory-related settings proportionally if your server has different specifications.

Summary

You've successfully configured unattended-upgrades on your VPS. Remember to monitor performance, keep your software updated, and maintain regular backups. If you run into issues, consult the official documentation or open a support ticket for assistance.

Was this article helpful?