Back to Blog

Deploy Next.js to Hostinger with One AI Prompt (Claude Code Tutorial)

By Ayyaz Zafar
Deploy Next.js to Hostinger VPS with Claude Code - one prompt deployment tutorial

What If Deploying to a VPS Took 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 the next 30 minutes SSHing in, installing packages, creating config files, setting up a reverse proxy, configuring a systemd service, 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 — deployed, configured, and serving traffic on port 80.

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 set up. This is a one-time step.

Generate an SSH Key (if you don't have one)

Open your terminal and run:

ssh-keygen

Press Enter through the prompts to accept the defaults. This creates a key pair in ~/.ssh/.

Copy Your Public Key

Display your public key so you can copy it:

cat ~/.ssh/id_rsa.pub

Copy the entire output.

Add the Key to Hostinger

Go to your Hostinger VPS dashboard, navigate to the SSH Keys section, and paste your public key there. This allows passwordless SSH access from your machine.

Step 2: The One Prompt That Does Everything

Now here's the magic. 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 takes over. Here's what it handles — all without you typing a single SSH command:

  1. SSHs into your server using your key
  2. Updates the system packages
  3. Installs Node.js (via NodeSource)
  4. Creates a Next.js app at /var/www/mysite using create-next-app
  5. Builds the app for production
  6. Installs and configures Nginx as a reverse proxy pointing to port 3000
  7. Creates a systemd service so the app auto-starts on reboot
  8. Starts the app and makes it live on port 80

You just watch it work. The whole process takes a few minutes — compared to the 30+ minutes of manual configuration it would normally require.

Step 3: 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 Next.js 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? You don't need to manually SSH in and edit files. 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. All from one sentence.

This Works for More Than Next.js

The approach shown in this tutorial isn't limited to Next.js. You can use the exact same pattern to deploy:

  • 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 because:

  • 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 — your server is ready in minutes
  • Full root access — install whatever you need

→ Get a Hostinger VPS here

Related Tutorials

Conclusion

Server deployment doesn't have to be a tedious, error-prone process. With Claude Code and a Hostinger VPS, you can go from a blank server to a live Next.js application in one prompt.

The days of memorizing Nginx config syntax, systemd unit file structures, and Node.js installation commands are over. Tell the AI what you want, and it handles the rest.

Try it yourself: grab a Hostinger VPS, install Claude Code, and deploy your next project with a single sentence.

Share this article