VPS Hosting Guide

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.

Step 1: Understanding What a VPS Is

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.
Step 2: Step 1: Choose Your Hostinger VPS Plan

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.

Step 3: Step 2: Accessing the 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.

Step 4: Step 3: Connecting to Your VPS via SSH

On macOS, Linux, or Windows Terminal, run the following command:

ssh root@your-server-ip

Enter your root password from the Hostinger panel. You’re now inside your VPS shell! 🎉

Step 5: Step 4: Setting Up the Server Environment

First, update your system:

sudo apt update && sudo apt upgrade -y

Then 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 enable
Step 6: Step 5: Install a Hosting Manager (Optional)

If 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 | bash
Step 7: Step 6: Set Up a Database (Optional)

If 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 mydatabasename

For MySQL:

sudo apt install mysql-server -y sudo mysql_secure_installation
Step 8: Step 7: Deploy Your Website or App

For 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" -- start

Your app is now running, but likely on a port like 3000. Next, we'll make it accessible to the world.

Step 9: Step 8: Configure Nginx and SSL

Create an Nginx configuration file to act as a reverse proxy, directing web traffic to your app.

sudo nano /etc/nginx/sites-available/yourdomain.com

Paste 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.com
Step 10: Step 9: Point Your Domain to the VPS

In your Hostinger DNS Zone Editor, add these records:

  • A record: @ → your VPS IP
  • CNAME record: www → yourdomain.com

Propagation may take 1–2 hours.

Step 11: Step 10: Secure and Maintain Your VPS

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