The podmansystemservice command creates a listening service that answers API calls for Podman. The
command is available on Linux systems and is usually executed in systemd services. The command is not
available when the Podman command is executed directly on a Windows or macOS host or in other situations
where the Podman command is accessing a remote Podman API service.
The REST API provided by podmansystemservice is split into two parts: a compatibility layer offering
support for the Docker v1.40 API, and a Podman-native Libpod layer. Documentation for the latter is
available at https://docs.podman.io/en/latest/_static/api.html. Both APIs are versioned, but the server
does not reject requests with an unsupported version set.
Runthecommandinasystemdservice
The command podmansystemservice supports systemd socket activation. When the command is run in a
systemd service, the API service can therefore be provided on demand. If the systemd service is not
already running, it will be activated as soon as a client connects to the listening socket. Systemd then
executes the podmansystemservice command. After some time of inactivity, as defined by the --time
option, the command terminates. Systemd sets the podman.service state as inactive. At this point there
is no podmansystemservice process running. No unnecessary compute resources are wasted. As soon as
another client connects, systemd activates the systemd service again.
The systemd unit files that declares the Podman API service for users are
• /usr/lib/systemd/user/podman.service
• /usr/lib/systemd/user/podman.socket
In the file podman.socket the path of the listening Unix socket is defined by
ListenStream=%t/podman/podman.sock
The path contains the systemd specifier %t which systemd expands to the value of the environment variable
XDG_RUNTIME_DIR (see systemd specifiers in the systemd.unit(5) man page).
In addition to the systemd user services, there is also a systemd system service podman.service. It runs
rootful Podman and is accessed from the Unix socket /run/podman/podman.sock. See the systemd unit files
• /usr/lib/systemd/system/podman.service
• /usr/lib/systemd/system/podman.socket
The podmansystemservice command does not support more than one listening socket for the API service.
Note: The default systemd unit files (system and user) change the log-level option to info from error.
This change provides additional information on each API call.
Runthecommanddirectly
To support running an API service without using a systemd service, the command also takes an optional
endpoint argument for the API in URI form. For example, unix:///tmp/foobar.sock or tcp://localhost:8080.
If no endpoint is provided, defaults is used. The default endpoint for a rootful service is
unix:///run/podman/podman.sock and rootless is unix://$XDG_RUNTIME_DIR/podman/podman.sock (for example
unix:///run/user/1000/podman/podman.sock)
AccesstheUnixsocketfrominsideacontainer
To access the API service inside a container: - mount the socket as a volume - run the container with
--security-optlabel=disableSecurity
Please note that the API grants full access to all Podman functionality, and thus allows arbitrary code
execution as the user running the API, with no ability to limit or audit this access. The API's security
model is built upon access via a Unix socket with access restricted via standard file permissions,
ensuring that only the user running the service will be able to access it. We strongly recommend against
making the API socket available via the network (IE, bindings the service to a tcp URL). Even access via
Localhost carries risks - anyone with access to the system will be able to access the API. If remote
access is required, we instead recommend forwarding the API socket via SSH, and limiting access on the
remote machine to the greatest extent possible. If a tcp URL must be used, using the --cors option is
recommended to improve security.