How to set up VPS on Hostinger
Purchase a VPS plan in hPanel, set it up by selecting OS and location, access via SSH as root using IP and password from Overview, update packages, create non-root user with SSH keys, secure with firewall and custom port, then point domain DNS to VPS IP.
Prerequisites
- Active Hostinger account and purchased VPS plan via hPanel
- SSH client (Terminal on Linux/macOS, PuTTY on Windows)
- Basic command-line knowledge
- Domain name ready for DNS if hosting websites
Step-by-Step Instructions
Purchase a VPS hosting plan
Access hPanel and initiate VPS setup
Configure initial VPS settings
vps.yourdomain.com), then click Setup. Deployment takes a few minutes; check status in the VPS section.Install control panel (optional)
https://vpsipaddress:8090.Retrieve SSH access details
22), root username (root), and root password. Use the browser-based terminal on Overview for quick access.Connect to VPS via SSH
ssh root@YOUR_SERVER_IP -p 22 and enter root password. For Windows: Use PuTTY, input IP address and port 22, click Open, then enter root username and password. Type help for commands once connected.Update VPS software
sudo apt update && sudo apt upgrade -y Run this for Debian/Ubuntu (use yum for CentOS). Reboot if prompted: sudo reboot.Secure SSH by changing port and creating non-root user
sudo nano /etc/ssh/sshd_config, change Port 22 to e.g. Port 2222, save (Ctrl+O, Enter, Ctrl+X), then sudo systemctl restart sshd. Update hPanel firewall. Create user: sudo adduser newusername
sudo usermod -aG sudo newusername Switch: su - newusername.Enable SSH key authentication
ssh-keygen to generate keys. Copy public key: ssh-copy-id newusername@YOUR_SERVER_IP -p PORT. Test passwordless login.Common Issues & Troubleshooting
"Status: Error" on VPS dashboard after restarts or reinstalls
Restore a backup from hPanel, reinstall VPS (erases data), change OS template, or activate emergency mode in Settings for SSH/File Manager access.
SSH connection refused or timeout (e.g., "Connection refused")
Verify IP/port in hPanel Overview, check firewall allows port 22/tcp (<code>sudo ufw allow 22/tcp</code>), use browser terminal to test, ensure VPS status is active.
Cannot access after OS change or panel install
Wait for deployment (few minutes), check status in VPS dashboard, restore backup if data lost, or use Kodee AI in hPanel for command help.
Permission issues with new user
Ensure user added to sudo group (<code>sudo usermod -aG sudo newusername</code>), log out/in, test with <code>sudo</code> commands.