firewalls, aws, amazon linux 2,

How to install UFW on Amazon Linux 2

Dec 10, 2021 · 1 min read · Post a comment

Maybe you will raise a question is it worth installing UFW on Amazon Linux 2. Some say that it’s enough to use the instance security groups but if you need some extra security on a server level, for instance, UFW offers additional protection to prevent flood traffic or DDoS attack by setting connection limits regarding ports, IPs, packets. So, if you are familiar with UFW I’m going to show you how to install it on Amazon Linux 2.

Prerequisites

  • Amazon Linux 2
  • sudo privileges

Install UFW on Amazon Linux 2

Step 1. Update Amazon Linux 2 system packages.

sudo yum update

Step 2. Install and enable epel repository on Amazon Linux 2.

sudo amazon-linux-extras install epel

Step 3. Now, install UFW.

yum install --enablerepo="epel" ufw

Step 4. To check the version and installation as well, run:

ufw --version

Output:

ufw 0.35
Copyright 2008-2015 Canonical Ltd.

Step 5. If the installation is fine you can enable it.

sudo ufw enable

Step 6. Check the status with:

sudo ufw status

Conclusion

In some of the next topics, I’m going to cover how can you protect your instance from flood traffic or DDoS attacks with UFW. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.