Skip to content

Conversation

@stasadev
Copy link
Member

@stasadev stasadev commented Nov 22, 2025

The Issue

How This PR Solves The Issue

Adds a blog.

I haven't tested any configuration with Podman Desktop yet, so I don't know if additional configuration is needed there.

Manual Testing Instructions

https://pr-476.ddev-com-fork-previews.pages.dev/blog/podman-and-docker-rootless/

Automated Testing Overview

Related Issue Link(s)

Release/Deployment Notes

@github-actions
Copy link

github-actions bot commented Nov 22, 2025

🌐 Fork Preview for PR #476

https://pr-476.ddev-com-fork-previews.pages.dev

This preview updates automatically when you push changes to your fork.

@rfay
Copy link
Member

rfay commented Nov 23, 2025

Just starting on this... Since this will come out before v1.25.0, it should mention the v1.25.0 or HEAD requirement to test, right?

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my first visit. Congrats on this milestone.

As mentioned, this should probably discourage people from using these options unless they know they need them. Early on it should have a link to normal setup and say "You don't need this unless you think you want it :) "

Now I'll experiment with the various options.

- **Removed legacy docker-compose features** ([#7642](https://github.com/ddev/ddev/pull/7642)): Podman refuses to work with deprecated `links` and `external_links` directives in `docker-compose` files. We removed these legacy features and modernized DDEV's compose file generation.
- **Added Podman and Docker Rootless support** ([#7702](https://github.com/ddev/ddev/pull/7702)): DDEV now detects and supports Podman (rootful and rootless) and Docker Rootless. We added handling for Podman-specific limitations and enabled rootless environments to work without root privileges.

These changes enabled Podman and Docker Rootless support.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An amazing journey, congratulations!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a small statement about why these two features go hand-in-hand, why they developed together.

- Container processes cannot access root-owned files
- Reduced attack surface if a container is compromised

Podman is rootless by default. Docker Rootless requires special setup.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably worth explaining here that DDEV's traditional support has had its containers run as an unprivileged user, limiting the attack space. DDEV's built-in containers do not use root privileges (although docker itself does need root by default)


After installing Podman, enable the API socket so DDEV can connect.

### Podman Rootless on Linux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say "Linux and WSL2" ?


## Setting Up Docker Rootless with DDEV

Docker Rootless offers rootless security with full Docker compatibility.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is linux-only right? Should mention that.

- [Mounting a volume with rootless always assigns ownership to root](https://github.com/moby/moby/issues/45919)
- [Add ability to mount volume as user other than root](https://github.com/moby/moby/issues/2259)

The `root` user inside the container maps to your host user, but many services will not run as root:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting that this is the same classic problem we've had with Docker Desktop for Linux and for a time with virtiofs.

ddev start
```

## Which Runtime Should You Choose?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great section. However, it should encourage standard Docker setup first, with link to the docs, as it's by far the best for local development.

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another comment: One reason people have often requested podman is the belief that it was the only open-source alternative to Docker Desktop. We should clear that up in here, pointing out the there are several other fully open source alternatives on every platform.

@rfay
Copy link
Member

rfay commented Nov 25, 2025

This and docs probably need a compatibility table showing all the options and what works etc.


### Podman Installation Options

Podman can be installed with or without a GUI:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably need a little more than this. I missed both podman init and podman start. Maybe one of those collapsed sections with basic instructions on macOS and Linux? The majority of our users are macOS, but probably the majority of interested users are on Linux.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check the formatting options for Markdown here.

@rfay
Copy link
Member

rfay commented Nov 26, 2025

I'm not sure if you already have this in there, but the inability to bind to default ports 80/443 is a pretty significant liability for a web developer.

@tyler36
Copy link
Contributor

tyler36 commented Nov 26, 2025

Just tried installing rootless podman in a isolated WSL Ubuntu environment:

I got a warning "Problem with your Docker provider: installed Podman version 4.9.3 is not supported, please update to version 5.0 or newer."

But it seem Ubuntu old has older versions available(?)

$ sudo nala search podman
...
podman 4.9.3+ds1-1ubuntu0.2 [Ubuntu/noble universe]
└── tool to manage containers and pods

Install Podman Desktop on windows got a "current" version though:

❯ podman -v
podman version 5.7.0

@stasadev stasadev force-pushed the 20251122_stasadev_podman branch 2 times, most recently from 4dd642a to ae5ec1b Compare December 9, 2025 19:05
@stasadev
Copy link
Member Author

stasadev commented Dec 9, 2025

Summary of Changes from Original Version

  • Added release status clarity: now explicitly states support is in DDEV HEAD with GA planned for v1.25.0.
  • Added full platform separation: Linux/WSL2, macOS, and Windows now have dedicated sections.
  • Added Open Source alternatives to Docker Desktop (Rancher, Lima, Colima, etc).
  • Improved rootless security explanation by distinguishing container user vs daemon privileges.
  • Moved subuid/subgid setup into the main Podman Rootless configuration flow (more correct).
  • Added Docker Rootless loopback/Xdebug fix using RootlessKit environment override.
  • Added a full runtime comparison table with features and recommendations.

Content that was shortened or removed

  • Removed the full UID/GID failure error log example and explicit recovery command (podman system migrate).
  • Removed the explicit privileged ports error message text (rootlessport cannot expose privileged port 80).
  • Removed the Arch Linux-specific pacman example for fuse-overlayfs.

Overall Impact

  • Documentation is now broader, more accurate, and more structured.
  • One-off deep Linux troubleshooting examples were reduced, but no core setup steps were lost.

@stasadev stasadev requested a review from rfay December 9, 2025 19:09
@stasadev stasadev marked this pull request as ready for review December 9, 2025 19:09
Comment on lines +427 to +482
## macOS

macOS users can use Podman and Podman Desktop, but setup has its own challenges. Docker Rootless is not available on macOS.

### Installing Podman

Install Podman using Homebrew:

```bash
brew install podman
```

Or install [Podman Desktop](https://podman-desktop.io/docs/installation/macos-install) if you prefer a GUI.

For more information, see the [official Podman installation guide for macOS](https://podman.io/docs/installation#macos) and [Podman tutorials](https://github.com/containers/podman/tree/main/docs/tutorials#readme).

### Installing Docker CLI

```bash
brew install docker
```

### Configuring Podman

After installing Podman, initialize and start the Podman machine:

```bash
podman machine init
podman machine start
```

The Podman machine will automatically configure the socket. Verify it's running:

```bash
podman info --format '{{.Host.RemoteSocket.Path}}'
```

If you have Docker CLI installed, you can create a context for Podman:

```bash
# Create Podman context
docker context create podman-rootless \
--description "Podman (rootless)" \
--docker host="unix://$(podman info --format '{{.Host.RemoteSocket.Path}}')"

# Switch to the new context
docker context use podman-rootless

# Verify it works
docker ps
```

Otherwise, set the `DOCKER_HOST` environment variable in your shell profile (`~/.zshrc` or `~/.bashrc`):

```bash
export DOCKER_HOST=unix://$(podman info --format '{{.Host.RemoteSocket.Path}}')
```
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test macOS, hoping for possible improvements or tips from @rfay in this section.

@rfay rfay force-pushed the 20251122_stasadev_podman branch from bba5f65 to ac6fe7e Compare December 10, 2025 17:33
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should either be targeted at the v1.25.0 release, or alternately promote it earlier and try to get some people to use HEAD.

It's looking good, I added some more suggestions.

Now I'll try some more manual testing.


The DDEV community has requested Podman and Docker Rootless support for years. This support is now available in [DDEV HEAD](https://docs.ddev.com/en/stable/developers/building-contributing/#testing-latest-commits-on-head) as an experimental feature, general availability is planned for upcoming DDEV v1.25.0.

It allows DDEV to work in corporate environments where Docker Desktop is not allowed due to security policies or licensing restrictions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It allows DDEV to work in corporate environments where Docker Desktop is not allowed due to security policies or licensing restrictions.
It allows DDEV to work in corporate environments where Podman or Rootless Docker are preferred due to security policies or licensing restrictions.

- Guides
---

The DDEV community has requested Podman and Docker Rootless support for years. This support is now available in [DDEV HEAD](https://docs.ddev.com/en/stable/developers/building-contributing/#testing-latest-commits-on-head) as an experimental feature, general availability is planned for upcoming DDEV v1.25.0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TL;DR with simple statement/link about how to get going.

- [Supporting DDEV Development](#supporting-ddevdevelopment)
- [Conclusion](#conclusion)

## The Journey to Podman Support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is great and useful, but should probably move to the bottom. It's too much for most people to absorb, and not directly relevant to getting them going.


All of these work with DDEV. The main reason to choose Podman specifically is if your organization forbids Docker entirely or if you want rootless operation by default.

### Why Choose Rootless?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great section. Maybe "Why choose Podman" right after it. Or before it.


### Why Choose Rootless?

Running containers without root privileges is more secure. Traditional Docker and rootful Podman need elevated privileges, which creates security risks in corporate environments where strict security policies apply.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Running containers without root privileges is more secure. Traditional Docker and rootful Podman need elevated privileges, which creates security risks in corporate environments where strict security policies apply.
Although DDEV's use of all Docker providers is quite secure, and we run containers as normal users with limited privileges, the rootless approaches to Docker and Podman actually run the *docker daemon* without root privileges, closing additional attack surface. Traditional Docker and rootful Podman daemons need elevated privileges, which creates security risks in corporate environments where strict security policies apply. (Note that DDEV is targeted at local development, where there are few risks of specialized attacks using this vector anyway.)

docker ps
```

**Option B: Set environment variable in your shell profile** (`~/.bashrc` or `~/.zshrc`):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'd prefer not to mention DOCKER_HOST, but open to conversation. I think docker contexts are better to use.


For additional details, see the [Podman socket activation documentation](https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md).

### Configuring Podman Rootful
Copy link
Member

@rfay rfay Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you had said earlier that podman is innately rootless, so this may need some clarification? Probably we don't even need to cover podman rootful if it has no value.


### Podman Rootless Performance Optimization

Podman Rootless is slower than Docker. See these resources:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Podman Rootless is slower than Docker. See these resources:
Podman Rootless is significantly slower than Docker. See these resources:


### Recommendations

**Use [standard Docker](https://docs.ddev.com/en/stable/users/install/docker-installation/) if:**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Use [standard Docker](https://docs.ddev.com/en/stable/users/install/docker-installation/) if:**
**Use of the many [standard Docker providers](https://docs.ddev.com/en/stable/users/install/docker-installation/) if:**


- You're comfortable with the most widely used container runtime
- You don't have rootless security requirements
- This is the recommended option for most users
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- This is the recommended option for most users
_This is the recommended option for the vast majority of users._

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it working fine on macOS and will use it for a while for daily use.

I didn't succeed with Fedora 43. The /mnt/ddev_config was always mounted as root and couldn't be copied at startup time.

I imagine this was something I did wrong.


### Configuring Podman Rootless

This is the recommended configuration for most users.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there even a reason to explain podman rootful?


This is the recommended configuration for most users.

1. In order for users to run rootless Podman, a `subuid` and `subgid` configuration entry must exist for each user that wants to use it. New users created using `useradd` have these entries by default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a little smarter? Either check whether it exists already in the statement, or make it less obvious? Since it's the first step... everybody will do it, and end up with broken system like I did. I think username:1000:165535 is a great default, but if it has something more specific in there already... remove it? Respect it?

@stasadev stasadev marked this pull request as draft December 11, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants