Port Management

Port Management allows networking between Service Containers on your server. You can expose ports for your container to listen to or publish them to be accessible to the internet.

We restrict publishing ports below 1024 as these are reserved for system processes. We also require these to be unique for each container on the server.

Currently, we don't allow you to modify ports for Web/Application containers through the Control Panel. Ports 80 and 443 are open by default to allow HTTP and HTTPS connections.

Adding/Removing Ports

The container will be restarted for any port changes to take effect.

  1. Select the Containers module.
  2. Under Service Containers, select the container you would like to modify.
  3. Click the Settings tab.
  4. To add a port:
    1. Fill in the Port and select the Protocol.
    2. To make the port public, tick the checkbox under the Publish header in the same row, then fill in the Publish Port.
  5. To remove a port:
    1. Click the red delete icon shown by hovering on the desired row.
  6. Hit the Save Ports button.

API Port Management

This section is for Developers or people with experience with APIs and Docker Compose.

To edit your ports using the SiteHost API:

  1. Get the Docker Compose for the Service container by making a /cloud/stack/get API call.
  2. Modify the Ports and Expose sections in your prefered text editor.
  3. Verify that it is a valid YML.
  4. URL encode the Docker Compose
  5. Update the container with the new Docker Compose passing it through with a /cloud/stack/update API call.

The following port definition formats are supported by the Port Management Form:

Type Format
Exposed 8989, 8989/tcp
Published 8989:8989, 8989:8989/tcp

If you have defined ports using other formats via the /cloud/stack/update API , such as port ranges, you will be unable to edit them through the Control Panel. You can either convert your ports to fit the supported formats, or continue to use the API to manage your ports as before.