Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install UFW on Amazon Linux server

I'm trying to install UFW on my amazon linux server with yum and here's what I'm getting:

[root@ip-XXX-31-43-YYY ~]# sudo yum install ufw
Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package ufw available.
Error: Nothing to do
[root@ip-XXX-31-43-YYY ~]# 

What am I doing wrong?

I can't install via apt-get.

like image 474
Elaine Byene Avatar asked May 28 '26 00:05

Elaine Byene


2 Answers

There is no ufw package for Yum.

Lighten the load on your server, and don't install a firewall on it. Instead, control which ports are open in an AWS Security Group.

like image 150
Mike Slinn Avatar answered May 30 '26 15:05

Mike Slinn


Here is the easiest way to install ufw in Amazon Linux 2.

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.

And B0o0ommm. UFW is installed... Here are some more steps to enable the UFW before using it.

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

sudo ufw enable

Step 6. Check the status with:

sudo ufw status
like image 30
Mayur Avatar answered May 30 '26 15:05

Mayur