Here I have involved some steps which may helpful to optimize your Ubuntu server speed.
1. Update Your System
Regularly update your system to ensure you have the
latest performance improvements and security patches.
sudo apt update
sudo apt upgrade
2. Remove Unnecessary Start-up Applications
Disable unnecessary startup applications to reduce boot
time and free up system resources.
sudo apt install gnome-tweak-tool
gnome-tweaks
Navigate to the "Startup Applications" section
and disable unnecessary programs.
3. Use Lighter Desktop Environments
If you are using a resource-heavy desktop environment
like GNOME or KDE, consider switching to a lighter one like XFCE or LXDE.
sudo apt install xfce4
sudo apt install lxde
4. Manage Swappiness
Adjust the swappiness value to reduce the use of the swap
file and improve performance.
sudo sysctl vm.swappiness=10
sudo nano /etc/sysctl.conf
Add or edit the line vm.swappiness=10 in
/etc/sysctl.conf.
5. Clean Up Your System
Remove unnecessary files and packages to free up space
and reduce clutter.
sudo apt autoremove
sudo apt clean
sudo apt autoclean
Use a tool like BleachBit to clean up system files.
sudo apt install bleachbit
sudo bleachbit
6. Optimize Disk Usage
Use tools like fsck to check and repair file system
errors.
sudo fsck /dev/sdX
Use fstrim to trim SSDs.
sudo fstrim -v /
7. Use a Faster DNS Server
Changing your DNS server can improve network performance.
Consider using a faster DNS provider like Google DNS or OpenDNS.
sudo nano /etc/resolv.conf
Add the following lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
8. Upgrade Hardware
Adding more RAM or upgrading to an SSD can significantly
improve system performance.
9. Disable Animations
Disabling animations can make your desktop environment
feel snappier.
gsettings set org.gnome.desktop.interface
enable-animations false
10. Monitor System Resources
Use system monitoring tools to keep an eye on resource
usage and identify bottlenecks.
sudo apt install htop
htop
11. Use Lightweight Applications
Use lightweight alternatives to resource-heavy
applications (e.g., using Featherpad instead of Gedit).
12. Kernel Optimization
Use a low-latency kernel if you're doing audio production
or other real-time tasks.
sudo apt install linux-lowlatency
Courtesy: ChatGPT