(D)DoS Deflate is a shell script developed by Zaf, originally for use on MediaLayer servers to assist in combating denial of service attacks. However, it was seen to be very effective for their purpose, and therefore was released as a contribution to the web hosting community. (D)DoS Deflate is now used by not only many web hosts, but by many people who run their own servers looking for additional security in dealing with such attacks.
Login to your server via SSH as root
Download the script:
Run the installer
Remember that ddos deflate will protect you from small ddos attacks, but if your under heavy ddos attacks, you will need to contact your server provider, and some of the things you also need to consider is getting a hardware firewall or increasing your server resources, so it wouldn’t crash under pressure.