Git Product home page Git Product logo

linux-optimizer's Introduction

Linux Optimizer

This Bash script automates the optimization of your Linux server.

It performs the following tasks:

  1. 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
  2. Update, Upgrade, and Clean the server:

    • Update
    • Upgrade
    • Dist-Upgrade
    • AutoRemove
    • AutoClean
    • Clean
  3. 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

  4. Enable Packages at Server Boot.

  5. Create & Enable SWAP File:

    • Swap Path: "/swapfile"
    • Swap Size: 2Gb
  6. Enable IPv6 Support.

  7. Clean the Old SYSCTL Configs.

  8. Optimize the SYSCTL Configs.

    • Optimize SWAP.
    • Optimize Network Settings.
    • Activate BBR.
    • Optimize the Kernel.
  9. 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.
  10. Optimize the System Limits:

    • Soft & Hard nproc limits.
    • Soft & Hard nofile limits.
  11. Optimize UFW & Open Common Ports.

    • Open Ports 21, 22, 80, 443.
    • With IPv6, TCP & UDP.

Reboot at the end.

Run

Ubuntu (16+):

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

Debian:

Coming Soon...

CentOS:

Coming Soon...

Fedora:

Coming Soon...

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.

linux-optimizer's People

Contributors

hawshemi avatar samsesh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.