How to obtain your PUID and PGID on a Synology NAS
Ever wondered what this PUID and PGID on your Synology NAS is and what it's good for? Today, you'll find out !
If you're using a Synology Network Attached Storage (NAS) device, like me, you may have come across the terms PUID (Owner User ID) and PGID (Owner Group ID). These are unique identification numbers that are used to define the owner of a particular file or directory on the NAS. In this article, I'll explain what PUID and PGID are, and why they are important.
What are PUID and PGID?
Every file and directory on a Synology NAS is owned by a specific user and group. The PUID and PGID are the unique identification numbers for the user and group that own a particular file or directory.
The PUID is the Owner User ID, which identifies the user that owns the file or directory. The PGID is the Owner Group ID, which identifies the group that owns the file or directory.
Why are PUID and PGID important?
PUID and PGID are important for several reasons. First and foremost, they are used to determine who has access to a particular file or directory. For example, if a file or directory is owned by a specific user, only that user will have access to it. Similarly, if a file or directory is owned by a specific group, only members of that group will have access to it.
PUID and PGID are also used to determine the permissions that are granted to a particular file or directory. Permissions define what actions can be taken on a file or directory, such as reading, writing, or executing it. The permissions for a file or directory are determined by the user and group that owns it.
In addition, knowing your PUID and PGID is vital for installing many Docker applications on a Synology NAS, also when using Docker Compose files. This is because you will need the ids of the root or admin user to successful run certain Docker containers.
How to obtain your PUID and PGID on a Synology NAS
To obtain your PUID and PGID on a Synology NAS, you will need to use the id
command. You can either do this via a scheduled task or via the terminal as a root
user. Using a scheduled task is arguably the easiest and best for beginners.
Here's how you obtain the PUID and PGID using a s scheduled task
- In Synology's DSM GUI, navigate to the Control Panel and click on Task Scheduler under Services.
- Click on Create on the top left of the window and create a new task with Scheduled Task and then User-defined script.
- In the newly opened window, you can give the task a descriptive name in the General settings if you want. Importantly, you need to set User to
root
. - Then navigate to the Task Settings panel and type
id
into the Run command text box. - In this Task Settings panel, add your email address to be notified about the result of running the task. This will send you an email in which it displays your PUID and PGID, along with your user name and group name. The PUID will be listed as "uid", and the PGID will be listed as "gid". It may look like this:
uid=1000(admin) gid=100(users)
. - You can also go to the Schedule panel and set Run on the following date to a specific date and time if you prefer that.
- Otherwise, you are ready to go and can press OK. After a short while, you should receive the email with your PUID and PGID.
Here's how you obtain the PUID and PGID using the terminal
- Open the terminal on your Synology NAS. You can do this by going to Main Menu > Terminal.
- Type the following command and press Enter:
id
- This will display your PUID and PGID, along with your user name and group name. The PUID will be listed as "uid", and the PGID will be listed as "gid". It may look like this:
uid=1000(admin) gid=100(users)
.
That's it, you are done!
Now you know how to obtain your PUID and PGID on a Synology NAS in two different ways.
I hope this helped! Let me know if you have any other questions.