How to Set Up a VPS on Hostinger
A step-by-step guide for beginners to gain full control over your server environment for your Next.js apps, WordPress sites, or production APIs.
A Virtual Private Server (VPS) is a slice of a physical server isolated using virtualization. Unlike shared hosting, where multiple users share CPU and RAM, a VPS gives you dedicated performance and security — but without the high cost of a full dedicated server.
Why Choose a VPS?
- Root access – full control of your server.
- Dedicated resources – guaranteed CPU, RAM, and SSD.
- Better security – isolated environment.
- Custom configuration – install anything from Node.js to Docker.
- Perfect for developers – build SaaS apps, host APIs, and run CI/CD pipelines.
Head to Hostinger VPS Hosting and choose a plan based on your needs. For small projects, KVM 2 or KVM 4 plans offer great value. For production-grade apps, aim for KVM 4 or above.
When you purchase, you’ll receive your Server IP address, SSH login credentials, and a link to the Hostinger VPS dashboard.
Once purchased, go to your Hostinger control panel → VPS → select your server. From here you can reboot, shut down, reinstall the OS, access the browser-based terminal, and manage backups.
On macOS, Linux, or Windows Terminal, run the following command:
ssh root@your-server-ipEnter your root password from the Hostinger panel. You’re now inside your VPS shell! 🎉
First, update your system:
sudo apt update && sudo apt upgrade -yThen install basic tools and set up the firewall:
sudo apt install curl git unzip ufw nginx -y sudo ufw allow OpenSSH sudo ufw allow 'Nginx Full' sudo ufw enableIf you’re not comfortable with the command line, a management panel like Coolify or Plesk can help you deploy multiple sites easily. To install Coolify:
curl -fsSL https://get.coollabs.io/coolify/install.sh | bashIf your application needs a database, you can install PostgreSQL or MySQL.
For PostgreSQL:
sudo apt install postgresql postgresql-contrib -y sudo -u postgres createuser --interactive sudo -u postgres createdb mydatabasenameFor MySQL:
sudo apt install mysql-server -y sudo mysql_secure_installationFor a Node.js / Next.js app, you can clone your project and start it with a process manager like PM2 to keep it running:
git clone https://github.com/username/project.git cd project npm install npm run build npm install -g pm2 pm2 start npm --name "app-name" -- startYour app is now running, but likely on a port like 3000. Next, we'll make it accessible to the world.
Create an Nginx configuration file to act as a reverse proxy, directing web traffic to your app.
sudo nano /etc/nginx/sites-available/yourdomain.comPaste this configuration, replacing `yourdomain.com` and `3000` with your domain and app port:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}Enable the site and then use Certbot to automatically configure SSL:
sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/ sudo apt install certbot python3-certbot-nginx -y sudo certbot --nginx -d yourdomain.com -d www.yourdomain.comIn your Hostinger DNS Zone Editor, add these records:
- A record:
@→ your VPS IP - CNAME record:
www→ yourdomain.com
Propagation may take 1–2 hours.
Keep your VPS healthy with regular updates, monitoring (htop, Netdata), backups from the Hostinger panel, and security tools like fail2ban.
Ready to Launch?
Setting up a VPS on Hostinger gives you freedom, performance, and control. Start building your VPS-powered projects today and scale without limits.
Get Started with Hostinger