Jellyfin Forum
SOLVED: Ubuntu Jellyfin Installation Issues and Solutions - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: Ubuntu Jellyfin Installation Issues and Solutions (/t-solved-ubuntu-jellyfin-installation-issues-and-solutions)



Ubuntu Jellyfin Installation Issues and Solutions - jelly_looking_for_jam - 2024-07-31

Hi all, I'm new to Jellyfin and wanted to document some issues and solutions I came across while doing a fresh install on Ubuntu 22.04.2.

My Jellyfin server is running on 10.9.8.0.

I downloaded the install script via curl and installed Jellyfin via the Repository (Automatic) section of the Jellyfin documentation.

Upon trying to start Jellyfin I encountered the following error:
Code:
[13:12:56] [ERR] [1] Main: The server is expected to host the web client, but the provided content directory is either invalid or empty: /usr/lib/jellyfin/bin/jellyfin-web. If you do not want to host the web client with the server, you may set the '--nowebclient' command line flag, or set'hostwebclient=false' in your config settings

The Jellyfin github solution for the following command worked for me (note: I don't recall if I ran this command as sudo - if it throws an error run it as sudo):
Code:
ln -s /usr/share/jellyfin/web/ /usr/lib/jellyfin/bin/jellyfin-web

-

Afterwards the next error I encountered had the following messages:
Code:
[15:59:37] [ERR] [1] Jellyfin.Networking.AutoDiscoveryHost: Unable to bind to 0.0.0.0:7359
System.Net.Sockets.SocketException (98): Address already in use
...
[15:59:38] [ERR] [1] Microsoft.Extensions.Hosting.Internal.Host: Hosting failed to start
...
[15:59:38] [ERR] [1] Main: Kestrel failed to start! This is most likely due to an invalid address or port bind - correct your bind configuration in network.xml and try again
[15:59:38] [FTL] [1] Main: Error while starting server
System.IO.IOException: Failed to bind to address http://0.0.0.0:8096: address already in use.
...

I checked to ensure there were no other instances of Jellyfin or other services using that port via examining output of the following commands:
Code:
sudo lsof -i -sTCP:LISTEN
sudo lsof -i -sTCP:ESTABLISHED

For thoroughness' sake if Jellyfin were running you would see something like:
Code:
COMMAND      PID            USER  FD  TYPE  DEVICE SIZE/OFF NODE NAME
jellyfin  225356        jellyfin  470u  IPv4 22047874      0t0  TCP *:8096 (LISTEN)
 

You could then stop and kill Jellyfin via:
Code:
sudo service jellyfin stop
sudo kill -9 <Your_PID>

-

Anyhoo, most of the instructions I've found on these forums seem to be for Windows firewall issues so I wanted to document here that the following server iptables rules solved my problems.

To check existing iptables rules concerning the Jellyfin HTTP port:
Code:
sudo iptables -L | grep 8096

To allow connections to that port on the server:
Code:
sudo iptables -A INPUT -p tcp --dport 8096 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 8096 -m conntrack --ctstate ESTABLISHED -j ACCEPT

To make connections persist after reboot/shutdown:
Code:
sudo netfilter-persistent save

-

On the client device (a laptop running Ubuntu 22.04.01) I also had to add the following rules: 
Code:
sudo iptables -A INPUT -p tcp -s <Your_Server_Hostname> -m conntrack --ctstate ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp -s <Your_Server_Hostname> -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

To make connections persist after reboot/shutdown:
Code:
sudo netfilter-persistent save

-

Afterwards I restarted the Jellyfin service on my server. Then in the Jellyfin add-on in Kodi the server hostname automatically populated. Since then I've had no issues with Jellyfin or Kodi v21 (using Jellyfin for Kodi add-on with the default/non-native option).

Hopefully this helps someone else!


RE: Ubuntu Jellyfin Installation Issues and Solutions - theguymadmax - 2024-07-31

I'm sorry to say this, but this is wrong advice. The issue stems from trying to start Jellyfin by typing 'jellyfin' in the terminal after installing it with the script:
Code:
curl -s https://repo.jellyfin.org/install-debuntu.sh | sudo bash
 

Jellyfin operates as a system service, so it shouldn't be started manually from the terminal. If you attempt to do so, you’ll encounter errors like “no web client,” which is an early indicator that something’s off. If you bypass that step, you’ll encounter errors related to invalid addresses because Jellyfin is already running as a service.

After running the installation script, you should configure Jellyfin by accessing it through your web browser at http://localhost:8096/ .


RE: Ubuntu Jellyfin Installation Issues and Solutions - TheDreadPirate - 2024-08-01

I am going to second theguymadmax. You tried to run jellyfin by literally just typing "jellyfin" when the service was already running in some state, possibly not fully setup.

It is literally two commands to install Jellyfin on Ubuntu.

Code:
curl https://repo.jellyfin.org/install-debuntu.sh | sudo bash
sudo ufw allow 8096

Done.