Set up your own self-hosted media server using Jellyfin and Docker on Ubuntu Server 24.04. This guide walks through partitioning a secondary drive, mounting it, installing Docker with a custom script, and deploying Jellyfin using Docker Compose.
Jellyfin is a free, open-source alternative to Plex with no subscriptions, no ads, and no cloud lock-in.
sudo apt update && sudo apt upgrade -y
In this example, the extra disk is located at /dev/sda.
sudo fdisk /dev/sda
Inside fdisk:
n to create a new partitionp to select primaryw to write and exitsudo mkfs.ext4 /dev/sda1
sudo mkdir /mnt/media
sudo mount /dev/sda1 /mnt/media
echo "/dev/sda1 /mnt/media ext4 defaults 0 2" | sudo tee -a /etc/fstab
sudo mkdir -p /mnt/media/{Movies,TV,Music}
Use the KeepItTechie install script hosted here: docker-script
wget https://wiki.kitpro.us/install-docker.sh
chmod +x install-docker.sh
sudo ./install-docker.sh
mkdir ~/jellyfin && cd ~/jellyfin
nano docker-compose.yml
Paste in the following configuration:
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
network_mode: host
volumes:
- jellyfin_config:/config
- jellyfin_cache:/cache
- /mnt/media:/media
restart: unless-stopped
volumes:
jellyfin_config:
jellyfin_cache:
Run the container:
docker compose up -d
Then open your browser and visit:
http://<your-server-ip>:8096
Select your language
Create an admin account
Add media libraries:
/media/Movies/media/TV/media/MusicLeave default metadata sources (TMDb, MusicBrainz)
Finish the setup wizard
Jellyfin can be accessed through:
Refer to the official documentation for full client setup:
https://jellyfin.org/docs/
This guide was created alongside a YouTube tutorial by Josh from KeepItTechie.
Watch the full video: https://youtu.be/7iPyIyhRddY
Visit the channel: https://www.youtube.com/c/KeepItTechie