How to Install XUI Media Server on Ubuntu 24 Server: A Comprehensive Guide
Introduction to XUI Media Server on Ubuntu 24
XUI Media Server is a powerful and versatile platform designed for managing streaming services, particularly popular in the IPTV (Internet Protocol Television) world. It provides a user-friendly web panel to handle live channels, video-on-demand (VOD) content, series, and more. Installing XUI on a stable and modern operating system like Ubuntu 24 LTS (Long Term Support) ensures a reliable and secure foundation for your streaming operations. This guide from SHUBhost.com will walk you through the entire installation process, from server preparation to initial configuration, ensuring you get your XUI Media Server up and running smoothly.
Whether you're looking to host your own private streaming service, manage content for a community, or explore the capabilities of modern media distribution, XUI on Ubuntu 24 offers a robust solution. Its ease of use combined with the stability of Ubuntu makes it an excellent choice for both beginners and experienced administrators.
Why Choose Ubuntu 24 for XUI Media Server?
Ubuntu 24 LTS, codenamed 'Noble Numbat', brings significant improvements in performance, security, and software compatibility. As an LTS release, it guarantees five years of maintenance updates, making it an ideal choice for server environments where stability and long-term support are paramount. For a media server like XUI, this means fewer unexpected issues, consistent security patches, and access to a vast repository of up-to-date software.
Stability: LTS releases are thoroughly tested and maintained, offering a rock-solid base.
Security: Regular security updates protect your server and data from vulnerabilities.
Performance: Optimized kernel and system components ensure efficient resource utilization for streaming.
Community Support: A large, active community provides extensive documentation and troubleshooting resources.
Modern Software: Access to recent versions of system packages and libraries.
Prerequisites for XUI Installation
Before you begin the installation process, ensure you have the following:
An Ubuntu 24 Server Instance: This can be a Virtual Private Server (VPS) from SHUBhost.com, a dedicated server, or even a virtual machine. Ensure it's a fresh installation of Ubuntu 24 LTS.
Root Access or Sudo Privileges: You'll need administrative rights to install software and configure system settings.
Minimum System Resources: While XUI can run on modest hardware, for a functional streaming server, we recommend at least:
CPU: 2 Cores (e.g., Intel Xeon E3 or E5 equivalent)
RAM: 2 GB (4 GB or more recommended for multiple streams/users)
Storage: 50 GB SSD (more if you plan to store VOD content)
Network: Stable internet connection with sufficient bandwidth.
Basic Command-Line Knowledge: Familiarity with Linux commands will be helpful.
Step 1: Prepare Your Ubuntu 24 Server
The first step is to ensure your server is up-to-date and has the necessary tools for the XUI installation script.
Update System Packages
Log in to your Ubuntu 24 server via SSH and run the following commands to update the package list and upgrade existing packages to their latest versions:
sudo apt update
sudo apt upgrade -y
This ensures you have the latest security patches and software updates, minimizing potential conflicts during installation.
Install Essential Utilities
XUI's installation script and general server management often rely on a few common utilities. Install them if they are not already present:
sudo apt install wget screen curl -y
wget: Used to download files from the internet.screenortmux: (Optional but highly recommended) Allows you to detach from your SSH session while commands continue to run in the background. This is crucial for long installations or updates to prevent interruption if your SSH connection drops.curl: Another utility for transferring data, often used by scripts.
Configure Firewall (UFW)
Ubuntu's default firewall, UFW (Uncomplicated Firewall), is usually enabled and configured to block incoming connections. For XUI Media Server to function, you'll need to open specific ports. While you could temporarily disable UFW, it's safer to configure it correctly.
XUI typically uses ports like 25461 (main panel), 8080 (another common panel port), and various streaming ports. For simplicity during installation, you might temporarily disable UFW, but remember to re-enable and configure it properly afterward.
To temporarily disable UFW (not recommended for production):
sudo ufw disable
To allow specific XUI ports (recommended approach):
You will need to know the specific ports XUI will use. The default XUI installation prompts for a port, often 25461 or 8000/8080. Let's assume you'll use 25461 for the panel and 8080 as a fallback, and a common streaming port range like 25000-25400 (though XUI often manages stream ports dynamically or through internal configuration).
sudo ufw allow 25461/tcp
sudo ufw allow 8080/tcp
sudo ufw allow 25000:25400/tcp # Example range for streaming, adjust as needed
sudo ufw allow ssh # Ensure SSH port (22 by default) is open
sudo ufw enable
sudo ufw status verbose
Step 2: Download and Install XUI Media Server
Now that your server is prepared, you can proceed with downloading and executing the XUI installation script.
Download the XUI Installation Script
The XUI project typically provides an installation script that handles all dependencies and configurations. You can download it using wget. The exact URL might change, so always refer to the latest official source if this one doesn't work. A common script name is `install.sh`.
wget https://raw.githubusercontent.com/XUI-Media/XUI-Panel/master/install.sh -O install.sh
This command downloads the script and saves it as `install.sh` in your current directory.
Make the Script Executable
Before running the script, you need to give it executable permissions:
chmod +x install.sh
Execute the Installation Script
Now, run the script. It will guide you through an interactive installation process.
sudo ./install.sh
The script will prompt you for several details:
Panel Port: This is the port you will use to access the XUI web interface. Common choices are 25461, 8000, or 8080. Choose one that isn't already in use. Make sure this port is open in your firewall.
Username: The username for logging into the XUI panel.
Password: The password for logging into the XUI panel.
Follow the on-screen prompts carefully. The installation process might take a few minutes as it downloads and configures necessary components like Nginx, PHP, and other dependencies. Once complete, you should see a success message indicating that XUI Media Server has been installed and is running.
Step 3: Accessing the XUI Panel
After a successful installation, you can access your XUI Media Server's web interface from any web browser.
Identify Your Server's IP Address
If you don't already know your server's public IP address, you can find it using a command like:
curl ifconfig.me
Navigate to the XUI Panel
Open your web browser and enter the following URL, replacing YOUR_SERVER_IP with your server's actual IP address and YOUR_PANEL_PORT with the port you chose during installation:
http://YOUR_SERVER_IP:YOUR_PANEL_PORT
For example, if your IP is 192.0.2.100 and your chosen port is 25461, you would go to http://192.0.2.100:25461.
You will be presented with the XUI login screen. Enter the username and password you set during the installation. Upon successful login, you'll see the XUI dashboard, ready for you to start configuring your streaming services.
Step 4: Basic Post-Installation Configuration and Security
While XUI is now operational, a few post-installation steps are recommended for security and optimal performance.
Change Default Ports (If Applicable)
If you used a common default port like 8000 or 8080, consider changing it to a less common, higher-numbered port (e.g., 25461, 2095) to reduce automated scanning attempts. This can usually be done from within the XUI panel's settings or by re-running a configuration script provided by XUI.
Review and Configure Firewall
If you temporarily disabled UFW, it's crucial to re-enable it and ensure only the necessary ports are open. Double-check that your XUI panel port, any streaming ports, and SSH are allowed. Blocking all other incoming traffic significantly enhances your server's security.
sudo ufw status verbose # Check current status
sudo ufw default deny incoming # Deny all incoming by default
sudo ufw allow 25461/tcp # Allow your XUI panel port
sudo ufw allow 8080/tcp # If you use 8080 for anything
sudo ufw allow 25000:25400/tcp # Your streaming port range
sudo ufw allow ssh # Allow SSH access
sudo ufw enable
Remember to adjust port numbers to match your actual XUI configuration.
Secure Your XUI Panel Credentials
Always use strong, unique passwords for your XUI panel. Avoid using default or easily guessable credentials. Consider implementing two-factor authentication if XUI supports it, or securing access via VPN for administrators.
Step 5: Managing the XUI Service
XUI Media Server typically registers itself as a system service, allowing for easy management using systemctl commands.
Check XUI Service Status:
sudo systemctl status xuiStart XUI Service:
sudo systemctl start xuiStop XUI Service:
sudo systemctl stop xuiRestart XUI Service:
sudo systemctl restart xuiEnable XUI to Start on Boot:
sudo systemctl enable xui
These commands are essential for maintaining your XUI server, especially after system updates or configuration changes.
Troubleshooting Common Issues
Even with a detailed guide, you might encounter issues. Here are some common troubleshooting tips:
Cannot Access XUI Panel:
Firewall: Double-check that the XUI panel port is open in UFW and any other network firewalls (e.g., cloud provider security groups).
Port Conflict: Ensure the chosen XUI panel port isn't already in use by another service. You can check open ports with
sudo ss -tulpn | grep LISTEN.Incorrect IP/Port: Verify you're using the correct server IP and panel port in your browser.
XUI Service Not Running: Check the service status using
sudo systemctl status xui.
Streaming Issues:
Firewall: Ensure streaming ports (if custom) are open in UFW.
Bandwidth: Verify your server has sufficient bandwidth for the number of concurrent streams.
Content Source: Check that your streaming sources (e.g., M3U links) are valid and accessible from your server.
Installation Script Errors:
Dependencies: Ensure all prerequisites (
wget,curl, etc.) are installed.Permissions: Verify the script has execute permissions (
chmod +x install.sh).Internet Connectivity: Check if your server can access the internet to download files.
Conclusion
Installing XUI Media Server on Ubuntu 24 provides a robust and scalable solution for managing your streaming content. By following this comprehensive guide, you've successfully prepared your server, installed the XUI panel, and learned the basics of accessing and securing it. SHUBhost.com is committed to providing powerful and reliable hosting solutions, whether you need a VPS for a modest setup or a dedicated server for high-demand streaming. With your XUI Media Server now operational, you're ready to explore its full potential, manage your content, and deliver a seamless streaming experience to your audience.