Custom Public Ports
Choose your own public port for an exposed service.
Syntax
Use the to keyword to specify an exact public port:
bash
exposr expose <local-port> to <public-port>Examples
bash
# Expose local port 3000 on public port 21342
exposr expose 3000 to 21342
# Expose local port 8080 on public port 25000
exposr expose 8080 to 25000
# Expose Minecraft on its default port
exposr expose 25565 to 25565Considerations
- The requested public port must be available on the server
- The port must be allowed through the server's firewall
- When specifying a custom port, Exposr does not fall back to a random port if it's unavailable
Tip
For ports outside the default
20000–30000 range, make sure the port is also allowed through your server's firewall or cloud security group.