-
Fix & Optimize System
DNS
Settings:Clean the
/etc/resolv.conf
and Add:1.1.1.1
-1.0.0.1
-8.8.8.8
-8.8.4.4
-
Update, Upgrade, and Clean the server:
- Update
- Upgrade
- Dist-Upgrade
- AutoRemove
- AutoClean
- Clean
-
Install Useful Packages:
software-properties-common
build-essential
apt-transport-https
iptables
iptables-persistent
lsb-release
ca-certificates
ubuntu-keyring
gnupg2
apt-utils
cron
bash-completion
curl
git
zip
unzip
ufw
wget
preload
locales
nano
vim
python3
python3-pip
jq
qrencode
socat
busybox
net-tools
haveged
htop
libssl-dev
libsqlite3-dev
-
Enable Packages at Server Boot.
-
Create & Enable
SWAP
File:- Swap Path:
"/swapfile"
- Swap Size:
2Gb
- Swap Path:
-
Enable
IPv6
Support. -
Clean the Old
SYSCTL
Configs. -
Optimize the
SYSCTL
Configs.- Optimize
SWAP
. - Optimize Network Settings.
- Activate
BBR
. - Optimize the Kernel.
- Optimize
-
Optimize
SSH
:- Back up the original
sshd_config
file. - Disable DNS lookups for connecting clients.
- Remove less efficient encryption ciphers.
- Enable and Configure TCP keep-alive messages.
- Allow agent & TCP forwarding.
- Enable gateway ports, Tunneling & Compression.
- Back up the original
-
Optimize the System Limits:
- Soft & Hard
nproc
limits. - Soft & Hard
nofile
limits.
- Soft & Hard
-
Optimize
UFW
& Open Common Ports.- Open Ports
21
,22
,80
,443
. - With
IPv6
,TCP
&UDP
.
- Open Ports
Reboot at the end.
Ubuntu
server(16+)
withroot
access.curl
If your Ubuntu server does not have curl
, install it first:
sudo apt install -y curl
bash <(curl -s https://raw.githubusercontent.com/hawshemi/Ubuntu-Optimizer/main/ubuntu-optimizer.sh)
This script is provided as-is, without any warranty or guarantee. Use it at your own risk.
This script is licensed under the MIT License.