8 Building from Source
Joshua M. Boniface edited this page 2018-12-31 11:51:17 -05:00

As an alternative to using binary packages, you can build Jellyfin from source. This is required when contributing to Jellyfin.

Jellyfin supports several methods of building for different platforms and instructions for all supported platforms are below.

All package builds begin with the first two steps (for Linux/OSX; alter as needed for Windows):

  1. Clone the repository: git clone https://github.com/jellyfin/jellyfin.git && cd jellyfin
  2. Initialize the submodules: git submodule update --init

Docker

  1. Build the Docker image: docker build -t $USERNAME/jellyfin .
  2. Run the container: docker run -d -p 8096:8096 $USERNAME/jellyfin

Debian Packages via Docker

  1. Run the build script: ./build-deb.sh
  2. Resulting packages will be in ../jellyfin*.deb

Debian Packages via dpkg-dev

  1. Add the Microsoft .NET Core repository:
    sudo apt-get install -y apt-transport-https debhelper gnupg wget devscripts
    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg
    wget -qO- https://packages.microsoft.com/config/debian/9/prod.list | sudo tee /etc/apt/sources.list.d/microsoft-prod.list
    sudo apt-get update
    
  2. Install build dependencies: sudo mk-build-deps -i
  3. Build the packages: dpkg-buildpackage -us -uc
  4. Resulting packages will be in ../jellyfin*.deb

Windows (64 bit)

  1. Install the dotnet core SDK 2.2 from Microsoft's Webpage and install Git for Windows

  2. Set executionpolicy to unrestricted.

  3. Run the Jellyfin build script: build-jellyfin.ps1

    • The -WindowsVersion and -Architecture flags can optimize the build for your current environment; the default is generic Windows x64.
    • The -InstallLocation flag lets you select where the compiled binaries go; the default is $Env:AppData\Jellyfin-Server\ .
    • The -InstallFFMPEG flag will automatically pull the stable ffmpeg binaries appropriate to your architecture (x86/x64 only for now) from Zeranoe and place them in your Jellyfin directory.
  4. (Optional) Use NSSM to configure Jellyfin to run as a service

  5. Jellyfin is now available in the default directory (or the directory you chose). Assuming you kept the default directory, to start it from a Powershell window, run, &"$env:APPDATA\Jellyfin-Server\jellyfin.exe". To start it from CMD, run, %APPDATA%\Jellyfin-Server\jellyfin.exe