Lesson 2.2: Your First Service - MeTube
Completion requirements
Introduction to MeTube
MeTube is a web-based YouTube downloader that provides a clean interface for downloading videos and audio from YouTube and other platforms.
Why MeTube as First Service?
- Simple Setup: Minimal configuration required
- Practical Use: Immediately useful service
- Web Interface: Easy to test and verify
- No Dependencies: Self-contained application
MeTube Docker Deployment
Basic Docker run command:
docker run -d
--name metube
-p 8081:8081
-v /path/to/downloads:/downloads
alexta69/metube
MCT Services MeTube Configuration
Our production MeTube setup:
version: "3.8"
services:
metube:
image: alexta69/metube:latest
container_name: metube
restart: unless-stopped
ports:
- "8081:8081"
volumes:
- ./downloads:/downloads
- ./metube-config:/app/config
environment:
- UID=1000
- GID=1000
- DOWNLOAD_DIR=/downloads
- AUDIO_DOWNLOAD_DIR=/downloads/audio
labels:
- "traefik.enable=true"
- "traefik.http.routers.metube.rule=Host(`metube.mct.local`)"
- "traefik.http.services.metube.loadbalancer.server.port=8081"
Directory Structure
Organize your MeTube files:
metube/
├── docker-compose.yml
├── downloads/
│ ├── video/
│ └── audio/
└── config/
└── metube.conf
Environment Variables
Key configuration options:
- UID/GID: User permissions for downloaded files
- DOWNLOAD_DIR: Where videos are saved
- AUDIO_DOWNLOAD_DIR: Separate audio downloads
- OUTPUT_TEMPLATE: Filename format
Volume Mapping Strategy
Important volume considerations:
- Downloads: Map to accessible host directory
- Permissions: Ensure proper user ownership
- Space: Monitor disk usage for downloads
- Backup: Include in backup strategy
Testing Your Deployment
- Container Status:
docker ps - Logs:
docker logs metube - Web Access: http://localhost:8081
- Download Test: Try downloading a short video
- File Permissions: Check downloaded file ownership
Common Issues and Solutions
Permission Denied
# Fix ownership of downloads directory
sudo chown -R 1000:1000 ./downloads
Port Already in Use
# Check what is using the port
sudo netstat -tulpn | grep :8081
# Use different port
-p 8082:8081
Container Won not Start
# Check detailed logs
docker logs metube --details
# Check container configuration
docker inspect metube
Security Considerations
- Network Access: Consider firewall rules
- Download Limits: Monitor disk usage
- User Access: Control who can access the service
- Content Policy: Respect copyright and terms of service
Practical Exercise
Task: Deploy and configure MeTube
- Create project directory structure
- Write Docker Compose configuration
- Deploy MeTube service
- Configure hosts file for metube.local
- Test video download functionality
- Verify file permissions and ownership
- Document any issues and solutions
Next Steps
After mastering MeTube deployment:
- Add Traefik labels for reverse proxy
- Implement SSL certificates
- Set up automated backups
- Monitor resource usage
Last modified: Thursday, 6 November 2025, 8:49 AM