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/9eadec7a-dd7e-476d-a348-c4bf946a0bad/c11b5123931ee17faba27e5debe74731/aspnetcore-runtime-3.1.6-linux-x64.tar.gz
    
  2. Extract the .NET Core runtime archive

     mkdir -p $HOME/dotnet && tar zxf aspnetcore-runtime-3.1.6-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 | 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.

  8. Open the configuration file in nano

     nano ~/EmbyNET/programdata/config/system.xml
    
  9. Make the following changes:

    • <PublicPort>8096</PublicPort> to <PublicPort>21894</PublicPort>
    • <PublicHttpsPort>8920</PublicHttpsPort> to <PublicHttpsPort>10947</PublicHttpsPort>
    • <HttpServerPortNumber>8096</HttpServerPortNumber> to <HttpServerPortNumber>21894</HttpServerPortNumber>
    • <HttpsPortNumber>8920</HttpsPortNumber> to <HttpsPortNumber>10947</HttpsPortNumber>
  10. Save changes by pressing Ctrl+x, y and then enter

  11. 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
    
  12. Clean up your slot (optional)

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

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:21894

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:

  • Legacy: 1
  • HDD: 4
  • SSD: 4
    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 | 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