Skip to content

Instantly share code, notes, and snippets.

@Valienteuh
Last active January 11, 2026 13:01
Show Gist options
  • Select an option

  • Save Valienteuh/2ad0fe58c3c9ecad50425b19478ab61d to your computer and use it in GitHub Desktop.

Select an option

Save Valienteuh/2ad0fe58c3c9ecad50425b19478ab61d to your computer and use it in GitHub Desktop.
Title : Jellyfin & Jellyfin Server on Android via Termux + Debian – Beginner-Friendly Guide | Description : Learn how to run Jellyfin on your Android device using Termux and Proot-Debian. Step-by-step instructions with RAM-specific startup scripts, nano file creation guidance, and Zerotier tips for remote access. Works on devices with 2GB, 4GB, …

Here’s the Full Guide to run JellyFin Server on Android through Termux:


Jellyfin on Termux + Debian (Android) – Beginner-Friendly Guide

This guide will help you install and run Jellyfin on an Android device using Termux + Proot-Debian.
It works for devices with different RAM configurations. We use jellyfin.sh as the startup script.

1. Install Termux & Proot-Distro

  1. Install Termux from F-Droid.
  2. Open Termux and update packages:
pkg update -y
pkg upgrade -y
  1. Install essential packages:
pkg install proot-distro wget curl nano git -y

2. Install Debian

  1. Install Debian:
proot-distro install debian
  1. Login to Debian:
proot-distro login debian

All Debian-specific commands are run inside this Proot environment.


3. Update Debian & Install Dependencies

apt update && apt upgrade -y
apt install ffmpeg -y

Install Jellyfin:

apt install apt-transport-https ca-certificates gnupg -y
curl -fsSL https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | gpg --dearmor | tee /usr/share/keyrings/jellyfin-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/jellyfin-archive-keyring.gpg] https://repo.jellyfin.org/debian bullseye main" | tee /etc/apt/sources.list.d/jellyfin.list
apt update
apt install jellyfin -y

4. Create Jellyfin Startup Script

Do not Exit Debian! If you are in termux then get inside debian by pasting (proot-distro login debian) command again in Termux. It should show something like root@localhost:~# Then create the script to Start JellyFin Server Everytime by pasting this:

nano jellyfin.sh
  1. Paste the script according to your device’s RAM:

For 2 GB RAM

#!/bin/sh
# Jellyfin launcher for Termux/Proot Debian on Android (2GB RAM)

# ---- .NET memory tuning ----
export DOTNET_GC_SERVER=0
export DOTNET_GC_CONCURRENT=1
export DOTNET_GCHeapHardLimit=300000000   # ~300MB
export DOTNET_GCHeapHardLimitPercent=40  # ~40% of total RAM

# ---- Jellyfin paths ----
WEB_DIR="/usr/share/jellyfin/web"
CONFIG_DIR="$HOME/.config/jellyfin"
CACHE_DIR="$HOME/.cache/jellyfin"
DATA_DIR="$HOME/.local/share/jellyfin"
LOG_DIR="$HOME/.local/share/jellyfin/log"

# ---- Run Jellyfin ----
jellyfin \
  --webdir "$WEB_DIR" \
  -c "$CONFIG_DIR" \
  -C "$CACHE_DIR" \
  -d "$DATA_DIR" \
  -l "$LOG_DIR" \
  --nonetchange

For 4 GB RAM

#!/bin/sh
# Jellyfin launcher for Termux/Proot Debian on Android (4GB RAM)

# ---- .NET memory tuning ----
export DOTNET_GC_SERVER=0
export DOTNET_GC_CONCURRENT=1
export DOTNET_GCHeapHardLimit=800000000   # ~800MB
export DOTNET_GCHeapHardLimitPercent=50  # ~50% of total RAM

# ---- Jellyfin paths ----
WEB_DIR="/usr/share/jellyfin/web"
CONFIG_DIR="$HOME/.config/jellyfin"
CACHE_DIR="$HOME/.cache/jellyfin"
DATA_DIR="$HOME/.local/share/jellyfin"
LOG_DIR="$HOME/.local/share/jellyfin/log"

# ---- Run Jellyfin ----
jellyfin \
  --webdir "$WEB_DIR" \
  -c "$CONFIG_DIR" \
  -C "$CACHE_DIR" \
  -d "$DATA_DIR" \
  -l "$LOG_DIR" \
  --nonetchange

For 8 GB RAM

#!/bin/sh
# Jellyfin launcher for Termux/Proot Debian on Android (8GB RAM)

# ---- .NET memory tuning ----
export DOTNET_GC_SERVER=0
export DOTNET_GC_CONCURRENT=1
export DOTNET_GCHeapHardLimit=2000000000   # ~2GB
export DOTNET_GCHeapHardLimitPercent=60   # ~60% of total RAM

# ---- Jellyfin paths ----
WEB_DIR="/usr/share/jellyfin/web"
CONFIG_DIR="$HOME/.config/jellyfin"
CACHE_DIR="$HOME/.cache/jellyfin"
DATA_DIR="$HOME/.local/share/jellyfin"
LOG_DIR="$HOME/.local/share/jellyfin/log"

# ---- Run Jellyfin ----
jellyfin \
  --webdir "$WEB_DIR" \
  -c "$CONFIG_DIR" \
  -C "$CACHE_DIR" \
  -d "$DATA_DIR" \
  -l "$LOG_DIR" \
  --nonetchange

  1. After pasting, save the file:

    • Press Ctrl + X to exit.
    • Nano will ask: “Save modified buffer?” → Press Y for yes.
    • It will ask for the file name → Press Enter to confirm jellyfin.sh.
  2. Make the script executable:

chmod +x jellyfin.sh

✅ Now your jellyfin.sh script is ready to use.

5. Start Jellyfin

Every time you want to run Jellyfin Server:

# Step 1: Login to Debian
proot-distro login debian

# Step 2: Run Jellyfin 
./jellyfin.sh

6. Access Jellyfin

Open a Browser on your Android Device [i.e) Chrome]:

http://127.0.0.1:8096
or
http://localhost:8096

7. If you want to just type "jellyfin.sh" only instead of "./jellyfin.sh" everytime to Start Jellyfin (Optional)

For this, Simply Add your home folder to PATH of Debian

  1. In Termux, open your .bashrc or .zshrc:
nano ~/.bashrc
  1. Add this line at the end:
export PATH=$HOME:$PATH
  1. Save (Ctrl+X → Y → Enter) and reload:
source ~/.bashrc

Now, Just Type this to Start Jellyfin Server after proot-distro login debian command ofcourse 🔽:

jellyfin.sh

will work, as long as you’re inside Debian (Proot).

8. Optional: Share with Friends

  • Jellyfin runs on HTTP (port 8096).
  • To allow remote access, use Zerotier or OpenTunnel.
  • Avoid ngrok on Termux; it’s unstable.

Notes

  • DOTNET_GCHeapHardLimit and DOTNET_GCHeapHardLimitPercent control how much RAM Jellyfin’s .NET runtime can use.
  • Adjust based on your device’s RAM. Using ~50% of total RAM is safe for most devices.
  • Always login to Debian before starting Jellyfin.
  • Use Browser for Best Experience instead of Client Apps.

Steps to Watch Together a Movie on JellyFin

  • Download a movie/video.
  • Start Server
  • Connect ZeroTier (Both Host and Client needs to be on same ZeroTier Network)
  • Open JellyFin on Web Browser by this format : http://<Host's_ZeroTier_IP>:8096
  • (You can get this IP from https://my.zerotier.com/network)
  • Login
  • Create Room
  • Friends join your Room
  • Perfect Synced Video
  • (Call on discord etc for fun while watching movie at same time.)
  • Use Browser for Best Experience instead of Client Apps.
  • If you're on PC, Use HaramBlurr Extension to automatically blur Haram/NSFW Content.
  • If you're on Android, Use Mises Browser as it supports Chrome Extensions.
  • ENJOIII BUIIIIII
Credits :- Syed Wasiq Abbas   (Remember in your Prayers :) Allahuma Barik)

Honestly, ChatGPT Helped me alot in this mission. Alhamdulillah(Praise be to Allah) for every facility & favour he has given to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment