This document provides a comprehensive reference for all environment variables supported by Youtarr.
- Required Variables
- Database Configuration
- Authentication
- User and Permissions
- Platform Deployment
- Development and Debugging
- Docker Configuration
Required: Yes
Default: ./downloads
Description: Directory on the host machine where downloaded YouTube videos will be stored
Example Values:
- Linux/Mac:
/mnt/media/youtubeor/home/user/videos/youtube - Windows:
C:/Media/YouTube(use forward slashes) - Synology NAS:
/volume1/media/youtube
Important Notes:
- This path must exist on your host system before starting the containers
- Ensure the directory has appropriate write permissions for the configured UID/GID
- For network storage, mount the storage before starting Youtarr
When using the bundled MariaDB container, these variables typically use their defaults:
Required: No
Default: youtarr-db (internal container name)
Description: Database hostname or IP address
Example: 192.168.1.100 (for external database)
Required: No
Default: 3321
Description: Database port number
Note: Both internal and external databases use port 3321 as the default for Youtarr
Required: No
Default: root
Description: Database username
Note: If switching from root, ensure MYSQL_USER is configured in docker-compose.yml
Required: No
Default: 123qweasd
Description: Database password
Security: Change this in production environments
Required: No
Default: youtarr
Description: Database name for Youtarr DB
Required: Only for internal database setup
Default: 123qweasd
Description: Root password for MariaDB container
Note: Only used when creating the internal database container
To use an external database:
- Uncomment and configure DB_HOST, DB_PORT, DB_USER, DB_PASSWORD in your .env file
- Ensure the external database has utf8mb4 character set support
- See docs/platforms/external-db.md for detailed setup
Required: No
Default: true
Options: true, false
Description: Enable/disable built-in authentication
Warning: Never set to false when exposed to the internet
Use Cases for Disabling:
- When only using Youtarr in an environment that is not exposed to the internet
- When behind a VPN
- When using reverse proxy with authentication
- Platform deployments with external auth (e.g., Cloudflare Access)
Required: No Default: None Description: Pre-configured admin username for automated deployments Validation: 3-32 characters, no leading/trailing spaces
Required: No Default: None Description: Pre-configured admin password for automated deployments Validation: 8-64 characters
Important Notes:
- These override any existing credentials in config.json
- If not set, credentials must be configured through the web UI on first access via
localhost - Useful for deployment environments where you may not have access to
localhostvia a browser as this removes the requirement to set your initial login credentials via the web UI.
Required: No
Default: 0 (root)
Recommended: 1000 (typical first user on Linux)
Description: User ID for running Youtarr inside the container
Required: No
Default: 0 (root)
Recommended: 1000
Description: Group ID for running Youtarr inside the container
Important Setup Steps:
Note: The /path/to/youtube/videos is just an example. Use the path you have configured in your .env file.
- Create required directories:
mkdir -p config jobs server/images /path/to/youtube/videos - Set ownership to match UID/GID:
sudo chown -R 1000:1000 ./config ./jobs ./server/images sudo chown -R 1000:1000 /path/to/youtube/videos
Affected Directories:
config/*- Configuration filesjobs/*- Job state and artifactsserver/images/*- Thumbnails and cache${YOUTUBE_OUTPUT_DIR}- Downloaded videos
Required: No (Platform-specific)
Default: None
Description: Override video storage path inside container
Example: /storage/rclone/storagebox/youtube
Used By: Elfhosted and similar platform deployments. Most users will never need to use this setting.
Behavior:
- When set, consolidates all data under
/app/config/ - Creates platform-specific subdirectories
- Internally the container will write to DATA_PATH instead of the default of
/usr/src/app/data/
Required: No
Default: None
Description: Pre-configured Plex server URL
Example: http://plex:32400
Note: Overrides plexIp, plexPort and plexViaHttps from config.json
Required: No
Default: info
Options: warn, info, debug
Description: Controls logging verbosity
warn: Minimal logging, errors and warnings onlyinfo: Standard logging for productiondebug: Verbose logging for troubleshooting
Required: No
Default: UTC
Description: Timezone for scheduled jobs and cleanup tasks
Format: IANA timezone (e.g., America/Los_Angeles, Europe/Paris)
Note: Affects cron job execution times in Youtarr container.
Required: No
Default: dialmaster/youtarr:latest
Description: Docker image selection
Development: Set to youtarr-dev:latest for local builds
Note: Development scripts handle this automatically
These variables are used by docker-compose.yml but not directly by the application:
- Container names are automatically prefixed with the directory name
- Default containers:
youtarr,youtarr-db
- Network:
youtarr-network(internal bridge) - Application port: 3087 (host) → 3011 (container)
- Database port: 3321 (both host and container)
- Always change default passwords in production
- Never disable AUTH_ENABLED for internet-exposed instances
- Use non-root UID/GID (set YOUTARR_UID=1000)
- Existing Youtarr users that were previously using the default root GID/UID (0:0) will need to completely stop Youtarr and ensure that directory permissions are updated if they want to switch from root UID/GID to non-root
- Secure your .env file with appropriate permissions:
chmod 600 .env
- Use local storage when possible for better performance
- Set appropriate LOG_LEVEL (
infofor production,debugonly when needed) - Configure timezone to match your location for accurate scheduling
- Backup your .env file along with your configuration
- Document any custom variables for your deployment
- Test configuration changes in a development environment first
Variables are processed in this order (highest to lowest priority):
- Environment variables set at runtime
- Variables defined in .env file
- Default values in docker-compose.yml
- Application defaults
If you see "Permission denied" errors:
- Check YOUTARR_UID/GID match your file ownership
- Verify directory permissions with
ls -la - Fix ownership:
sudo chown -R ${UID}:${GID} ./config ./jobs ./server/images
- Verify DB_HOST is reachable:
ping ${DB_HOST} - Check DB_PORT is open:
telnet ${DB_HOST} ${DB_PORT} - Confirm credentials with:
mysql -h ${DB_HOST} -P ${DB_PORT} -u ${DB_USER} -p
- If locked out, set AUTH_PRESET_USERNAME and AUTH_PRESET_PASSWORD
- These override existing credentials on each restart
- Remove them after regaining access to prevent continued override (or leave them in place to prevent any updates to credentials via the web UI)