Trouble getting miniDLNA docker to run [Permission denied]

Hi all, first time poster here, because I was not able to find a solution to this issue on this forum, reddit or the rest of the internet… only people with apparently the same issue but the threads never got resolved. I am neither a TrueNAS pro nor a docker expert, so the solution might actually be simple but I am really desperate right now not getting any further with this.
This is all on TrueNAS 25.04.1 btw, single RaidZ2 Pool.

I am having an issue setting up minidlna in TrueNAS scale.
I followed the steps that were described in a reddit post by another user

reddit com/r/truenas/comments/1ck7kwj/comment/lmby4ok/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

after that the app is running, but I can’t access the media files from other devices on the network, although the mediaserver itself can be accessed fine.
I assume this is because of some issues with permissions (more on that later)
Since I cannot add a screenshot to this post, here are the settings in text form:

Summary

Application Name

Application Name* = minidlna

General

Notes =

Image Configuration

Image

Repository* = vladgh/minidlna
Tag = latest
Pull Policy* = Pull the image if it is not already present on the host.

Container Configuration

Hostname =
Entrypoint = No items have been added yet.
Command = No items have been added yet.
Timezone* =‘Europe/Berlin’ timezone

Environment Variables

Name* = MINIDLNA_FRIENDLY_NAME
Value* = TrueNAS Mediaserver

Name* = MINIDLNA_MEDIA_DIR
Value* = /media

Restart Policy* = On Failure - Restarts the container if the exit code indicates an error.
Maximum Retry Count* = 3

Disable Builtin Healthcheck = false
TTY = false
Stdin = false

Devices

No items have been added yet.

Security Context Configuration

Privileged = false

Capabilities

No items have been added yet.
Custom User = false

Network Configuration

Host Network = true

Custom DNS Setup

Nameservers = No items have been added yet.
Search Domains = No items have been added yet.
DNS Options = No items have been added yet.

Portal Configuration

No items have been added yet.

Storage Configuration

Storage

Type* = Host Path (Path that already exists on the system)
Read Only = false
Mount Path* = /media

Host Path Configuration

Enable ACL = false
Host Path* = /mnt/tank/Share/Musik

Labels Configuration

No items have been added yet.

Resources Configuration

Enable Resource Limits = false

GPU Configuration

Passthrough available (non-NVIDIA) GPUs = false

The host path I specified under storage configuration is where my music is located.
It is a folder that was created by a Windows user on the “share” dataset, which is a smb share, if that matters.
The ACL to the share dataset and contents includes the app user (allow|modify) and built-in users.
/media is not an actual path, that I could see on the system but I think it should be like that and that it is an internal path of the container.

In the app overview I get a panel with notes, that
This container is short lived

  • Is running as unknown user
  • Is running as unknown group
  • Is running without [no-new-privileges] security option

Is it designed to be like that? Because when I start the app, the log reads

2025-06-25 20:58:24.315868+00:00=== Set user and group identifier 
2025-06-25 20:58:24.359671+00:00usermod: no changes 
2025-06-25 20:58:24.359765+00:00=== Set timezone 
2025-06-25 20:58:25.746504+00:00=== Set standard configuration 
2025-06-25 20:58:25.746563+00:00=== Set configuration from environment variables 
2025-06-25 20:58:25.783567+00:00=== Set permissions 
2025-06-25 20:58:25.785258+00:00=== Generate scan/rebuild flags 
2025-06-25 20:58:25.785275+00:00=== Start daemon 
2025-06-25 20:58:25.808439+00:00minidlna.c:1134: warn: Starting MiniDLNA version 1.3.3.
2025-06-25 20:58:25.808908+00:00minidlna.c:394: warn: Creating new database at /minidlna/cache/files.db 
2025-06-25 20:58:25.816785+00:00minidlna.c:1182: warn: HTTP listening on port 8200 
2025-06-25 20:58:25.817032+00:00scanner.c:731: warn: Scanning /media 
2025-06-25 20:58:25.817049+00:00scanner.c:762: warn: Error scanning /media [Permission denied] 
2025-06-25 20:58:25.817252+00:00playlist.c:135: warn: Parsing playlists... 
2025-06-25 20:58:25.817269+00:00playlist.c:269: warn: Finished parsing playlists. 
2025-06-25 20:58:26.004968+00:00monitor_inotify.c:131: error: inotify_add_watch(/media) [Permission denied] 
2025-06-25 20:58:26.005577+00:00monitor_inotify.c:131: error: inotify_add_watch(/media) [Permission denied]

I mean this would make somewhat sense to me, because an unknown user does not have access to the dataset, right?.
But when I instead run the app as custom user - either as user “apps” (UID 568, GID 568) or as newly created user, that I then also include in the ACL of the share, the note about the unknown user and group goes away but the app then crashes with the log reading

2025-06-25 21:03:35.886383+00:00=== Set user and group identifier 
2025-06-25 21:03:35.887220+00:00groupmod: /etc/group.8: Permission denied 
2025-06-25 21:03:35.887338+00:00groupmod: cannot lock /etc/group; try again later.

If I run the app in privileged mode, nothing changes by the way in both cases (custom user or not) I just get the additional note, that the container runs in privileged mode.

I also wonder where the container would be storing it’s own data, (index, log) since there is no required option to specify this under storage configuration. Or will it just live in RAM as long as the container is running?

So if anyone could point me to what I am missing, this would be greatly appreciated, I am trying to get this working for some days now. Also sorry for the long post.

Does it need to be DLNA or can you use something a little more natural like Emby, Kodi, Jellyfin or Plex? Once you step into the custom apps twilight zone, it’s hard to predict what will happen without good documentation. We can see you have an obvious permissions problem; the user/group recommended is foreign to your system and doesn’t have permissions to deal with the media. Apps/apps can deal with the media but not enough privilege to run the container. Root cause, need to add perms for the native userid/groupid that this thing wants, to your media dataset. Looks like the dude chose a non-root user in his docker config file (1000:1000) at docker_base_images/minidlna at main · vladgh/docker_base_images · GitHub.

The other apps I mentioned might have apps for your Roku or whatever else you’re streaming to over that abandoned protocol (like your phone or tablet) and should be infinitely easier to get running.

Thanks a lot for your answer
I wanted to set this up specifically for my network connected Denon music player. According to its manual “This unit can play back music files and playlists (m3u, wpl) from DLNA
compatible servers”
This is why I went with this app.
Currently I also don’t have any use for the other features, the big apps offer.

Thank you for looking into this and finding out that the default user / group assumed by the app is 1000/1000
These IDs are not assigned on my NAS currently (obviously) but I will try if simply creating a user with these IDs and giving it access to the share solves my problem, when I get home, and post the result.

I will also look more into the other apps you proposed, maybe they qualify as “DLNA compatible server” and ist just also works.

Cheers

I’ve seen some posts on here and reddit that had problems with media discovery when the app wasn’t using host networking. In the reddit post you linked the setup steps say he didn’t find a way to specify host networking.

For reference see

Thanks for your answer but I don’t think this is the issue.
I was able to use host networking by just enabling the corresponding checkbox (see my settings). Must have been an update after the reddit post, that added the checkbox. Or maybe this checkbox does something else completely but since I was able to detect the server from the music player, I assumed networking was okay.

Adding a user 1000 with the same group ID didn’t work by the way.

Will check out the post you linked and look into plex next probably

Did you add that user to the acls of the dataset you’ve mapped to the ap?

Yes, I did.
Explicitly added the new user to the ACL and I also added the auxiliary groups built-in users and apps to this new user, which also have access to the dataset.

I eventually got miniDLNA up and running as a custom app.

Here’s my experiences & eventual success:

Like you, I needed miniDLNA for a “non-smart” networked device, in my case an Oppo 203.

Resolved to using Plex now. It was surprisingly easy to set up and also enable DLNA although it feels like I am shooting with canons after sparrows (German proverb) as long as I am using Plex just for this purpose.

I GOT IT RUNNING
I eventually got miniDLNA running, the trick is to specify two additional environment variables
PGID and PUID and set both to the user the app should run as (568 in my case).
The note still says, that the app is running as unknown user and unknown group but the Permission denied error went away.
Don’t enable the “custom user” option, this will result in the same error as described in the beginning.

Not sure if this also helped but I created a dataset for the app and child datasets for log and library with corresponding ACLs, which I assigned to the corresponding directories of the container but it is working now and I don’t feel like trying what doesn’t work rn.

1 Like

Hi captain!
Thanks a lot, that’s the answer I was looking for, for several days now!
How did you come up with the environment variables idea?

Thanks

On the bottom of the docker page there is a link to an Ubuntu documentation page. There are many environment variables explained there for the app, but actually not these two, just one for the user (with a different variable name however?)
On the background of everything I found out thus far I dug deeper and on the github page of this app, there are a few examples, one of them is changing these variables, which I then also tried:

Still not sure why it would not take the IDs from the “custom user” option of the settings page though…
Maybe these are provided by Truenas but never collected by the app.

1 Like