Guides
Published ports
Available
This page describes what is in the code on the main branch. There are no release binaries yet.
Services are private by default: only the services of the same namespace and
environment can reach them, by service name. HTTP services are exposed
through domains. For other protocols, publish
opens a port on the server and sends it to the container:
TOML
namespace = "data"
[service.db]
image = "postgres:17"
publish = ["5432/tcp"]
YAML
namespace: data
service:
db:
image: postgres:17
publish: [5432/tcp]
Each entry is a port from 1 to 65535 and a protocol, tcp or udp. The
same port number is used on the server and in the container.
Rules
- One environment per port on the server. A release that publishes a port another environment already uses is refused.
- A port that the server already listens on is refused. That covers SSH (port 22), the proxy, the API and any other program.
- Available A port that cannot be published is refused with one message,
whatever the reason:
port tcp/5432 cannot be published on this server. The reason is in the daemon log, not in the message. - Available If a port you publish is later taken by the host, the daemon still
starts. It skips that port and shows the problem in
podos ps. - A service with
publishneedsreplicas = 1, because a host port forwards to a single container. - The port is reachable from other machines, not from the server itself.
podos downremoves the environment's published ports.- Available On a server with Docker, ufw or firewalld, that firewall can block published ports until you change a setting; see Next to Docker or another firewall.
Publish only what must be reachable from outside, and protect it with the service's own authentication and the server's firewall. Podos does not open firewall ports for you.
See publish in the manifest reference.