Set Up a VPS on Hostinger in 5 Minutes Using Claude Code (AI Does Everything)

Fresh VPS. One Prompt. Fully Deployed.
Most VPS setup tutorials spend 20 minutes walking you through individual commands — updating packages, creating users, configuring firewalls, setting up nginx, writing PM2 configs. Each step is a chance to make a typo or miss something.
This tutorial is different. I gave Claude Code a single prompt and watched it SSH into a fresh Hostinger VPS, handle every setup step automatically, and deploy a live Node.js app. Under 5 minutes. No config files memorized.
Here's exactly how to do it yourself.
Which Hostinger VPS Plan Should You Pick?
People overthink this. Quick answer:
- KVM1 — 1 vCPU, 4GB RAM, ~$5/month. Perfect for one app, a small site, or a personal project. This is what I use in this tutorial.
- KVM2 — 2 vCPU, 8GB RAM. Go here if you're running multiple apps, expecting real traffic, or need a database alongside your app.
You can upgrade later without touching your setup, so start small and scale when you need it.
When signing up, choose Ubuntu LTS as your operating system. Skip the control panels — CyberPanel, CloudPanel, all of them. You don't need them. Claude Code is your control panel.
→ Get started with Hostinger VPS
Step 1: Get Your VPS IP Address
Once Hostinger provisions your VPS (takes about 2 minutes), open the hPanel dashboard. The only thing you need to copy from Hostinger is the IP address. That's it. Everything else, Claude Code handles.
Step 2: Open Claude Code and Run This Prompt
Open your terminal and launch Claude Code:
claude
Then paste this prompt, replacing the IP with yours:
I have a fresh Hostinger VPS at IP: YOUR_VPS_IP. Root password is set.
Please do the following via SSH:
1. Connect as root
2. Update all packages
3. Create a new user called "deploy" with sudo access
4. Set up SSH key authentication for the deploy user using my local SSH key
5. Configure UFW firewall — allow SSH (22), HTTP (80), HTTPS (443) only
6. Install Node.js LTS and nginx
7. Create a simple Express "Hello from Hostinger" app
8. Configure nginx as a reverse proxy to serve it on port 80
9. Set up the app to run with PM2 so it survives reboots
Tell me when the site is live.
Hit enter. Claude Code SSHes into the server and starts executing real commands.
What Claude Code Does (and Why It Matters)
Watch what happens step by step:
Package Update
Claude runs apt update && apt upgrade -y on the server. Standard first step on any fresh VPS — ensures you're not starting with outdated software.
Deploy User Creation
Running everything as root is a security risk. Claude creates a deploy user with sudo privileges and sets up SSH key authentication using your local key. From now on, you SSH in as deploy, not root.
UFW Firewall Configuration
This is the step that trips up most beginners. Claude configures UFW to allow only three things: SSH on port 22, HTTP on port 80, and HTTPS on port 443. Everything else is blocked. In typical tutorials, this takes 5 minutes of explaining. Claude handles it in 10 seconds.
Node.js and nginx Installation
Claude installs Node.js LTS and nginx, then writes a minimal Express app that responds with "Hello from Hostinger". No copy-pasting from StackOverflow. No version mismatches. It writes correct config.
nginx Reverse Proxy
Your Express app runs on port 3000. nginx listens on port 80 and forwards traffic to your app. Claude writes the nginx config and enables the site. This proxy setup is the part that confuses most beginners — Claude handled it in one step.
PM2 Process Manager
Without PM2, your app dies when the terminal closes or the server reboots. Claude installs PM2, starts your app, and saves the process list so it auto-restarts on reboot. Your app is now persistent.
When Claude reports "Site is live," open a browser, navigate to your VPS IP address, and see your app running.
Step 3: Add SSL in 60 Seconds
If you have a domain pointed at your server, adding HTTPS is one more prompt:
My domain example.com is pointed at this server.
Install Certbot and set up a free Let's Encrypt SSL certificate for example.com.
Configure nginx to redirect HTTP to HTTPS automatically.
Claude installs Certbot, issues the certificate via Let's Encrypt, and updates the nginx config to redirect all HTTP traffic to HTTPS. Green padlock — done.
Claude Code vs Hostinger's Built-in Ask AI
Hostinger has a built-in AI assistant called Ask AI — it's in the top right of your hPanel dashboard. It's MCP-powered and genuinely capable: it can execute server actions, take snapshots, manage Docker, monitor resources, configure security. Around 200 built-in actions for managing Hostinger infrastructure.
So what does Claude Code add?
Scope. Ask AI manages your server. Claude Code manages your server and your application — writes the code, deploys it, debugs errors, configures custom software. It's not limited to Hostinger's action list. Anything you'd do on the command line, Claude Code can do. The two tools complement each other rather than compete.
What to Deploy Next
This tutorial used a simple Express app to show the full setup flow. If you want to deploy a real Next.js project to the same VPS, the approach is identical — you just write a more ambitious prompt. I have a separate video covering that exact workflow — link in the description.
The Full Setup in Review
- Fresh Hostinger VPS provisioned
- Packages updated
- Deploy user created with SSH key auth
- UFW firewall: SSH, HTTP, HTTPS only
- Node.js + nginx installed
- Express app deployed
- nginx reverse proxy configured
- PM2 managing the process
- SSL certificate installed
Total time: under 5 minutes. Total commands you had to memorize: zero.
→ Start your Hostinger VPS here (affiliate link — it's what I use for these tutorials)