Remote access
Podman Desktop can manage remote Podman connections. This is facilitated through a list of connections using the command podman system connection ls
.
Containers can be created, started, stopped, and deleted as if managed locally.
This functionality is enabled by connecting via SSH to the Podman socket on the remote host.
ed25519 keys, an SSH connection, and an enabled Podman Socket are required for remote access.
RSA keys are not supported; ed25519 keys are the recommended and only current method to set up a remote connection.
Prerequisites
- SSH access to a Linux machine with Podman installed
Procedure
Podman Desktop will automatically detect and show any podman system connection ls
connections within the GUI by enabling the setting:
If you have not added a remote podman connection yet, you can follow the official Podman guide or follow the steps below:
- Generate a local ed25519 key:
$ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
- Copy your public ed25519 key to the server:
Your public SSH key needs to be copied to the ~/.ssh/authorized_keys
file on the Linux server:
$ ssh-copy-id -i ~/.ssh/id_ed25519.pub user@my-server-ip
- Enable the Podman socket on the remote connection:
By default, the podman.socket is disabled in Podman installations. Enabling the systemd socket allows remote clients to control Podman.
$ systemctl enable podman.socket
$ systemctl start podman.socket
Confirm that the socket is enabled by checking the status:
$ systemctl status podman.socket
- Add the connection to
podman system connection ls
:
It's important to know which socket path you are using, as this varies between regular users and root.
Use podman info
to determine the correct socket path:
$ ssh user@my-server-ip podman info | grep sock
path: /run/user/1000/podman/podman.sock
If you are using root, it may appear as:
$ ssh root@my-server-ip podman info | grep sock
path: /run/podman/podman.sock
Now you are ready to add the connection. Add it with a distinct name to the Podman system connection list:
# non-root
$ podman system connection add my-remote-machine --identity ~/.ssh/id_ed25519 ssh://myuser@my-server-ip/run/user/1000/podman/podman.sock
# root
$ podman system connection add my-remote-machine --identity ~/.ssh/id_ed25519 ssh://root@my-server-ip/run/podman/podman.sock
- Check within Podman Desktop such as the Containers section that you can now access your remote instance.
Verification
GUI verification:
- Run a helloworld container on the remote machine:
$ ssh user@my-server-ip podman run -d quay.io/podman/hello
- Within Podman Desktop, check that your container appears in the Containers section.
CLI verification:
- Set your remote connection as the default:
$ podman system connection default my-remote-machine
- Verify that the container appears in the CLI:
$ podman ps