K20 Server Media Stack: Jellyfin + qBittorrent Setup
Overview
After converting my broken Lenovo K20 laptop into a headless Debian server, the next step was setting up a media stack. This post covers installing Jellyfin (media server) and qBittorrent (download client) with proper permission management.
Why K20?
The K20 server (Intel i3-5010U, 8GB RAM, 60GB SSD) is perfect for media serving:
- x86_64 architecture - Better software compatibility than ARM
- Hardware transcoding - Intel QuickSync support
- SSD storage - Fast library scanning and metadata operations
- Low power - ~15-25W idle, suitable for 24/7 operation
Installation Steps
1. System Preparation
Start with a fresh Debian 13 installation. Update packages and install prerequisites:
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl gnupg apt-transport-https
2. Create Media User and Groups
Security best practice: run services under dedicated user accounts, not root.
# Create media group
sudo groupadd media
# Create media user
sudo useradd -r -g media -d /opt/media -s /usr/sbin/nologin media
# Create media directories
sudo mkdir -p /opt/media/{downloads,torrents,movies,tv,Music}
sudo chown -R media:media /opt/media
sudo chmod -R 755 /opt/media
3. Install Jellyfin
# Add Jellyfin repository
curl -fsSL https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | \
sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/jellyfin.gpg
echo "deb [arch=$(dpkg --print-architecture)] \
https://repo.jellyfin.org/debian $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/jellyfin.list
# Install Jellyfin
sudo apt update
sudo apt install -y jellyfin
# Enable and start service
sudo systemctl enable jellyfin
sudo systemctl start jellyfin
4. Install qBittorrent
# Add qBittorrent PPA (or use official repo)
sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
sudo apt update
sudo apt install -y qbittorrent-nox
# Create systemd service for qBittorrent
sudo nano /etc/systemd/system/qbittorrent.service
Service file content:
[Unit]
Description=qBittorrent Daemon Service
After=network.target
[Service]
Type=forking
User=media
Group=media
UMask=002
ExecStart=/usr/bin/qbittorrent-nox -d --confdir=/opt/media/.config/qBittorrent
Restart=on-failure
[Install]
WantedBy=multi-user.target
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable qbittorrent
sudo systemctl start qbittorrent
Permission Configuration
The key to a smooth media stack is proper permissions. Both services need access to the same media directories.
Directory Structure
/opt/media/
├── downloads/ # qBittorrent download location
│ ├── torrents/ # Completed downloads
│ └── incomplete/ # In-progress downloads
├── movies/ # Jellyfin library
├── tv/ # Jellyfin library
└── Music/ # Jellyfin library
UMask Configuration
Set umask to 002 so files created by qBittorrent are readable
by Jellyfin (same group).
# Edit /etc/profile or ~/.bashrc
umask 002
# Or set in systemd service (as shown above)
Network Configuration
Both services run on the local network. Access via:
- Jellyfin:
http://<server-ip>:8096 - qBittorrent WebUI:
http://<server-ip>:8080
Security note: These services are only accessible from the local network. For remote access, use a VPN or reverse proxy with authentication.
Performance Tuning
Jellyfin Hardware Transcoding
Enable Intel QuickSync for hardware-accelerated transcoding:
# Install Intel media drivers
sudo apt install -y intel-media-va-driver-non-free libmfx1
# Add media user to render group
sudo usermod -aG render media
# In Jellyfin Dashboard → Playback → enable Hardware Acceleration
qBittorrent Connection Limits
Adjust connection limits based on your network:
- Global max connections: 500
- Max connections per torrent: 50
- Upload slots: 20
Monitoring
Check service status:
sudo systemctl status jellyfin
sudo systemctl status qbittorrent
# View logs
journalctl -u jellyfin -f
journalctl -u qbittorrent -f
Lessons Learned
- Permission issues are the #1 problem - Spend time getting this right from the start.
- Don't run as root - Dedicated service users prevent security issues and file permission conflicts.
- SSD makes a difference - Library scanning and metadata operations are noticeably faster than on HDD.
- Hardware transcoding works well - The K20's Intel HD Graphics 5500 handles 1080p transcoding without breaking a sweat.
Next Steps
- Add automated download monitoring (Sonarr/Radarr)
- Configure remote access via VPN
- Set up automated backups
- Integrate with existing NAS for additional storage