{"id":1196,"date":"2026-10-19T23:41:30","date_gmt":"2026-10-20T03:41:30","guid":{"rendered":"https:\/\/codefork.com\/blog\/?p=1196"},"modified":"2026-10-19T23:41:30","modified_gmt":"2026-10-20T03:41:30","slug":"migrating-to-podman","status":"publish","type":"post","link":"https:\/\/codefork.com\/blog\/index.php\/2026\/10\/19\/migrating-to-podman\/","title":{"rendered":"Migrating to Podman"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;ve long wanted to Dockerize the main applications and services running on this personal server. The main goal would be to make it easier to upgrade the OS and\/or move servers, which I seem to do every 2 years or so. All I&#8217;d have to do is build my containers on the new host and copy over the data volumes. The other concern is improved security: containers would help wall off applications and limit exposure if one of them is compromised.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While I was at it, I thought I&#8217;d try Podman instead. I like the idea of running rootless, for even better security.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While Podman is pretty painless to use as a drop-in replacement for Docker (you can even install &#8220;podman-docker&#8221; and &#8220;podman-compose&#8221; packages so the &#8220;docker&#8221; command is aliased to &#8220;podman&#8221;), its default system behaviors are actually very different out of the box. I thought I&#8217;d write up a few  notes here on what I had to do to get it working well for me. I&#8217;m running Ubuntu 26.04.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Allow the current user to run podman.<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run this:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>systemctl --user enable --now podman.socket<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Allow rootless containers to listen on privileged ports <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default, rootless containers aren&#8217;t allowed to bind to port &lt; 1024 on the host. To run a web server like nginx and allow it to listen on port 80, I had to run these commands:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>echo 'net.ipv4.ip_unprivileged_port_start=80' | sudo tee \/etc\/sysctl.d\/50-rootless-ports.conf<br>sudo sysctl --system<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Resolve short image names to docker hub<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Out of the  box, Podman won&#8217;t look for an image named &#8220;nginx:latest&#8221; on Docker Hub. You need to specifically point to that registry so unqualified  names resolve there.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>mkdir -p ~\/.config\/containers<br>nano ~\/.config\/containers\/registries.conf <br># add this line<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>unqualified-search-registries = [\"docker.io\"]<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Allow containers to keep running after you logout<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Unlike Docker, when you log out, Podman kills your containers. That&#8217;s not useful! Run this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>loginctl enable-linger $USER<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Restart containers on reboot<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Even if a container has a restart policy of &#8220;always&#8221;, Podman won&#8217;t automatically restart it after a reboot. You need to enable a restart service that will do this, like so:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>systemctl --user enable podman-restart.service<br>systemctl --user start podman-restart.service<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve long wanted to Dockerize the main applications and services running on this personal server. The main goal would be to make it easier to upgrade the OS and\/or move servers, which I seem to do every 2 years or so. All I&#8217;d have to do is build my containers on the new host and &hellip; <a href=\"https:\/\/codefork.com\/blog\/index.php\/2026\/10\/19\/migrating-to-podman\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Migrating to Podman&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1196","post","type-post","status-publish","format-standard","hentry","category-misc"],"_links":{"self":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1196"}],"version-history":[{"count":1,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1196\/revisions"}],"predecessor-version":[{"id":1197,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1196\/revisions\/1197"}],"wp:attachment":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}