Quick Guide to Setting Up Emby Media System on Generic VPS
- Published on
- ...
- Authors

- Name
- Huashan
- @herohuashan
🧠 Overview
This tutorial teaches you how to set up a complete media streaming system on a VPS, based on Docker environment, implementing:
CloudDrive2: Mount cloud storage resources like Baidu Cloud, Aliyun Drive, etc.
Emby: Media server for managing and streaming movies online
MetaTube: Advanced scraping plugin for Emby to automatically complete movie metadata, covers, and actor information
The advantages of this solution:
🧩 Stream directly from cloud storage without downloading locally
💾 Save VPS storage space
🎬 Automatically generate complete media information and covers
🧱 Environment Preparation
System Requirements
VPS System: Ubuntu 22.04 LTS or higher
Hardware: 2 cores + 2GB RAM minimum
Network: Overseas VPS recommended or with proxy capability
Install Docker & Compose
sudo apt update && sudo apt upgrade -y
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo usermod -aG docker $USER
Restart terminal to take effect.
🧩 System Architecture
| Component | Function |
|---|---|
| CloudDrive2 | Mount cloud drives (Baidu, Aliyun, etc.) to VPS |
| Emby | Media server for playback and categorization |
| MetaTube | Provide rich AV/video metadata scraping |
System architecture path:
CloudDrive2 → /opt/clouddrive # Cloud drive mount directory
Emby → /opt/clouddrive_links # Movie symlink directory
MetaTube → Emby plugin metadata source
☁️ CloudDrive2 Cloud Drive Mounting
docker-compose Configuration
Create file in your project directory:
mkdir -p ~/docker_app
cd ~/docker_app
nano compose_emby.yml
Add the following content:
services:
clouddrive2:
image: cloudnas/clouddrive2:latest
container_name: clouddrive2
restart: unless-stopped
privileged: true
devices:
- /dev/fuse:/dev/fuse
volumes:
- clouddrive2_config:/Config
- /opt/clouddrive:/source:shared
environment:
- TZ=Asia/Shanghai
ports:
- "19798:19798"
volumes:
clouddrive2_config:
Start:
docker-compose -f compose_emby.yml up -d clouddrive2
Access:
http://your_IP:19798
Default credentials: admin / admin (change after first login).
🎬 Emby Media Server
Add to the same compose_emby.yml:
emby:
image: emby/embyserver:latest
container_name: emby
restart: unless-stopped
privileged: true
environment:
- UID=1000
- GID=1000
- TZ=Asia/Shanghai
- LANG=en_US.UTF-8
- LC_ALL=en_US.UTF-8
volumes:
- emby_config:/config
- /opt/clouddrive:/media:rshared,slave
- /opt/clouddrive_links:/medialibrary:rshared
- /tmp:/transcode
ports:
- "8096:8096"
- "8920:8920"
volumes:
emby_config:
Start:
docker-compose -f compose_emby.yml up -d emby
Access Emby:
http://your_IP:8096
Set up English interface, then add media library:
Type: Movies / TV Shows
Path: /medialibrary
🧠 MetaTube Plugin Deployment & Configuration
1️⃣ Run MetaTube Server
Create metatube-compose.yml:
cd ~/docker_app
nano metatube-compose.yml
Add:
services:
metatube-server:
image: ghcr.io/metatube-community/metatube-server:latest
container_name: metatube
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- /home/user/metatube/config:/config
- /home/user/metatube/cache:/cache
environment:
- TZ=Asia/Shanghai
- MT_LOG_LEVEL=debug
- HTTP_PROXY=http://127.0.0.1:7890 # Remove if no proxy
- HTTPS_PROXY=http://127.0.0.1:7890
- NO_PROXY=127.0.0.1,localhost,192.168.0.0/16
networks:
- app_network
networks:
app_network:
external: true
Run:
docker-compose -f metatube-compose.yml up -d
Verify:
curl http://your_IP:8080/
Returns:
{"data":{"app":"metatube","version":"v1.7.x"}}
Startup successful ✅
2️⃣ Confirm Configuration File
Create /home/user/metatube/config/config.json:
cat >/home/user/metatube/config/config.json <<'JSON'
{
"providers": ["javdb", "bgn", "fc2hub", "javlibrary", "avmoo"],
"server": {
"port": 8080,
"enable_logging": true
}
}
JSON
docker restart metatube
Verify loading:
docker logs -f metatube | grep -Ei "bgn|fc2hub|Loaded"
3️⃣ Emby Plugin Installation
Download plugin package: MetaTube GitHub Releases
Open Emby admin console → Plugins → "Install Plugin" → Upload ZIP file.
Restart Emby after installation.
4️⃣ Emby Plugin Configuration
Go to Emby plugins → MetaTube Settings:
Server URL: http://your_IP:8080
Token: Leave empty or customize (must match server)
Movie provider filter: javdb,fc2hub,bgn,javlibrary,avmoo
Save, then rescan media library.
5️⃣ Test Interface
Test on host machine if data returns correctly:
curl "http://your_IP:8080/v1/movies/search?q=FC2-PPV-1317995&provider=fc2hub&fallback=true"
If returns 200 with cover or title, it's working.
🔧 System Maintenance & Updates
Update all components:
cd ~/docker_app
docker-compose -f compose_emby.yml pull
docker-compose -f compose_emby.yml up -d
docker-compose -f metatube-compose.yml pull
docker-compose -f metatube-compose.yml up -d
View logs:
docker logs clouddrive2
docker logs emby
docker logs metatube
⚙️ Advanced Optimization
Proxy Support
MetaTube network needs access to javdb.com / bgn.dev / fc2hub.com.
If proxy access needed, ensure docker run or compose includes:
environment:
- HTTP_PROXY=http://127.0.0.1:7890
- HTTPS_PROXY=http://127.0.0.1:7890
DNS Optimization
If container DNS resolution fails, add to compose:
dns:
- 223.5.5.5
- 119.29.29.29
🧰 Common Troubleshooting
| Issue | Solution |
|---|---|
| dial tcp: lookup ... server misbehaving | Docker DNS unavailable, switch to Aliyun/Tencent DNS |
| Can't find FC2/BGN | Check if providers in config.json; add proxy if needed |
| /api/version returns 404 | Don't worry, MetaTube new version uses / or /v1/... paths |
| Emby doesn't show MetaTube | Plugin not enabled or server address wrong, confirm port 8080 accessible |
🎉 Summary
Through this tutorial, you've successfully deployed on VPS:
✅ CloudDrive2 cloud drive mounting
✅ Emby media server
✅ MetaTube intelligent scraping
Now you can browse movies from cloud drives directly in Emby and get complete posters, actors, synopsis, and series information.
Related Posts
Complete Guide to Setting Up Emby on FNOS System
Git Fundamentals and Workflow: A Complete Guide from Principles to Team Collaboration
Enterprise Internal Development Flow vs GitHub Open Source Project Flow Comparison
Comparing enterprise three-environment release process (DEV QUAL PROD) with GitHub open source project CI/CD automation workflow, sharing pros and cons of two different development models and applicable scenarios.