Install YoutubeDL-Material Inside Docker Container in Linux

Install YoutubeDL-Material Inside Docker Container in Linux

YoutubeDL-Material is a web application for downloading videos and audio from YouTube and other websites. It is based on youtube-dl tool and provides mobile responsive web interface which is based on Material Design.

This tutorial explains how to install YoutubeDL-Material inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

You also need to have a running MongoDB container. Instructions can be found in the post.

Install YoutubeDL-Material

  • Host network

Run the following command to create a container for YoutubeDL-Material that uses host network:

docker run -d --name=youtubedl-material --restart=always --network=host \
    -v /opt/youtubedl-material/data:/app/appdata \
    -v /opt/youtubedl-material/audio:/app/audio \
    -v /opt/youtubedl-material/video:/app/video \
    -v /opt/youtubedl-material/subscriptions:/app/subscriptions \
    -v /opt/youtubedl-material/users:/app/users \
    -e ytdl_mongodb_connection_string=mongodb://admin:pwd123@127.0.0.1:27017 \
    -e ytdl_use_local_db=false \
    -e write_ytdl_config=true \
    tzahi12345/youtubedl-material

MongoDB container should run on host network as well.

  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, YoutubeDL-Material service is listening on port 17442. It can be changed with -p option.

docker network create app-net
docker run -d --name=youtubedl-material --restart=always --network=app-net \
    -p 8080:17442 \
    -v /opt/youtubedl-material/data:/app/appdata \
    -v /opt/youtubedl-material/audio:/app/audio \
    -v /opt/youtubedl-material/video:/app/video \
    -v /opt/youtubedl-material/subscriptions:/app/subscriptions \
    -v /opt/youtubedl-material/users:/app/users \
    -e ytdl_mongodb_connection_string=mongodb://admin:pwd123@mongodb:27017 \
    -e ytdl_use_local_db=false \
    -e write_ytdl_config=true \
    tzahi12345/youtubedl-material

MongoDB container should run on the same user-defined bridge network as well.

Notes:

  • Make sure that ytdl_mongodb_connection_string contains correct MongoDB admin password.
  • When user-defined bridge network is used, don't forget to change MongoDB container name which specified in ytdl_mongodb_connection_string.

Testing YoutubeDL-Material

To access web interface, open a web browser and go to http://<IP_ADDRESS>:17442, where <IP_ADDRESS> is the IP address of the system.

YoutubeDL-Material Inside Docker Container in Linux

Uninstall YoutubeDL-Material

To completely remove YoutubeDL-Material, remove its container:

docker rm --force youtubedl-material

Remove YoutubeDL-Material image:

docker rmi tzahi12345/youtubedl-material

You can also remove YoutubeDL-Material data:

sudo rm -rf /opt/youtubedl-material

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.