How to set up VPS on Hostinger

intermediate 45 min read Updated 2026-03-13
Quick Answer

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

1

Purchase a VPS hosting plan

Select a plan like KVM1, KVM2, KVM4, or KVM8 based on your CPU, RAM, and storage needs from Hostinger's VPS offerings in hPanel. Complete the purchase process directly in hPanel to activate your pending VPS order.
Choose a plan matching your project's resource requirements for optimal performance.
2

Access hPanel and initiate VPS setup

Log in to hPanel, navigate to the top menu and click VPS. Locate your pending VPS plan on the dashboard and click the Setup button next to it, or go to hPanel → Home and press Setup next to the pending order.
3

Configure initial VPS settings

Choose an operating system like CentOS, Ubuntu, Fedora, Debian, or Suse; beginners should pick AlmaLinux 8 64bit with CyberPanel or plain Ubuntu. Select a data center location closest to your audience, enter a VPS hostname (e.g., vps.yourdomain.com), then click Setup. Deployment takes a few minutes; check status in the VPS section.
Opt for OS templates with panels like CyberPanel for easier management if you're new to servers.
4

Install control panel (optional)

If not selected earlier, go to VPS → select your VPS → sidebar Operating SystemOS with Panel. Choose CyberPanel template, click Change OS (create a backup first). Select Default package. Access CyberPanel at https://vpsipaddress:8090.
Backups prevent data loss during OS changes.
5

Retrieve SSH access details

In hPanel, go to VPS → select your VPS → OverviewSSH access. Note the server IP address, default SSH port (22), root username (root), and root password. Use the browser-based terminal on Overview for quick access.
Browser terminal is ideal for initial checks without external tools.
6

Connect to VPS via SSH

For Linux/macOS: Open Terminal, run 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.
7

Update VPS software

sudo apt update && sudo apt upgrade -y
Run this for Debian/Ubuntu (use yum for CentOS). Reboot if prompted: sudo reboot.
Always update after setup to patch security vulnerabilities.
8

Secure SSH by changing port and creating non-root user

Edit SSH config: 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.
Update firewall rules in hPanel after port change.
9

Enable SSH key authentication

On local machine: ssh-keygen to generate keys. Copy public key: ssh-copy-id newusername@YOUR_SERVER_IP -p PORT. Test passwordless login.
SSH keys are more secure than passwords; disable password auth after setup.

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.

Special Offer

Affiliate link. We may earn a commission at no extra cost to you.