Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PUID PGID and UMASK

Featured Replies

I have many dockers with PUID, PGID and UMAS, I have never bothered and I always left the default values, it worker, but....

 

What is the impact If I use a PUID / PGID that doens't exist in Unraid?

Should I assign to all my dockers the PUID and PGID of the user nobody in Unraid?

Is the nobody user in unraid already hardened to use for docker containers?

If a docker doesn't need special permissions what should be the best way to configure it?

What should I do with UMASK?

 

Thanks in advance

  • Author

Some help please 🥲

With the templates, it should be best to leave them at the defaults as the maintainers would have already set the appropriate values accordingly.  IE: set them to be nobody

 

Unraid doesn't have "users" in the normal Linux way.  

 

The huge value in docker containers is that they don't have permissions to anything anywhere on your array unless you've explicitly granted them access to it (via the path mappings and whether or not its read-only or read/write).  The PUID / PGID and UMASK basically set the permissions of the files that it writes to the array (if it does) to something that's compatible with Unraid's implementation of user shares.

  • Author
10 hours ago, Squid said:

With the templates, it should be best to leave them at the defaults as the maintainers would have already set the appropriate values accordingly.  IE: set them to be nobody

 

Unraid doesn't have "users" in the normal Linux way.  

 

The huge value in docker containers is that they don't have permissions to anything anywhere on your array unless you've explicitly granted them access to it (via the path mappings and whether or not its read-only or read/write).  The PUID / PGID and UMASK basically set the permissions of the files that it writes to the array (if it does) to something that's compatible with Unraid's implementation of user shares.

 

But for example I mostly use linuxserver.io images

https://docs.linuxserver.io/images/docker-mariadb

imagen.png.51c60f3040b7220ed14aa8a8649b05c6.png

 

I read somewhere that unraid uses "nobody" user for docker so if I do this

 

imagen.png.c4329c29695d84bd6c0055bfa8c6a07d.png

 

Should I use that UID and GID as PUID and PGID? or as you said my asumption doesn't make any sense? Please consider that linuxserver.io doesn't specifically create the dockers for unraid.

 

I am asking this because I get this error in mariadb log

imagen.png.5e381ec344b60da38252b61262b69b7b.png

  • 1 year later...
  • Author

can I get an answer to this please?

Should I use PUID, PGID 99 and 100 for all the containers?

 

I'm starting to use compose with official docker images and the users appears as unknown and I am using

      - PUID=1000

      - PGID=100

but is not being applied.

 

imagen.thumb.png.a040d96803bdb5608931b8ed2120eba2.png

 

What this means in terms of permissions? why the correct permissions aren't being applied?

What is the correct/safe way to do this?

 

imagen.png.17077f017458b926fd9b5feff55688fc.png

 

imagen.png.8702dc874548a5d0607975a4945c3a74.png

 

imagen.png.4ffacb10d12f9d27c67166e14871e74e.png

 

imagen.png.3d34fbecc10f56d9d191b9077b126208.png

 

This is the docker compose

 

###############################################################
# Nextcloud
###############################################################

version: '3.8'

# Networks ####################################################

networks:
  br1:
    driver: macvlan
    external: true
  nextcloud_network:
    internal: true

# Services ####################################################

services:

  mariadb:
    image: mariadb:10.6
    container_name: MariaDBNC
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    healthcheck:
      test: ["CMD-SHELL", "mysql nextcloud -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'SELECT 1;'  || exit 1"]
      interval: 2s
      retries: 120
    volumes:
      - /mnt/user/Docker/Nextcloud/mariadb:/var/lib/mysql
    environment:
      - TZ
      - PUID
      - PGID
      - MYSQL_ROOT_PASSWORD
      - MYSQL_PASSWORD
      - MYSQL_DATABASE
      - MYSQL_USER
      - MARIADB_AUTO_UPGRADE=1
      - MARIADB_DISABLE_UPGRADE_BACKUP=1
    networks:
      - nextcloud_network 
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  redis:
    image: redis:alpine
    container_name: RedisNC
    restart: unless-stopped
    command: redis-server --requirepass $REDIS_HOST_PASSWORD
    volumes:
      - /mnt/user/Docker/Nextcloud/redis:/data
    environment:
      - TZ
      - PUID
      - PGID
    networks:
      - nextcloud_network
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  app:
    image: nextcloud:fpm-alpine
    container_name: Nextcloud
    restart: unless-stopped
    depends_on:
      mariadb:
        condition: service_healthy
    volumes:
      - /mnt/user/Docker/Nextcloud/nextcloud:/var/www/html
      - /mnt/user/Docker/Nextcloud/nextcloud/config:/var/www/html/config
      - /mnt/user/Media/Nextcloud:/var/www/html/data
      - type: tmpfs
        target: /tmp
        tmpfs:
          size: 1000000000
    environment:
      - TZ
      - PUID
      - PGID
      - MYSQL_PASSWORD
      - MYSQL_DATABASE
      - MYSQL_USER
      - MYSQL_HOST=mariadb
      - REDIS_HOST=redis
      - REDIS_HOST_PASSWORD
    networks:
      - nextcloud_network
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  web:
    build: ./web
    container_name: Nginx-fpm
    restart: always
    networks:
      nextcloud_network:
      br1:
        ipv4_address: 10.10.40.160
    ports:
      - 8080:80
    volumes:
      - /mnt/user/Docker/Nextcloud/nextcloud:/var/www/html:ro
    environment:
      - TZ
      - PUID
      - PGID
    depends_on:
      - app

  cron:
    image: nextcloud:fpm-alpine
    container_name: CronNC
    restart: unless-stopped
    depends_on:
      - mariadb
      - redis
    volumes:
      - /mnt/user/Docker/Nextcloud/nextcloud:/var/www/html
    environment:
      - TZ
      - PUID
      - PGID
    networks:
      - nextcloud_network
    entrypoint: /cron.sh
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

 

Edited by L0rdRaiden

  • Community Expert
9 hours ago, L0rdRaiden said:

Should I use PUID, PGID 99 and 100 for all the containers?

Yes. The unraid os does not make use of users and groups the way generic linux distros do. For docker purposes you should use the user nobody "PUID, PGID 99 and 100"

  • Author
11 hours ago, primeval_god said:

Yes. The unraid os does not make use of users and groups the way generic linux distros do. For docker purposes you should use the user nobody "PUID, PGID 99 and 100"

 

and is there a way to force the docker compose above to do that? or it must be natively supported by the image?

  • Community Expert

PGID and PUID have to be supported by the container. In the compose file above i see that the environment section for each container has empty PGID and PUID entries. Did you add those in or were they there already? If they were already there then you just need to assign the correct values to them.

  • Author
14 hours ago, primeval_god said:

PGID and PUID have to be supported by the container. In the compose file above i see that the environment section for each container has empty PGID and PUID entries. Did you add those in or were they there already? If they were already there then you just need to assign the correct values to them.

 

the values are in a env file, but the permissions aren't being applied probably because the containers don't support it. I'm using the official containers and although I have included PGID an PUID I don't see them as supported in the official documentation

  • 1 year later...

@Findthelorax def an issue with the app data folder that was created.. there was a permission issue. I believe the issue is the UMASK should be `002` and not `022`

  • 2 months later...

As I have come to understand, if you are running a container in Unraid that supports GUID/PUID/UMASK, setting them to 99:100, the UMASK should actually be 000. By default, files created by nobody:users in Unraid are provided 777:666 access. UMASK is used to remove permissions from files. It cannot add any. Putting a UMASK other than 000 on a container running with Unraid PUID:GUID would in effect, reduce access to the files created by the container.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.