In today’s landscape of bloated software stacks, automated dependency chains, and background services that consume memory and CPU without notice, Linux system administrators and enthusiasts alike benefit greatly from embracing digital minimalism of what is setup on the server and to reduce it to the absolute minimum.
Digital minimalism in the context of Linux servers means removing what you don't need, disabling what you don't use, and optimizing what remains — all with the goal of increasing performance, improving security, and simplifying further maintenance.
In this article, we’ll walk through practical steps to declutter your Linux server, optimize resources, and regain control over what’s running and why.
1. Identify and Remove Unnecessary Packages
Over time, many systems accumulate unused packages — either from experiments, dependency installations, or unnecessary defaults.
On Debian/Ubuntu
Find orphaned packages:
# apt autoremove --dry-run
Remove unnecessary packages:
# apt autoremove # apt purge <package-name>
List large installed packages:
# dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20
On RHEL/CentOS/AlmaLinux:
Find orphaned packages:
# dnf autoremove
List packages sorted by size:
# rpm -qia --qf '%{SIZE}\t%{NAME}\n' | sort -n | tail -n 20
2. Audit and Disable Unused Services
Every running service consumes memory, CPU cycles, and opens potential attack surfaces.
List enabled services:
# systemctl list-unit-files --type=service --state=enabled
See currently running services:
# systemctl --type=service –state=running
Put some good effort to review and disable all unnecesssery
Disable unneeded services :
# systemctl disable --now bluetooth.service # systemctl disable --now cups.service # systemctl disable --now ModemManager.service
And so on
Useful services to disable (if unused):
| Service | Purpose | When to Disable |
|---|---|---|
| cups.service | Printer daemon | On headless servers |
| bluetooth.service | Bluetooth stack | On servers without Bluetooth |
| avahi-daemon | mDNS/Zeroconf | Not needed on most servers |
| ModemManager | Modem management | If not using 3G/4G cards |
| NetworkManager | Dynamic net config | Prefer systemd-networkd for static setups |
Simple Shell Script to List & Review Services
#!/bin/bash echo "Enabled services:" systemctl list-unit-files --state=enabled | grep service echo "" echo "Running services:" systemctl --type=service --state=running
3. Optimize Startup and Boot Time
Analyze system boot performance:
# systemd-analyze
View which services take the longest:
# systemd-analyze blame min 25.852s certbot.service 5min 20.466s logrotate.service 1min 29.748s plocate-updatedb.service 54.595s php5.6-fpm.service 43.445s systemd-logind.service 42.837s e2scrub_reap.service 37.915s apt-daily.service 35.604s mariadb.service 31.509s man-db.service 27.405s systemd-journal-flush.service 18.357s ifupdown-pre.service 14.672s dev-xvda2.device 13.523s rc-local.service 11.024s dpkg-db-backup.service 9.871s systemd-sysusers.service ...
Disable or mask long-running services that are not essential.
Why services masking is important?
Simply because after some of consequential updates, some unwanted service daemon might start up with the system boot.
Example:
# systemctl mask lvm2-monitor.service
4. Reduce Memory Usage (Especially on Low-RAM VPS)
Monitor memory usage:
# free -h # top # htop
Use lightweight alternatives:
| Service | Heavy | Lightweight Alternative |
|---|---|---|
| Web server | Apache | Nginx / Caddy / Lighttpd |
| Database | MySQL | MariaDB / SQLite (if local) |
| Syslog | rsyslog | busybox syslog / systemd journal |
| Shell | bash | dash / ash |
| File manager | GNOME Files | mc / ranger (CLI) |
5. Configure Swap (Only If Needed)
Having too much or too little swap can affect performance.
Check if swap is active:
# swapon --show
Create swap file (if needed):
# fallocate -l 1G /swapfile # chmod 600 /swapfile # mkswap /swapfile # swapon /swapfile
Add to /etc/fstab for persistence:
/swapfile none swap sw 0 0
6. Clean Up Cron Jobs and Timers
Old scheduled tasks can silently run in the background and consume resources.
List user cron jobs:
crontab -l
Check system-wide cron jobs:
# ls /etc/cron.* # ls -al /var/spool/cron/*
List systemd timers:
# systemctl list-timers
Disable any unneeded timers or outdated cron entries.
7. Optimize Logging and Log Rotation
Logs are essential but can grow large and fill up disk space quickly.
Check log size:
# du -sh /var/log/*
Force logrotate:
# logrotate -f /etc/logrotate.conf
Edit /etc/logrotate.conf or specific files in /etc/logrotate.d/* to reduce retention if needed.
8. Check for Zombie Processes and Old Users
Old users and zombie processes can indicate neglected cleanup or the server is (cracked) hacked.
List users:
cat /etc/passwd | cut -d: -f1
Remove unused accounts:
# userdel -r username
Check for zombie processes:
# ps aux | awk '{ if ($8 == "Z") print $0; }'
9. Disable IPv6 (if not used)
IPv6 can add unnecessary complexity and attack surface if you’re not using it.
To disable IPv6 temporarily:
# sysctl -w net.ipv6.conf.all.disable_ipv6=1 # sysctl -w net.ipv6.conf.default.disable_ipv6=1
To disable permanently, add to /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
10. Final Thoughts: Less Is More
Digital minimalism is not just a personal tech trend — it's a philosophy of clarity, performance, and security. Every running process is a potential vulnerability. Every megabyte of RAM consumed by a useless service is wasted capacity. Every package installed increases the system’s complexity.
By regularly auditing, pruning, and simplifying your Linux server, you not only improve its performance and reliability, but you also reduce future maintenance headaches.






Linux: Howto Disable logging for all VirtualHosts on Apache and NGINX Webservers one liner
Wednesday, July 1st, 2020Did you happen to administer Apache Webservers or NGINX webservers whose logs start to grow so rapidly that are flooding the disk too quickly?
Well this happens sometimes and it also happens that sometimes you just want to stop logging especially, to offload disk writting.
There is an easy way to disable logging for requests and errors (access_log and error_log usually residing under /var/log/httpd or /var/log/nginx ) for all configured Virtual Domains with a short one liner, here is how.
Before you start Create backup of /etc/apache2/sites-enabled / or /etc/nginx to be able to revert back to original config.
1. Disable Logging for All Virtual Domains configured for Apache Webserver
First lets print what the command will do to make sure we don't mess something
You will get some output like
2. Disable Logging for All configured Virtual Domains for NGINX Webserver
f course above substituations that will comment out with '#' occurances from file configs of only default set access_log and error_log / access.log, error.log
for machines where there is no certain convention on file naming and there are multiple domains in custom produced named log files this won't work.
This one liner was inspired from a friend's daily Martin Petrov. Martin blogged initially about this nice tip for those reading Cyrillic check out mpetrov.net, so. Thanks Marto ! 🙂
Tags: about, access, ALL, and, apache, apache webserver, apache webservers, apache2, are, BACK, blogged, check, command, Comment, config, configured, convention, course, create, custom
Posted in Everyday Life, Nginx, Web and CMS | No Comments »