7 min read
Jellyfin Server running on Alpine Linux with Docker

Welcome to this step-by-step guide on setting up Jellyfin media server using Alpine Linux and Docker! If you’ve got an old laptop gathering dust, this is a fantastic way to give it a new lease on life. By the end of this guide, you’ll have a lightweight, efficient media server that you can access from any device on your network. Let’s dive in!


Why Alpine Linux and Docker for Jellyfin?

  • Alpine Linux is a minimal, lightweight Linux distribution that’s perfect for older hardware. It keeps resource usage low, ensuring your laptop runs smoothly.

  • Docker allows you to run Jellyfin in a container, making it easy to manage, update, and isolate from the rest of your system.

  • Jellyfin is an open-source media server that lets you stream your movies, music, and TV shows to any device.

This combination ensures your old laptop can handle the task efficiently while keeping things simple to set up and maintain.


Prerequisites

Before we start, make sure you have:

  • An old laptop with:

    • An x86_64 (64-bit) processor.

    • At least 1 GB of RAM (2 GB or more recommended).

    • Enough disk space for the OS and your media files (a 16 GB drive is sufficient for the OS, but you’ll need more for media).

  • A USB drive (at least 1 GB) to create a bootable installation media.

  • A stable internet connection for downloading the ISO and Docker images.

  • Basic familiarity with the command line (don’t worry, we’ll walk through each step).


Step 1: Download the Alpine Linux ISO

  1. Visit the Alpine Linux downloads page.

  2. Under the “Standard” section, download the x86_64 ISO (e.g., alpine-standard--x86_64.iso).

  3. Save the ISO file to your current computer.

Why? Alpine Linux is lightweight and perfect for older hardware, ensuring your media server runs efficiently.


Step 2: Create a Bootable USB Drive

  1. Download and install a tool like Rufus (for Windows) or Etcher (for macOS/Linux).

  2. Insert your USB drive into your current computer.

  3. Open Rufus or Etcher:

    • Select your USB drive.

    • Choose the Alpine Linux ISO file you downloaded.

    • Click “Start” or “Flash” to create the bootable USB.

Warning: Make sure to back up any data on the USB drive, as it will be erased.


Step 3: Boot the Laptop from the USB Drive

  1. Insert the bootable USB drive into your old laptop.

  2. Power on the laptop and enter the BIOS/UEFI settings (usually by pressing F2, F12, Delete, or Esc during startup).

  3. Change the boot order to boot from the USB drive first.

  4. Save the changes and exit the BIOS/UEFI settings.

  5. The laptop should now boot from the USB drive and load the Alpine Linux installer.

Troubleshooting: If the laptop doesn’t boot from the USB, double-check the boot order or try recreating the bootable USB.


Step 4: Install Alpine Linux

  1. Once booted, you’ll see the Alpine Linux login prompt. Log in as root (no password required).

  2. Run the following command to start the installation script: setup-alpine

  3. Follow the on-screen prompts:

    • Choose your keyboard layout.

    • Set a hostname (e.g., jellyfin-server).

    • Configure the network (select eth0 for Ethernet or follow prompts for Wi-Fi).

    • Set the root password.

    • Choose your timezone.

    • Set up the disk:

      • Select sda (or the appropriate disk).

      • Choose sys for the installation mode.

      • Confirm to erase the disk and install Alpine Linux.

  4. Once the installation is complete, remove the USB drive and reboot the laptop.

Why? This installs Alpine Linux on your laptop’s hard drive, setting it up as a dedicated media server.


Step 5: Set Up Networking

  1. After rebooting, log in as root with the password you set.

  2. Verify your network connection:

    • For Ethernet, it should work automatically.

    • For Wi-Fi, run: setup-interfaces Follow the prompts to configure your Wi-Fi interface.

  3. Restart the networking service: rc-service networking restart

  4. Test the connection by pinging a website: ping -c 3 google.com

Tip: If Wi-Fi isn’t working, ensure you’ve installed the necessary firmware packages (e.g., apk add linux-firmware).


Step 6: Install Docker

  1. Update the package list: apk update

  2. Install Docker: apk add docker

  3. Start the Docker service: rc-service docker start

  4. Enable Docker to start on boot: rc-update add docker

Why? Docker allows you to run Jellyfin in an isolated container, making it easy to manage and update. We want docker to run auto-magically on boot.


Step 7: Pull the Jellyfin Docker Image

  1. Pull the official Jellyfin Docker image from Docker Hub: docker pull jellyfin/jellyfin

Tip: This might take a few minutes depending on your internet speed.


Step 8: Run the Jellyfin Container

  1. Create directories for Jellyfin’s configuration and media: mkdir -p /srv/jellyfin/config /srv/jellyfin/cache /path/to/your/media Replace /path/to/your/media with the actual path where your media files are stored (e.g., /home/media).

  2. Run the Jellyfin container:

    docker run -d \
    --name jellyfin \
    -p 8096:8096 \
    -v /srv/jellyfin/config:/config \
    -v /srv/jellyfin/cache:/cache \
    -v /path/to/your/media:/media \
    --restart unless-stopped \
    jellyfin/jellyfin

    • -p 8096:8096 maps the container’s port 8096 to the host.

    • -v options mount directories for configuration, cache, and media.

    • —restart unless-stopped ensures the container restarts automatically unless manually stopped.

Why? This command runs Jellyfin in a container, making your media accessible via port 8096.


Step 9: Configure Jellyfin

  1. Open a web browser on another device on the same network.

  2. Navigate to http://host-ip:8096, replacing host-ip with your laptop’s IP address (find it with ifconfig or ip a).

  3. Follow the Jellyfin setup wizard:

    • Choose your language.

    • Create an admin account.

    • Add your media libraries by selecting folders under /media.

    • Configure metadata and other settings as desired.

  4. Click “Finish” to complete the setup.

Tip: If you can’t access Jellyfin, ensure that the Docker container is running (docker ps) and that port 8096 is open.


Additional Tips and Best Practices

  • Security:

    • Set up a firewall to restrict access. For example, using iptables:

      apk add iptables iptables -A INPUT -p tcp --dport 8096 -j ACCEPT iptables -A INPUT -j DROP

    • Consider setting up HTTPS for secure remote access.

  • Performance:

    • Since it’s an old laptop, avoid running unnecessary services.

    • Monitor resource usage with htop (install with apk add htop).

  • Updates:

    • Regularly update Alpine Linux: apk update && apk upgrade.

    • Update Jellyfin by pulling the latest Docker image: docker pull jellyfin/jellyfin and restart the container.

    • I have another tutorial/video on how to automate this every night at 2am so your OS is the latest and greatest as well as your docker image.

  • Persistent Storage:

    • Ensure your media files are stored on a reliable drive or consider using an external drive for more storage.

Conclusion

Congratulations! You’ve successfully created a Jellyfin media server using Alpine Linux and Docker. Now you can enjoy your media collection from any device on your network. Happy streaming!