Youtarr supports running against an existing MariaDB or MySQL instance. This guide walks you through preparing the database, configuring the container, and testing the setup locally so you can ship a confident experience to users who already manage their own database (including UNRAID deployments).
- MariaDB 10.3+ or MySQL 8.0+ reachable from the Youtarr container
- A database/schema dedicated to Youtarr (default name
youtarr) - A user with full privileges on that schema
- UTF-8 support (
utf8mb4/utf8mb4_unicode_ci)
Tip: Keep the database and Youtarr container on the same Docker network or ensure routing/firewall rules allow traffic from Youtarr to the DB host/port.
Run the following SQL on your target database host (adjust usernames/passwords as needed to match your .env):
CREATE DATABASE youtarr CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'youtarr'@'%' IDENTIFIED BY 'change-me';
GRANT ALL PRIVILEGES ON youtarr.* TO 'youtarr'@'%';
FLUSH PRIVILEGES;If your platform limits wildcard access, replace '%' with the container's IP or network CIDR.
-
Edit your .env file and add your external DB configuration
-
Verify the following keys are set to the same values you used for the DB:
DB_HOST: The host the DB is reachable at from Youtarr (eg. 192.168.1.XXX)DB_PORT: The port your DB is exposed onDB_USER/DB_PASSWORD: The username and password you used to create the user for youtarrDB_NAME: The database name you created for youtarr
-
Start Youtarr without it's normally bundled DB using the convenience script:
# Docker Compose helper (launches only the app container) ./start-with-external-db.sh- Add
--no-authif you are fronting Youtarr with your own authentication layer - Provide
AUTH_PRESET_USERNAMEandAUTH_PRESET_PASSWORD(either via .env or via your platform's UI) when you need to bypass the localhost-only setup wizard
- Add
To revert to the bundled database, simply run ./start.sh without the flag.
If you prefer manual Docker Compose commands:
# Launch the single-service stack that targets your external database
docker compose -f docker-compose.external-db.yml up -dThe script at ./scripts/create-external-test-db.sh has been provided to create a local DB for testing
This should not normally be needed for most users.
- Authentication errors: confirm the credentials in
.envmatch the DB user and that the user has access from the container's IP. - Connection timeout: ensure the DB port is open and routable from the Docker network; check firewall or security group rules.
- Schema mismatch: rerun
./start-with-external-db.shafter clearing out a misconfigured database—the app will apply migrations automatically on startup. - Character-set warnings: verify the database is created with
utf8mb4so emoji and YouTube metadata are stored correctly.
See Troubleshooting for database-specific troubleshooting steps.