← Back to Home

K20 Server Media Stack: Jellyfin + qBittorrent Setup

April 10, 2026 • 8 min read

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:

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:

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:

Monitoring

Check service status:

sudo systemctl status jellyfin
sudo systemctl status qbittorrent

# View logs
journalctl -u jellyfin -f
journalctl -u qbittorrent -f

Lessons Learned

Next Steps