What if deploying a Next.js app to a VPS took just one sentence?
You just bought a fresh Hostinger VPS. It's a blank Ubuntu server — nothing installed. No Node.js, no Nginx, no PM2, nothing.
Normally, you'd spend 30+ minutes SSHing in, installing packages, creating config files, setting up reverse proxies, and troubleshooting why port 80 isn't working.
What if you could skip all of that and just tell an AI to do it?
That's exactly what this tutorial shows. One prompt to Claude Code, and your Next.js app is live on your VPS.
Watch the Full Tutorial
What You Need
- A Hostinger VPS running Ubuntu (fresh, nothing installed)
- Claude Code installed on your Mac or Linux machine
- Your VPS IP address from the Hostinger dashboard
Step 1: Set Up SSH Key Access
Before Claude Code can connect to your server, you need SSH key authentication. This is a one-time step.
Generate an SSH Key (if you don't have one):
ssh-keygen
Press Enter through the prompts to accept defaults. This creates a key pair in ~/.ssh/.
Copy your public key:
cat ~/.ssh/id_rsa.pub
Copy the entire output and paste it into your Hostinger VPS dashboard under SSH Keys.
Step 2: The One Prompt That Does Everything
Open Claude Code in your terminal and give it this single prompt:
SSH into my server at root@YOUR_SERVER_IP, install Node.js,
create a new Next.js app at /var/www/mysite, configure nginx
as a reverse proxy to port 3000, set up a systemd service to
keep the app running, and make it live on port 80.
Replace YOUR_SERVER_IP with your actual Hostinger VPS IP address.
That's it. One prompt.
What Claude Code Does Automatically
After you hit Enter, Claude Code handles everything — without you typing a single SSH command:
- SSHs into your server using your key
- Updates system packages
- Installs Node.js (via NodeSource)
- Creates a Next.js app at
/var/www/mysite - Builds the app for production
- Installs and configures Nginx as a reverse proxy to port 3000
- Creates a systemd service so the app auto-starts on reboot
- Starts the app and makes it live on port 80
The whole process takes a few minutes — compared to 30+ minutes of manual configuration.
See It Live
Once Claude Code finishes, open your browser and navigate to your VPS IP address. You'll see your Next.js app running live — the default welcome page, served via Nginx on port 80.
No Docker. No CI/CD pipeline. No YAML files. Just one prompt.
Bonus: Update Your App with a Follow-Up Prompt
Want to make changes? Just give Claude Code another prompt:
SSH into my server at root@YOUR_SERVER_IP and change the heading
of the Next.js app at /var/www/mysite to "Deployed by AI",
then rebuild and restart the app.
Claude Code will SSH in, find the right file, update the heading, rebuild the app, restart the systemd service, and your site is updated.
This Works for More Than Next.js
The same pattern works for deploying:
- React apps (with serve or Nginx for static files)
- Angular apps
- Python/Django/Flask apps
- Express.js APIs
- Any web application that runs on a Linux server
Just describe what you want in plain English, and Claude Code figures out the commands.
Why Hostinger VPS?
Hostinger VPS is an excellent choice for this workflow:
- Affordable pricing — plans start very low for a full Ubuntu VPS
- Clean Ubuntu installs — fresh slate, no bloatware
- SSH key support built into the dashboard
- Fast provisioning — server ready in minutes
- Full root access — install whatever you need
Conclusion
Server deployment doesn't have to be tedious and error-prone. With Claude Code and a Hostinger VPS, you can go from a blank server to a live Next.js application in one prompt.
Try it yourself: grab a Hostinger VPS, install Claude Code, and deploy your next project with a single sentence.
Top comments (0)