Configure the Firewall

  1. Enable and start firewalld

    systemctl enable firewalld systemctl start firewalld



  2. Allow SSH (22)

    firewall-cmd --zone=public --add-service=ssh --permanent



  3. Allow http (80)

    firewall-cmd --zone=public --add-service=http --permanent



  4. Allow https (443)

    firewall-cmd --zone=public --add-service=https --permanent



  5. Allow smtp (25)

    firewall-cmd --zone=public --add-service=smtp --permanent



  6. Optionally allow MySQL

    firewall-cmd --zone=public --add-port=3306/tcp --permanent



  7. Reload the firewall configuration

    firewall-cmd --reload



Related content