podman-ts supports multiple connection modes — local Unix sockets, TCP endpoints, and named connections defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pratyay360/podman-ts/llms.txt
Use this file to discover all available pages before exploring further.
containers.conf or podman-connections.json. This page explains each mode with examples and describes how environment variables and Podman machines are handled.
Unix socket (default)
When you create aPodmanClient with no arguments, it connects over a Unix domain socket. The socket path depends on whether the process is running as root or as a regular user.
| User | Default socket path |
|---|---|
Root (uid = 0) | /run/podman/podman.sock |
| Rootless | $XDG_RUNTIME_DIR/podman/podman.sock (falls back to /run/user/{uid}/podman/podman.sock) |
http+unix:// scheme:
TCP connection
Connect to a Podman service listening on a TCP port by passing anhttp:// or tcp:// URL. The tcp:// scheme is automatically mapped to http:// internally.
Named connections
podman-ts can look up a named connection from your Podman configuration files. Pass the connection name to theconnection option:
PodmanConfig, which reads configuration from these files (in order):
$XDG_CONFIG_HOME/containers/podman-connections.json(new JSON format, takes precedence)$XDG_CONFIG_HOME/containers/containers.conf(legacy TOML format)
XDG_CONFIG_HOME defaults to ~/.config when not set.
The JSON file uses the Connection.Connections structure; the TOML file uses engine.service_destinations. Both formats are merged, with the JSON format taking precedence for overlapping names.
Environment variables
new PodmanClient() does not read CONTAINER_HOST or DOCKER_HOST. Use PodmanClient.fromEnv() or the fromEnv() shorthand when you want the connection URL to come from the environment:
fromEnv():
CONTAINER_HOST— if set, use its value asbaseUrlDOCKER_HOST— if set, use its value asbaseUrl- Local Unix socket — same default path used by
new PodmanClient()
Podman machine
If you have a Podman machine running and it is the active service,new PodmanClient() uses the machine’s URL automatically — no configuration needed.
PodmanConfig checks the Default key (JSON) or active_service key (TOML) in the connection config. If the active entry has IsMachine: true, its URL is used in place of the local socket.
SSH connections
ssh:// and http+ssh:// URLs are not directly supported. Attempting to use them throws a clear error:
http+unix://:
URL scheme reference
| Scheme | Example | Behavior |
|---|---|---|
http+unix:// | http+unix:///run/podman/podman.sock | Connects over a Unix domain socket. The path after :// is the socket file path. |
http:// | http://192.168.1.100:8080 | Standard HTTP over TCP. |
tcp:// | tcp://192.168.1.100:8080 | Mapped to http:// internally. |
ssh:// | — | Not supported. Use a tunnel with tcp:// or http+unix://. |