Skip to main content

Publish TCP/UDP

Publishing TCP/UDP Endpoints

By default, Acorn will deploy with the default port configurations specified in the Acornfile. This behavior can be overridden at runtime if needed. For TCP/UDP ports a load balancer and unique DNS name is created by Acorn pointing to the exposed endpoint on a random port.

The way to work with publishing ports is the -p flag. The flag is used to publish ports that were not defined to be published and/or assign custom names. In the examples below, we are using it to assign a name to a port that was defined to be published in the Acornfile.

DNS settings

Acorn creates a unique DNS name for each published port in the Acorn. If you would like to use a custom domain name, you can do so by launching with the domain name and creating a CNAME record in your DNS provider that points to the Acorn DNS name.

For instance when running a Minecraft server you would launch the Acorn with the following command:

acorn run -n mc
# STATUS: ENDPOINTS[] HEALTHY[0] UPTODATE[0] (container: mc): pending; (volume: mc-data): pending
# STATUS: ENDPOINTS[tcp://] HEALTHY[0/1] UPTODATE[1] (container: mc): not ready
# ...
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# | STATUS: ENDPOINTS[udp://, tcp://] HEALTHY[1] UPTODATE[1] OK |
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

You could now create a CNAME to the address in the ENDPOINTs section of the output. Note that the ports are randomly assigned and will need to be accounted for when configuring your applications to connect.

Additional Info