How to Disable (or Enable) Firewall on AlmaLinux

AlmaLinux and other RHEL-based Linux distributions use firewalld to manage firewall rules. Note that firewalld is simply a frontend for iptables, which is the system firewall baked directly into the Linux kernel. firewalld makes firewall rules easier to manage by setting up “zones.”

In this tutorial, you will see how to disable or enable the firewall on AlmaLinux. It’s generally recommended that you keep your firewall enabled for security, but there may be instances where it’s appropriate to turn it off.

You can check the current status of the firewall using systemd:

$ systemctl status firewalld

Output showing the status of firewall

Disable Firewall on AlmaLinux

To stop the firewall from running, execute this command:

$ sudo systemctl stop firewalld

To disable the firewall (prevent it from starting up again at system boot) on AlmaLinux, you can use the following command:

$ sudo systemctl disable firewalld

Disabling firewall on AlmaLinux

Enable Firewall on AlmaLinux

To turn the firewall back on:

$ sudo systemctl start firewalld

To configure firewalld to start up automatically at system boots:

$ sudo systemctl enable firewalld

If you need to restart the firewall:

$ sudo systemctl restart firewalld

Leave a Comment

Your email address will not be published. Required fields are marked *