- Ramsey's Blog
- Posts
- Intro: Claude Code Setup (on VPS)
Intro: Claude Code Setup (on VPS)
DW #122 🟡

Seems like many ppl who’ve I trust as AI authorities have made the jump to using Claude Code these past few months so I thought I’d see why.
If you're still vibe-coding, Claude Code is basically the next evolution - ie. instead of chatting with ChatGPT in the browser and pasting outputs into your terminal (or using an app like Cursor/Replit) Claude Code is a CLI tool.
Which means it can essentially see your entire computer, run commands, and make changes directly. Direct integration into whatever you want to give it access to.
The thing is, to really use it properly, you should run it on it’s own server (not your laptop), a VPS preferably. This is better for a few reasons - keep it isolated from your precious main environment, access from anywhere, dedicated resources, and relatively cheap these days.
Now I'd never set up a VPS before this week, so I figured I’d try it. TBH it turned out to be pretty straightforward. Here's exactly how I did it, thought you might find it useful:
Installing Claude Code on VPS in <15min
Step 1: Get a DigitalOcean Account
I went with DigitalOcean because the interface and pricing are simple. $6/month for their basic droplet is all you need to start.
Sign up at digitalocean.com and verify your email. Nothing fancy here.

Step 2: Create Your Droplet
Click "Create" → "Droplet" and configure:
OS: Ubuntu 24.04 LTS (stable and well-documented)
Size: Basic $6/month plan (1 vCPU, 1GB RAM)
Region: Pick whatever's closest to you
Don't overthink this. The basic plan handles Claude Code just fine for most use cases.
Step 3: Set Up SSH Keys
This was new territory for me - SSH keys are basically a more secure way to access your server than passwords.
On your local machine (Mac/Linux):
# Generate your key pair
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Just hit Enter for all the prompts
# Show your public key
cat ~/.ssh/id_rsa.pub
Copy that entire output and paste it into the "SSH Keys" field when creating your droplet. Make sure you're copying the
.pub
file (public key), not the private one.
Step 4: Connect to Your Server
Once your droplet is created, you'll get an IP address. Connect via SSH:
ssh root@YOUR_DROPLET_IP
If you get "permission denied," you probably messed up the SSH key step. Double-check you added the public key to DigitalOcean.
Step 5: Basic Security Setup
Running everything as root is asking for trouble. Create a proper user account:
# Update the system first
apt update && apt upgrade -y
# Create your user (replace 'ramsey' with whatever)
adduser ramsey
usermod -aG sudo ramsey
# Switch to your new user
su - ramsey
Now here's the part that tripped me up: you need to copy your SSH key to this new user account, otherwise you'll be locked out.
# While logged in as your new user
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Add your public key (the same one from Step 3)
echo "YOUR_PUBLIC_KEY_HERE" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
This took me a few tries to get right. Claude (in the browser) walked me through the permissions issues I was having. 1
Step 6: Install Node.js
Claude Code needs Node.js 18 or higher. Ubuntu's default version is usually too old, so get it from NodeSource:
# Install Node.js 20.x
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Check it worked
node --version # Should show v20.x.x
Step 7: Configure npm
To avoid permission headaches later, set up npm to install global packages in your user directory:
# Create directory for global packages
mkdir -p ~/.npm-global
# Configure npm
npm config set prefix ~/.npm-global
# Add to your PATH
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Step 8: Install Claude Code
Finally, the big moment - install Claude!!:
npm install -g @anthropic-ai/claude-code
# Test it
claude doctor
If
claude doctor
runs without errors, you're good to go! ✅
Step 9: Start Using It
Run claude
to start the setup process. You'll need to authenticate with your Anthropic account (Claude Pro subscription recommended for regular use). Some things it’s well suited for compared to other LLM tools / interfaces, according to Claude itself:

What I Learned
The whole process took me about 15min tbh, mostly because I'd never dealt with user permissions on Linux before. The SSH key setup is the trickiest part if you haven't done it before, but once you get it working, everything else is straightforward.
Having Claude Code running on a dedicated server feels like a pretty big upgrade from the copy-paste workflow. It can actually understand your project structure, make changes across multiple files, and handle the kind of complex refactoring that would take forever to explain in a chat interface.
Cost-wise, you're looking at around $26-30/month total ($6 for the VPS + $20 for Claude Pro). For most of us building software, that's an easy-peasy investment.
If you've been on the fence about trying Claude Code, this is probably the easiest way to get started without messing up your local development environment. LMK if questions :-)
Peace,
Ramsey
1 If you run into ANY trouble throughout this process, just copy the error into your in-browser LLM of choice and ask for help… browser Claude guided me thru most of this