Expert Guide
Xtream UI Ultimate Commands & Fixes Cheat Sheet
A collection of the most useful commands to manage, fix, and optimize your Xtream UI server.
Install Xtream UI (Ubuntu 18.04)
This is the standard installation command using our stable mirror. It installs all necessary dependencies and the panel itself.
apt-get update ; apt-get install libxslt1-dev libcurl3 libgeoip-dev python -y ; wget https://xtream-masters.com/guide/resources.php?file=xui/install.py ; sudo python install.py
Update to Latest Version (R22F)
If you installed an older version, use this command to force an update to the latest stable R22F version.
apt-get install unzip e2fsprogs python-paramiko -y && chattr -i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && rm -rf /home/xtreamcodes/iptv_xtream_codes/admin && rm -rf /home/xtreamcodes/iptv_xtream_codes/pytools && rm -rf /home/xtreamcodes/iptv_xtream_codes/adtools && wget https://xtream-masters.com/guide/resources.php?file=xui/update.zip -O /tmp/update.zip -o /dev/null && unzip /tmp/update.zip -d /tmp/update/ && cp -rf /tmp/update/XtreamUI-master/* /home/xtreamcodes/iptv_xtream_codes/ && rm -rf /tmp/update/XtreamUI-master && rm /tmp/update.zip && rm -rf /tmp/update && /home/xtreamcodes/iptv_xtream_codes/start_services.sh
Backup Your Database
Moving servers? Run this command on your OLD server to create a backup file named xtcdump.sql.
mysqldump xtream_iptvpro > xtcdump.sql
Restore Your Database
Upload the xtcdump.sql file to your NEW server's /root folder, then run this command to restore it.
mysql xtream_iptvpro < /root/xtcdump.sql
Fix Login After Restore
If you can't log in after restoring a database, run this SQL command to reset the admin user/password to admin / admin.
mysql -u root -p xtream_iptvpro -e "UPDATE reg_users SET password='$6$rounds=20000$xtreamcodes$XThC5OwfuS0YwS4ahiifzF14vkGbGsFF1w7ETL4sRRC5sOrAWCjWvQJDromZUQoQuwbAXAFdX3h3Cp3vqulpS0', username='admin', member_group_id='1' WHERE id='1';"
Clear Huge Logs
If your panel is slow, your logs might be full. Use this to empty them instantly.
mysql -u root -p xtream_iptvpro -e "TRUNCATE client_logs; TRUNCATE user_activity; TRUNCATE stream_logs;"
Restart All Services
If your panel isn't loading or streams are offline, this is the first command you should run.
/home/xtreamcodes/iptv_xtream_codes/start_services.sh
Fix 500 Errors (GeoLite2)
If you see "Internal Server Error 500" or streams won't start, your GeoIP database is likely corrupted. This fixes it.
sudo chattr -i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && sudo wget -q https://xtream-masters.com/guide/resources.php?file=xui/GeoLite2.mmdb -O /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb && sudo chattr +i /home/xtreamcodes/iptv_xtream_codes/GeoLite2.mmdb
Force EPG Reload
If your EPG is empty in apps, force the panel to download it again.
/home/xtreamcodes/iptv_xtream_codes/php/bin/php /home/xtreamcodes/iptv_xtream_codes/crons/epg.php
Change Streaming Port
Want to change the default port 25461 to something else (like 8080)? Replace NEWPORT with your desired number.
sed -i 's/25461/NEWPORT/g' /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf ; /etc/init.d/xtreamcodes
Change Admin Port
Want to hide your admin panel login? Change default port 25500 to something else.
sed -i 's/25500/NEWPORT/g' /home/xtreamcodes/iptv_xtream_codes/nginx/conf/nginx.conf ; /etc/init.d/xtreamcodes
High RAM Usage Fix
If your server RAM is filling up, add this setting to your system configuration.
echo "vm.happiness=100" >> /etc/sysctl.conf && sudo sysctl -p