Comprehensive Guide to Installing Xtream-UI on Ubuntu 18.04.5 LTS

Comprehensive Guide to Installing Xtream-UI on Ubuntu 18.04.5 LTS

Comprehensive Guide to Installing Xtream-UI on Ubuntu 18.04.5 LTS

Xtream-UI is a powerful management tool designed to help users handle IPTV servers efficiently. If you’re working with IPTV and need a robust interface to manage your operations, Xtream-UI could be the solution you need. This guide will walk you through the steps to install Xtream-UI on an Ubuntu 18.04.5 LTS server. By following these instructions, you’ll have Xtream-UI up and running in no time.

Prerequisites

Before diving into the installation process, ensure that your server meets the necessary prerequisites:

  1. Ubuntu 18.04.5 LTS: This guide is specifically tailored for this version of Ubuntu.
  2. Root Access: You need to have root privileges or a user with sudo access.
  3. Basic Linux Knowledge: Familiarity with basic Linux commands and navigation is essential.

Step 1: Update and Upgrade the System

First, update and upgrade your system packages to ensure everything is up-to-date. Open your terminal and execute the following commands:

bash

sudo apt update
sudo apt upgrade -y

This command will refresh your package list and install the latest versions of the packages currently installed on your system.

Step 2: Install Required Dependencies

Xtream-UI requires several dependencies to function correctly. Install these dependencies by running the following command:

bash

sudo apt install -y software-properties-common nginx mysql-server php7.2 php7.2-fpm php7.2-mysql php7.2-mbstring php7.2-xml php7.2-curl unzip

This command installs Nginx (a web server), MySQL (a database server), PHP 7.2, and other necessary PHP extensions.

Step 3: Configure MySQL

Once MySQL is installed, it needs to be configured. First, secure your MySQL installation by running:

bash

sudo mysql_secure_installation

You’ll be prompted to set a root password and make several security-related decisions. Follow the prompts and choose the options that best fit your security requirements.

Next, log in to the MySQL root account:

bash

sudo mysql -u root -p

After entering your root password, create a new database and user for Xtream-UI:

sql

CREATE DATABASE xtreamui;
CREATE USER 'xtreamuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON xtreamui.* TO 'xtreamuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Replace 'yourpassword' with a strong password of your choice.

Step 4: Install and Configure Nginx

Next, configure Nginx to serve Xtream-UI. Open the Nginx configuration file:

bash

sudo nano /etc/nginx/sites-available/default

Replace the existing configuration with the following:

nginx

server {
listen 80;
server_name your_server_ip;
root /var/www/html;
index index.php index.html index.htm;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

location ~ /\.ht {
deny all;
}
}

Replace your_server_ip with your server’s IP address. Save and close the file (Ctrl+X, then Y, then Enter).

Restart Nginx to apply the changes:

bash

sudo systemctl restart nginx

Step 5: Install Xtream-UI

With the server environment ready, proceed to download and install Xtream-UI. Navigate to the /var/www/html directory and download Xtream-UI:

bash

cd /var/www/html
sudo wget https://xtream-ui.com/downloads/latest.zip -O xtreamui.zip

Unzip the downloaded file:

bash

sudo unzip xtreamui.zip -d xtreamui

Set the correct permissions for the Xtream-UI files:

bash

sudo chown -R www-data:www-data /var/www/html/xtreamui
sudo chmod -R 755 /var/www/html/xtreamui

Step 6: Configure Xtream-UI

Next, configure Xtream-UI to connect to your database. Copy the sample configuration file and open it for editing:

bash

cd /var/www/html/xtreamui
sudo cp config.sample.php config.php
sudo nano config.php

Find the following lines and update them with your database details:

php

define('DB_HOST', 'localhost');
define('DB_USER', 'xtreamuser');
define('DB_PASS', 'yourpassword');
define('DB_NAME', 'xtreamui');

Save and close the file.

Step 7: Import Xtream-UI Database Schema

Now, import the Xtream-UI database schema. Run the following command:

bash

sudo mysql -u xtreamuser -p xtreamui < /var/www/html/xtreamui/install.sql

Enter your MySQL password when prompted.

Step 8: Finalize the Installation

To complete the installation, open your web browser and navigate to http://your_server_ip/xtreamui. You should see the Xtream-UI installation wizard. Follow the on-screen instructions to finalize the setup.

Step 9: Secure Your Installation

Securing your installation is crucial. Follow these steps to enhance security:

1. Firewall Configuration

Ensure that your firewall is configured to allow traffic only on necessary ports. For example, to allow HTTP and HTTPS traffic, run:

bash

sudo ufw allow 'Nginx Full'
sudo ufw enable

2. Enable SSL

For a secure connection, it’s recommended to enable SSL. You can use Let’s Encrypt to obtain a free SSL certificate. Install Certbot and the Nginx plugin:

bash

sudo apt install certbot python-certbot-nginx

Obtain and install the SSL certificate:

bash

sudo certbot --nginx -d your_domain -d www.your_domain

Follow the prompts to complete the process.

3. Update File Permissions

Ensure that only necessary users have access to sensitive files:

bash

sudo chown -R root:www-data /var/www/html/xtreamui
sudo find /var/www/html/xtreamui -type d -exec chmod 750 {} \;
sudo find /var/www/html/xtreamui -type f -exec chmod 640 {} \;

4. Disable Root Login and Change SSH Port

For enhanced security, disable root login and change the default SSH port. Open the SSH configuration file:

bash

sudo nano /etc/ssh/sshd_config

Find and modify the following lines:

bash

Port 2222
PermitRootLogin no

Save and close the file, then restart the SSH service:

bash

sudo systemctl restart ssh

Step 10: Regular Maintenance

To ensure smooth operation, perform regular maintenance tasks such as:

  1. Updating Packages: Regularly update your system packages.

    bash

    sudo apt update
    sudo apt upgrade -y
  2. Monitoring Server Performance: Keep an eye on your server’s performance and resource usage.
  3. Backing Up Data: Regularly back up your Xtream-UI database and configuration files.

    bash

    sudo mysqldump -u xtreamuser -p xtreamui > xtreamui_backup.sql
  4. Securing Your Server: Continuously monitor and update security settings.

By following these steps, you can ensure that your Xtream-UI installation remains secure, up-to-date, and running smoothly.

Conclusion

Installing Xtream-UI on Ubuntu 18.04.5 LTS involves several steps, from updating your system and installing necessary dependencies to configuring Nginx and MySQL, and finally securing your installation. By carefully following this guide, you can set up a robust IPTV management system on your server. Remember to maintain your installation regularly to keep it secure and efficient.

Share this post