virtualMachine

Open or close server ports

Open server ports for remote access

IMPORTANT: Making this application’s network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

By default, the Bitnami virtual machine’s firewall is configured to allow access on any port(s) required by the application and the SSH port. This implies that ports 80, 443 and 22 are usually open by default.

To open a different port:

  • Log in to the server console.
  • Execute the following command, replacing the PORT placeholder with the number of the port to be opened:

    • Debian:

      $ sudo ufw allow PORT
      
    • CentOS:

      $ sudo firewall-cmd --zone=public --permanent --add-port=PORT/tcp
      $ sudo firewall-cmd --reload
      

More information about modifying the firewall configuration is available on the Debian Wiki.

Close server ports and deny remote access

By default, the Bitnami virtual machine’s firewall is configured to allow access on any port(s) required by the application and the SSH port. This implies that ports 80, 443 and 22 are usually open by default.

To close an open port:

  • Log in to the server console.
  • Execute the following command, replacing the PORT placeholder with the number of the port to be closed:

    • Debian:

      $ sudo ufw deny PORT
      
    • CentOS:

      $ sudo firewall-cmd --zone=public --permanent --remove-port=PORT/tcp
      $ sudo firewall-cmd --reload
      

More information about modifying the firewall configuration is available on the Debian Wiki.