Whatbox Logo
Login for certain variables to be updated with your slot's information

Wiki > Emby

Emby is a personal media server with apps on just about every device. Bringing all of your home videos, music, and photos together into one place has never been easier. Your personal Emby Server automatically converts and streams your media on-the-fly to play on any device.

Installation

Connect to your slot through SSH.

Emby .NET Core (version 4)

  1. Download the .NET Core runtime

    wget https://download.visualstudio.microsoft.com/download/pr/7d44ddeb-ad35-41a8-a581-03b151afbd80/6888586c28836b1e1f71df879184550b/aspnetcore-runtime-6.0.10-linux-x64.tar.gz
    
  2. Extract the .NET Core runtime archive

     mkdir -p $HOME/dotnet && tar zxf aspnetcore-runtime-6.0.10-linux-x64.tar.gz -C $HOME/dotnet
    
  3. Update .bashrc to use .NET Core

     printf "PATH=\$HOME/dotnet:\$PATH\nDOTNET_ROOT=\$HOME/dotnet\n" >> ~/.bashrc && source ~/.bashrc
    
  4. Download Emby (one line command)

     wget -O embyserver-netcore-latest.zip `curl -s https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | awk '/browser_download_url/ && /embyserver-netcore/ {print $2;exit}' | sed 's/"//g'`
    
  5. Prepare the EmbyNET directory and extract the archive

     mkdir -p ~/EmbyNET/ ~/.programdata/
     ln -s ~/.programdata/ ~/EmbyNET/programdata
     unzip -o ~/embyserver-netcore-latest.zip -d ~/EmbyNET/
    
  6. Start Emby briefly to create configuration files.

     dotnet ~/EmbyNET/system/EmbyServer.dll -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe
    
  7. Wait for it to finish outputting information and then press Ctrl+C to shut it down. Emby may shut down on its own with an error.

  8. Run these sed commands to change the port Emby runs on:

     sed -i 's/8096/16070/g' ~/EmbyNET/programdata/config/system.xml
     sed -i 's/8920/19035/g' ~/EmbyNET/programdata/config/system.xml
    
  9. Start Emby in a screen session running in the background

     screen -dmS embynet dotnet ~/EmbyNET/system/EmbyServer.dll -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe
    
  10. Clean up your slot (optional)

    rm embyserver-netcore-latest.zip aspnetcore-runtime-6.0.10-linux-x64.tar.gz
    

Check the Usage section of the article to finish setup.

Automatic restart

  1. Make a file to be used for the script. touch ~/emby_restart.cron

  2. Edit the file and enter the text below. nano -w ~/emby_restart.cron

     #!/bin/bash
     if pgrep -fx "dotnet /home/user/EmbyNET/system/EmbyServer.dll -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe" > /dev/null
     then
         echo "Emby is running."
     else 
         echo "Emby is not running, starting Emby"
         screen -dmS embynet /home/user/dotnet/dotnet /home/user/EmbyNET/system/EmbyServer.dll -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe
     fi
     exit
    
  3. Save the file with Ctrl+x and the "y" and Enter to accept overwriting.

  4. Make the script executable. chmod +x ~/emby_restart.cron

  5. Open your crontab. EDITOR=nano crontab -e

  6. Enter the following text

     @reboot /home/user/emby_restart.cron >/dev/null 2>&1
     */5 * * * * /home/user/emby_restart.cron >/dev/null 2>&1
    
  7. Save the crontab with Ctrl+x and the "y" and Enter to accept overwriting.

Usage

Your Emby web interface will be accessible at http://server.whatbox.ca:16070

Emby will run you through a setup wizard for creating a user and setting up your first libraries. You will not be able to navigate to your slot using the built-in filesystem navigator, so you will need to enter the full path to the directory you want to add to your library, for example /home/user/files

It is strongly recommended to setup authentication on your Emby instance. You can do this in Emby's web interface under the Settings > Users > Your user > Password category. You should not use your slot password here because the web interface does not use SSL. Click Save to save the configuration.

It is strongly recommended to disable DLNA to prevent other users on the server from accessing your media. You can do this in Emby's web interface under the Settings > DLNA category. Uncheck all of Enable DLNA Play To, Enable Dlna server, and Blast alive messages. Click Save to save the configuration.

You can attach to your Emby screen session to monitor its output using screen -r emby , and detach from it again by pressing ctrl+a, d and then enter

IMPORTANT

Emby is much more prone to abusing available resources than Plex. You must limit the CPU threads that Emby may use. We will terminate any instances of Emby running that are using so much CPU as to impact other users on the server. These settings can be found in Settings > Transcoding > Transcoding thread count. Guidelines for plans and the threads they may use follows:

  • HDD: 4
  • NVMe: 6
    Click Save to save the configuration.

Updates

Emby will not update automatically. You will need to do the following (from the installation process):

  1. Shutdown your Emby server by going into your Emby settings, clicking the power button, and then "Shut Down."

  2. Connect to your slot through SSH.

  3. Download Emby (one line command)

     wget -O embyserver-netcore-latest.zip `curl -s https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | awk '/browser_download_url/ && /embyserver-netcore/ {print $2;exit}' | sed 's/"//g'`
    
  4. Extract the archive into the relevant folders:

     unzip -o ~/embyserver-netcore-latest.zip -d ~/EmbyNET/
    
  5. Start Emby again in a screen session running in the background

     screen -dmS embynet dotnet ~/EmbyNET/system/EmbyServer.dll -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe