DEV Community

Piotr
Piotr

Posted on • Originally published at garden.piotrk.it on

How to install latest version of podman on debian/ubuntu

I like stability of debian. I use it as my host distro for almost every server I have. But debian repositories (stable) have a very old version of podman. The same goes for debian testing, there’s simply no podman 5>= avaliable. Debian backports don’t work either - there’s no backport of podman.

That left me with one other option - static build of podman.

Installation on amd64 host

Copied from https://github.com/mgoltzsche/podman-static?tab=readme-ov-file#binary-installation-on-a-host

Download the statically linked binaries of podman and its dependencies:

curl -fsSL -o podman-linux-amd64.tar.gz https://github.com/mgoltzsche/podman-static/releases/latest/download/podman-linux-amd64.tar.gz
Enter fullscreen mode Exit fullscreen mode

Verify signature:

curl -fsSL -o podman-linux-amd64.tar.gz.asc https://github.com/mgoltzsche/podman-static/releases/latest/download/podman-linux-amd64.tar.gz.asc
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 0CCF102C4F95D89E583FF1D4F8B5AF50344BB503
gpg --batch --verify podman-linux-amd64.tar.gz.asc podman-linux-amd64.tar.gz
Enter fullscreen mode Exit fullscreen mode

Install binaries on the host:

tar -xzf podman-linux-amd64.tar.gz
sudo cp -r podman-linux-amd64/usr podman-linux-amd64/etc /
Enter fullscreen mode Exit fullscreen mode

Install additional binaries:

apt install uidmap nsenter iptables slirp4netns

Enter fullscreen mode Exit fullscreen mode

Add UID/GID mapping

Check /etc/subuid and /etc/subgid for mappings:

cat /etc/subuid
cat /etc/subgid
Enter fullscreen mode Exit fullscreen mode

If theres nothing in here add mapping:

sudo sh -c "echo $(id -un):100000:200000 >> /etc/subuid"
sudo sh -c "echo $(id -gn):100000:200000 >> /etc/subgid"
Enter fullscreen mode Exit fullscreen mode

Persist containers after logout

Enable linger:

loginctl enable-linger <USERNAME>
Enter fullscreen mode Exit fullscreen mode

Enable podman socket

systemctl enable --now --user podman.socket
Enter fullscreen mode Exit fullscreen mode

Enable automatic restart of services

systemctl enable podman-restart.service
Enter fullscreen mode Exit fullscreen mode

Source: https://github.com/containers/podman/blob/main/contrib/systemd/system/podman-restart.service.in

Install podman compose

apt install pipx
pipx install podman-compose
Enter fullscreen mode Exit fullscreen mode

Check if everything is working

$ podman run quay.io/podman/hello

!... Hello Podman World ...!

         .--"--.
       / - - \
      / (O) (O) \
   ~~~| -=(,Y,)=- |
    .---. /` \ |~~
 ~/ o o \ ~~~~.----.~~
  | =(X)= |~ / (O (O) \
   ~~~~~~~ ~| =(Y_)=- |
  ~~~~~~~ | U |~~

Project: https://github.com/containers/podman
Website: https://podman.io
Desktop: https://podman-desktop.io
Documents: https://docs.podman.io
YouTube: https://youtube.com/@Podman
X/Twitter: @Podman_io
Mastodon: @Podman_io@fosstodon.org
Enter fullscreen mode Exit fullscreen mode

Postmark Image

20% off for developers shipping features, not fixing email

Build your product without worrying about email infrastructure. Our reliable delivery, detailed analytics, and developer-friendly API let you focus on shipping features that matter.

Start free

Top comments (0)

ACI image

ACI.dev: Fully Open-source AI Agent Tool-Use Infra (Composio Alternative)

100% open-source tool-use platform (backend, dev portal, integration library, SDK/MCP) that connects your AI agents to 600+ tools with multi-tenant auth, granular permissions, and access through direct function calling or a unified MCP server.

Check out our GitHub!

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay