Back to Blog

I Gave Claude Code My Server IP and It Set Up Everything

By Ayyaz Zafar
Claude Code setting up a VPS server from one prompt

Watch the Full Tutorial

Setting up a VPS from scratch is one of those tasks every developer dreads. Install Node.js, configure nginx, set up reverse proxy, manage systemd services, deal with permissions. You either follow a 30-step tutorial or copy commands you don't fully understand from Stack Overflow.

What if you could just tell an AI "here is a server, set it up" and it actually does it?

Starting from Zero

I started with a completely fresh VPS on Hetzner — Ubuntu 24.04, nothing installed. Just a blank server with an IP address. No Node, no nginx, no code. Just a bare Ubuntu install.

The key insight: Claude Code can run terminal commands, which includes SSH. So it can SSH into your server and do anything you would do manually.

One Prompt to Rule Them All

Here's the prompt I gave Claude Code:

"I have a fresh Ubuntu VPS at [IP]. I can SSH as root. I want to: install Node.js, create a simple Next.js app, set it up as a systemd service, configure nginx as a reverse proxy, make the site live on the server's IP. SSH in and do everything. Don't ask me questions, just do it."

That's it. One prompt.

What Claude Code Did

Here's the sequence it followed — automatically, with permission prompts at each step:

Step 1: Test Connection

First it verified SSH access to the VPS. Smart — check before you build.

Step 2: Install Infrastructure

It updated system packages, then installed Node.js 22 and nginx. Getting the infrastructure ready before the app.

# Claude Code ran these automatically:
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs nginx

Step 3: Create the Next.js App

Navigated to /opt, ran create-next-app, and built the production version. This is where a normal tutorial would have 15 steps and three things that break.

Step 4: systemd Service + nginx Reverse Proxy

This is the part most developers get wrong manually. Claude Code wrote:

  • A systemd service file with correct working directory, environment variables, and auto-restart policy
  • An nginx config pointing port 80 to the Next.js app on port 3000
  • Removed the default nginx site, tested the config, and restarted nginx

Step 5: Verification

It checked that the Next.js service was active, nginx was running, and curled the website to confirm HTTP 200.

Result: Site is live. Node.js, Next.js with TypeScript and App Router, systemd service with auto-restart, nginx reverse proxy — all configured from one prompt.

But Can It Update the Site Too?

I asked Claude Code: "Change the homepage heading to 'Deployed by AI' and make it live."

It read the current page.tsx, updated the heading, rebuilt the app, and restarted the service. I reloaded the browser — updated. Live. From my Mac. I didn't SSH in once.

Should You Use This for Production?

Probably not yet. For anything serious, you want:

  • Proper CI/CD pipeline
  • Environment variables management
  • SSL certificates
  • Real deployment workflow

But for spinning up a side project, a demo server, or a staging environment — this is incredible. What used to take 30 minutes of config file editing now takes one sentence.

The Numbers

Manual setup: 20-30 minutes of SSH, config editing, debugging permission issues.

Claude Code: Under 2 minutes from blank server to live website.

And the model is only getting better. What it can do today with permission prompts, it will handle seamlessly in months.

Related Articles

Share this article