Prerequisites
Before installing Python, make sure you have:
- SSH access to your VPS
- Root or sudo privileges
Check if Python is Already Installed
Connect to your VPS:
ssh hxroot@YOUR_SERVER_IP -p 22
python3 --version
Install Python 3 on Ubuntu/Debian
apt update
apt install python3 python3-pip -y
Install Python 3 on CentOS/Rocky
yum install python3 python3-pip -y
Install Specific Python Version (3.10)
add-apt-repository ppa:deadsnakes/ppa
apt update
apt install python3.10 python3.10-venv -y
Install pip for Package Management
apt install python3-pip -y
Verify Installation
python3 --version
pip3 --version
✅ Python has been installed on your VPS.