Jellyfin is a powerful, volunteer-built media solution that gives you full control over your media. With Jellyfin, you can easily stream your media to any device from your own server. It’s a free and open-source software fork of Emby, and it also supports serving media to DLNA and Chromecast-enabled devices. In this article, we will guide you through the process of installing Jellyfin on Rocky Linux 8. So, let’s get started.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A system with Rocky Linux 8 installed and running.
- Root access to the system.
- Docker installed and running on your Rocky Linux 8 system. If you haven’t installed Docker yet, you can refer to our guide on how to install Docker on Rocky Linux 8.
Once you have met these prerequisites, we can proceed with the installation and configuration of Jellyfin.
Step 1: Install Nginx
To start, we need to install Nginx, a popular web server and reverse proxy server. You can install Nginx on Rocky Linux 8 by running the following commands:
yum install nginx -y
Next, enable and start the Nginx service:
systemctl enable nginx systemctl start nginx
To verify that Nginx is running properly, you can check its status:
systemctl status nginx
Step 2: Install Let’s Encrypt SSL Certificate
To secure your Jellyfin installation, we will use Let’s Encrypt to issue an SSL certificate for your domain. Before we proceed, make sure you have the EPEL repository and the mod_ssl package installed on your Rocky Linux 8 system. You can install them by running the following command:
dnf install epel-release mod_ssl -y
Next, we need to install the certbot client, which is used to create Let’s Encrypt certificates:
dnf install python3-certbot-nginx -y
Once the installation is complete, you can issue a Let’s Encrypt certificate by running the following command:
certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email dev@dev.domainhere.info -d dev.domainhere.info
Make sure to replace dev.domainhere.info and dev@dev.domainhere.info with your actual domain name and email address. The SSL certificate will be valid for 90 days, and the renewal process is now automated, so you don’t have to worry about renewing it manually.
After issuing the certificate, restart Nginx to apply the changes:
systemctl restart nginx
Step 3: Configuring Nginx Server Blocks
Now, let’s configure the Nginx server blocks to handle the incoming requests for Jellyfin. Open the Nginx configuration file using your preferred text editor. In this example, we will use nano:
nano /etc/nginx/nginx.conf
Replace the contents of the nginx.conf file with the following configuration:
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; }
Save and exit the file by pressing Ctrl+O, followed by Ctrl+X.
Next, create a new Nginx configuration file for your domain. In this example, we will use dev.conf:
vi /etc/nginx/conf.d/dev.conf
Add the following code to the dev.conf file:
upstream app { server 192.169.7.180:8096; } server { listen 80 default_server; server_name dev.domainhere.info; return 301 https://$server_name$request_uri; } server { listen 443 ssl; # managed by Certbot server_name dev.domainhere.info; ssl_certificate /etc/letsencrypt/live/dev.domainhere.info/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/dev.domainhere.info/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot location / { proxy_pass http://app; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header X-Real-Port $server_port; proxy_set_header X-Real-Scheme $scheme; } }
Save and exit the file by pressing Esc, followed by :wq!, and then press Enter.
For SELinux enabled systems, run the following command to allow Nginx to connect to the network:
setsebool -P httpd_can_network_connect 1
Finally, restart Nginx and check its status to ensure that everything is working as expected:
systemctl restart nginx systemctl status nginx
Step 4: Enable Port 8096
To allow access to Jellyfin through the firewall, run the following commands:
firewall-cmd --zone=public --permanent --add-port8096/tcp firewall-cmd --reload
This will open port 8096 for Jellyfin.
Step 5: Install Jellyfin with Docker
Now, let’s install Jellyfin using Docker. Docker allows us to easily deploy applications in containers, providing a lightweight and isolated environment. We will be using the official Jellyfin Docker image for this installation.
First, pull the latest Jellyfin Docker image by running the following command:
docker pull jellyfin/jellyfin:latest
Next, create the necessary directories for Jellyfin’s configuration and cache:
mkdir -p /srv/jellyfin/{config,cache}
Finally, start the Jellyfin container using the following command:
docker run -d -v /srv/jellyfin/config:/config -v /srv/jellyfin/cache:/cache -v /media:/media --net=host jellyfin/jellyfin:latest
Jellyfin will now be installed and running on your Rocky Linux 8 system. The installation process may take a few minutes to complete.
Step 6: Adding Media/Audio Files to Jellyfin
To add media or audio files to Jellyfin, you can use the following command:
docker cp media.file container_id:/media/media.file
Replace media.file with the name of your file, and container_id with the ID of your Jellyfin container. This command will copy the media file to the /media directory inside the container.
You can now access Jellyfin by opening your browser and entering the IP address or domain name associated with your server. For example:
https://dev.domainhere.info
Replace dev.domainhere.info with your actual IP address or domain name. You should now be redirected to the Jellyfin interface, where you can start adding and organizing your media files.
Congratulations! You have successfully installed Jellyfin with Docker on Rocky Linux 8. Enjoy your personalized media streaming experience with Jellyfin.
For professional and reliable cloud hosting solutions, consider Shape.host. Shape.host offers Linux SSD VPS services that are scalable, secure, and optimized for performance. With Shape.host, you can focus on your business while leaving the hosting infrastructure in expert hands.