Preloader
Setup Guide

Tutorial: Enabling SSL on Xtream UI

Secure your panel and playback streams with a free Let's Encrypt certificate.


Why SSL Matters

Using SSL (HTTPS) encrypts the connection between your users and your panel. This is crucial not only for security but also for compatibility with modern browsers and players that block insecure (HTTP) content. This guide covers pointing your domain, generating a certificate, and configuring Nginx.

1Step 1: Prerequisites

Before starting, ensure you have a valid domain name pointed to your server's IP address. You also need to install the Certbot tool, which creates the certificates.

Run the following commands to install Certbot:

sudo apt-get update sudo apt-get install software-properties-common sudo add-apt-repository universe sudo add-apt-repository ppa:certbot/certbot sudo apt-get update sudo apt-get install certbot python-certbot-nginx

2Step 2: Generate the Certificate

Now, generate the SSL certificate for your domain. Replace yourdomain.com with your actual domain.

sudo certbot certonly -d yourdomain.com --nginx

If successful, Certbot will confirm that your certificate keys have been saved to /etc/letsencrypt/live/yourdomain.com/. Make a note of this path.

3Step 3: Update Nginx Binary

The default Nginx installed with Xtream UI may not support modern SSL/HTTP2 standards. It is highly recommended to replace the binary with an updated version compiled for Xtream UI.

Important: Back up your existing nginx binary before proceeding.

# Stop services first /home/xtreamcodes/iptv_xtream_codes/start_services.sh stop # Backup original binary mv /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx.bak # Upload your new 'nginx' binary to /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/ # Ensure permissions are set: chmod 755 /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx chown xtreamcodes:xtreamcodes /home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx

4Step 4: Configure Nginx

You need to tell Nginx to listen on port 443 (HTTPS) and where to find your certificates. Open your Nginx configuration:

nano /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf

Add or modify the server block. It should look similar to this example:

server { listen 25500; listen 443 ssl; ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; server_name yourdomain.com; index index.php index.html index.htm; root /home/xtreamcodes/iptv_xtream_codes/admin/; # ... rest of your config ... }

5Step 5: Update Database Settings

For the panel to generate HTTPS links for your streams and M3U playlists, you must update the database settings. Run the following command:

/home/xtreamcodes/iptv_xtream_codes/mysql/bin/mysql -u root -p xtream_iptvpro -e "UPDATE settings SET use_https='[\"1\", \"2\", \"3\"]' WHERE id='1';"

You will be prompted for your MySQL root password (often found in your config.php if you forgot it).

6Step 6: Test and Reload

Verify that your Nginx configuration syntax is correct:

/home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx -t

If the test is successful, restart the services to apply changes:

/home/xtreamcodes/iptv_xtream_codes/start_services.sh

Don't forget to renew your certificate every 90 days using sudo certbot renew.