HowTo add port 443 and 8443 in the Linux Firewall rules

How To add port 443 and 8443 in the Linux Firewall rules so that your web server will listen on port 443 or 8443 (SSL)

  1. Stop the Firewall service
    systemctl stop|start|restart|enable|disable firewalld
    systemctl stop firewalld
  2. Add the rules
    firewall-cmd --zone=public --add-port|--remove-port=443/tcp --permanent
    firewall-cmd --zone=public --add-port|--remove-port=8443/tcp --permanent
  3. Reload the Firewall and save the change
    firewall-cmd --reload
    iptables-save | grep 443
  4. Done
SHARE