Skip to content

samsesh/Ubuntu-Optimizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 

Repository files navigation

Ubuntu Optimizer

This Bash script automates the optimization of your Ubuntu server.

It performs the following tasks:

  1. Update, Upgrade, and Clean the server.

  2. Install Useful Packages.

  3. Enable Packages at Server Boot.

  4. Create & Enable SWAP File. (Default is 2Gb)

  5. Enable IPv6 Support.

  6. Clean the Old SYSCTL Settings.

  7. Optimize the SYSCTL Settings.

    • SWAP
    • Network
    • BBR
    • Kernel

  8. Optimize SSH.

    • Back up the original sshd_config file
    • Disable DNS lookups for connecting clients
    • Enable compression for SSH connections
    • Remove less efficient encryption ciphers
    • Enable and Configure TCP keep-alive messages
    • Allow agent forwarding
    • Allow TCP forwarding
    • Enable gateway ports
    • Enable tunneling
  9. Optimize the System Limits.

    • nproc
    • nofile

  10. Optimize UFW & Open Common Ports.


Reboot at the end.


Prerequisites

  • Ubuntu server (16+) with root access.
  • curl

If your Ubuntu server does not have curl, install it first:

sudo apt install -y curl

Run

bash <(curl -s https://raw.githubusercontent.com/samsesh/Ubuntu-Optimizer/main/ubuntu-optimizer.sh)

run with tmux

tmux new -s optimizer 'bash <(curl -s https://raw.githubusercontent.com/samsesh/Ubuntu-Optimizer/main/ubuntu-optimizer.sh)'

Disclaimer

This script is provided as-is, without any warranty or guarantee. Use it at your own risk.


License

This script is licensed under the MIT License.