2024-07-31, 10:42 PM
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:
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):
-
Afterwards the next error I encountered had the following messages:
I checked to ensure there were no other instances of Jellyfin or other services using that port via examining output of the following commands:
For thoroughness' sake if Jellyfin were running you would see something like:
You could then stop and kill Jellyfin via:
-
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:
To allow connections to that port on the server:
To make connections persist after reboot/shutdown:
-
On the client device (a laptop running Ubuntu 22.04.01) I also had to add the following rules:
To make connections persist after reboot/shutdown:
-
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!
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!