Hello everyone,
I am currently trying to transition from docker-compose to podman-compose before trying out podman quadlets eventually. The first couple containers work great but today I tried Linkding and I run into a weird error.
Linkding can’t access the data directory because the permission gets denied. After inspecting the container all the directories inside belong to root. But podman runs rootless so that must be the issues. I tried to change the owner of the data directory on the host to root but then the data directory in the container belongs to nobody and nogroup (?). After checking the environment variable documentation of Linkding it seems like there is no environment variable for a UID and GID.
I think I have a fundamental misunderstanding how rootfull and rootless containers work so I would be very grateful if anybody could point me in the right direction on where to get a solution for this problem or anybody had success running Linkding rootless.
Thanks a lot in advance!
Edit:
I used named volumes because that’s what the dev used in the example compose file. Now I tried to use named volumes instead and now everything seems to work fine. No error in the logs and the web ui is accessible.


Which system are you using? SELinux/AppArmot active? Can you share your compose? There are manyavariables at play here.
Other than that: Setting UID/GID via environmental variable is usually wrong, mostly from a design perspective of the container. There is a user directive during build as well as during deploy to use for that.
From a quick look at the docker file it does look like the user you use to run linkding needs to be in the root group.
BUT rootless podman maps the root user (usually to your user ID) to so the root user inside the container has not the same ID as the one outside. So I would suggest setting the permissions of the volume to your user for now.
Another way to figure out which user to use: just start a new/clean instance of the service and look at the new volumes.
With the
getenforecommand from kumi below I getEnforcingso I guess I use SELinux.I now have two working options. a) Using named volumes (I’m still unsure if this is the way to go or not, generally speaking) and b) using the private label
:Zfor the bind mount.Without :Z
podman unshareyields root:root for the data directory. After setting the label it is a different user alltogether.I tried to use named volumes and now everything works fine, weird.
I think Mora is on the ball but we’d need their questions answered to know.
One possibility is that you have SELinux enabled. Check by
sudo getenforce. The podman manpage explains a bit about labels and shares for mounts. Read up on:zand:Zand see if appending either to thevolumesin your compose file unlocks it.If running rootless, your host user also obviously needs be able to access it.
getenforcegives meEnforcing. And I think I have SELinux. I had a look at this tutorial https://www.tutorialworks.com/podman-rootless-volumes/ suggested by another commenter and after runningpodman unshare ls -alin the folder with the bind mount it returns root root as the owner of the directory. So as far as I understand this means for the podman namespace this folder belongs to root? Like I said in my edit using named volumes solved the issue in on way. I just tried the:Zlabel too and it seems to work too. So it was probably a SELinux issue?