Skip to main content

Installing Jellyfin media server on PulsedMedia seedbox

Recently I acquired a cheap PulsedMedia seedbox (as in, 12 cores of Ryzen 5800X, 10Gbit, and 1TB storage for 3EUR/month.. wow!) which will replace my current seedbox. I am currently (at the time of writing) running a small seedbox on my own dedicated server in Amsterdam, but this one offers more storage, more powerful hardware, and no DMCA threat for a cheaper price 🙂

Just run the following shell script:

BASH
#!/bin/bash
set echo off
cd ~
mkdir ~/opt/
mkdir ~/opt/jellyfin
cd ~/opt/jellyfin
latestVer=$(curl -s 'https://repo.jellyfin.org/releases/server/linux/stable/combined/' | egrep -m 1 -o "jellyfin_[0-9\.]+_amd64\.tar\.gz"  )
wget https://repo.jellyfin.org/releases/server/linux/stable/combined/${latestVer} -O ~/jellyfin.tar.gz
mkdir jellyfin
tar xf ~/jellyfin.tar.gz -C jellyfin --strip-components=2
mkdir data cache config log
cd ~
JELLYFINDIR=$(pwd)"/opt/jellyfin"
FFMPEGDIR="/usr/bin"
screen -S Jellyinstall -d -m $JELLYFINDIR/jellyfin/jellyfin \
-d $JELLYFINDIR/data \
-C $JELLYFINDIR/cache \
-c $JELLYFINDIR/config \
-l $JELLYFINDIR/log \
--ffmpeg $FFMPEGDIR/ffmpeg
clear
echo starting setup please wait
sleep 5
screen -X -S Jellyinstall kill
cd $JELLYFINDIR/config
cp system.xml system.bak
cp network.xml network.bak
http=$(shuf -i 8000-8999 -n1)
https=$(( http + 1 ))
sed -i "s/8096/$http/g" system.xml
sed -i "s/8920/$https/g" system.xml
sed -i "s/8096/$http/g" network.xml
sed -i "s/8920/$https/g" network.xml
cd ~
touch ~/start_jelly.sh
cat > ~/start_jelly.sh <<'EOF1'
#!/bin/bash
JELLYFINDIR=$(pwd)"/opt/jellyfin"
FFMPEGDIR="/usr/bin"
Jellyport=$(awk '{if(/<PublicPort>/) print substr($1,13,4)}' < ./opt/jellyfin/config/system.xml)
echo "starting Jellyfin - usage ~/stop_jelly.sh to stop jellyfin -  ~/start_jelly.sh to start"
echo -e "\nhttp://$(hostname -f):$Jellyport"
screen -S Jellyfin -d -m $JELLYFINDIR/jellyfin/jellyfin \
-d $JELLYFINDIR/data \
-C $JELLYFINDIR/cache \
-c $JELLYFINDIR/config \
-l $JELLYFINDIR/log \
--ffmpeg $FFMPEGDIR/ffmpeg
EOF1
chmod +x ~/start_jelly.sh
cat > ~/stop_jelly.sh <<'EOF2'
#!/bin/bash
screen -X -S Jellyfin kill
sleep 2
echo "stopped"
EOF2
chmod +x ~/stop_jelly.sh
~/start_jelly.sh to start


Then you can run this script to allow to access the Jellyfin at /user-YOURUSERNAME/jellyfin/

Note: You have to replace USERNAME and JELLYPORT with the appropriate values.

jellyfin-lighttpd.sh

BASH
USERNAME=$(whoami)

cat > ~/.lighttpd/custom <<'EOF3'
$HTTP["url"] =~ "^/user-${USERNAME}/jellyfin/" {
  auth.require = (),
  proxy.server = ( "" => ( (
    "host" => "127.0.0.1",
    "port" => ${Jellyport}
  ) ) ),
  proxy.forwarded = ( "for" => 1,
                      "host" => 1,
                      "by" => 1
  ),
  proxy.header = (
      "map-urlpath" => (
         "/user-${USERNAME}/jellyfin/"  => "/",
         "/user-${USERNAME}/jellyfin" => ""
       )
  )
}


EOF3


Now you can go to /user-YOURUSERNAME/jellyfin/ and complete the setup there. Don't worry, it takes a while after the user stage - nothing to panic about.


Source

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.