How to install latest version of podman on debian/ubuntu
Piotr

Piotr @finloop

About: Software Engineer @software-mansion with 3 years of experience | C++, Python, Data Science | Open Source Contributor

Location:
Lublin, Poland
Joined:
Sep 20, 2021

How to install latest version of podman on debian/ubuntu

Publish Date: Apr 12
0 0

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

Comments 0 total

    Add comment