Skip to content

monoceros add-port

Exposes one or more container ports through the Monoceros proxy, so you can reach them from the host by hostname (e.g. acme.localhost). Routing is live after the next monoceros apply.

Terminal window
monoceros add-port <name> <port> [<port> ...] [--yes] [--default]

Pass the port numbers as arguments. --default makes the first port the default hostname for the workbench.

Terminal window
# A single port
monoceros add-port acme 3000
# Several at once
monoceros add-port acme 3000 8080
# Make a single port the default host (acme.localhost)
monoceros add-port acme 3000 --default
  • Idempotent. Re-adding a port that is already exposed is a no-op.
  • No confirmation prompt. The edit is written straight to the yml as soon as you run the command.
  • Live immediately. The proxy hot-reloads, so the route works at once - no rebuild, no apply. The port is also saved to the yml, so a later apply on any machine restores it.