UID/GID Configuration
Configure user and group permissions for seamless bind mount compatibility across different host systems, particularly NAS environments.
Overview
Palmr. supports runtime UID/GID configuration to resolve permission conflicts when using bind mounts. This eliminates the need for manual permission management on your host system.
⚠️ Important: Palmr uses UID 1000, GID 1000 by default, which matches the standard Linux convention. However, some systems may use different UID/GID values, which can cause permission issues with bind mounts.
The Permission Problem
Why This Happens
- Palmr Default: UID 1000, GID 1000 (container)
- Linux Standard: UID 1000, GID 1000 (most host systems)
- Result: Usually compatible, but some systems may use different values
Common Error Scenarios
Quick Fix
Option 1: Set Palmr to Use Standard UID/GID (Recommended)
Add these environment variables to your docker-compose.yaml
:
Option 2: Change Host Directory Permissions
If you prefer to keep Palmr's defaults:
Environment Variables
Configure permissions using these optional environment variables:
Variable | Description | Default | Example |
---|---|---|---|
PALMR_UID | User ID for container processes | 1001 | 1000 |
PALMR_GID | Group ID for container processes | 1001 | 1000 |
Finding Your Host UID/GID
Determine your host system's user and group IDs:
Use the uid
and gid
values for your PALMR_UID
and PALMR_GID
configuration.
Configuration Examples
Standard Linux System (Most Common)
Synology NAS
QNAP NAS
Troubleshooting
Common Permission Errors
Error: EACCES: permission denied
Error: Container starts but files aren't accessible
Verification Commands
Verify UID/GID settings are applied correctly:
Advanced Troubleshooting
NAS-specific debugging:
Docker bind mount issues:
When to Configure
UID/GID configuration is required when:
- ✅ Using bind mounts (most common case)
- ✅ Encountering "permission denied" errors
- ✅ Deploying on NAS systems (Synology, QNAP, etc.)
- ✅ Host system uses different default UID/GID values
- ✅ Running multiple containers that need to share files
UID/GID configuration is optional when:
- ❌ Using Docker named volumes (Docker manages permissions)
- ❌ Not using bind mounts
- ❌ No permission errors occurring
Migration Guide
Existing Installations
To add UID/GID configuration to running installations:
-
Stop the container
-
Backup your data
-
Check your UID/GID
-
Update configuration Add UID/GID variables to your
docker-compose.yaml
: -
Restart with new configuration
Implementation Details
The UID/GID configuration process:
- Detection - Environment variables are read during container startup
- Ownership Update - File permissions are adjusted to match target UID/GID
- Privilege Drop - Application runs with specified user permissions via
su-exec
- Logging - Configuration changes are logged for verification
This approach provides automatic permission management without user creation or system modification.
Build-Time Configuration
For custom base images with different default values:
Runtime environment variables override build-time defaults.
Benefits
- Zero Configuration - Works automatically when environment variables are set
- Universal Compatibility - Supports any valid UID/GID combination
- NAS Optimized - Tested with major NAS platforms
- Backward Compatible - Existing deployments continue without modification
- Performance Optimized - Lightweight implementation using
su-exec
Summary
For most users experiencing permission issues with bind mounts:
- Find your UID/GID: Run
id
command - Add to docker-compose.yaml:
- Restart:
docker-compose down && docker-compose up -d
This ensures compatibility between Palmr's UID/GID and your host system's file ownership.