I recently migrated part of my development work to a VPS. It started as a temporary workaround during a business trip when I only had a thin laptop with limited performance—but after using it for a while, I found it genuinely more convenient in several ways. An AI agent runs on it 24/7 without worrying about the local machine sleeping or losing power. Builds and tests don't consume local resources, and the laptop fan stays quiet.
Cloud development isn't a universal solution. Scenarios requiring a local GPU or extreme latency sensitivity are better served locally. But for many everyday coding tasks, a $15/month VPS is worth serious consideration.
Is this setup right for you?
Good fit: you primarily write code in editors like Cursor, VS Code, or NeoVim; your projects run in Linux/Docker environments; you need a server to run AI agents or scheduled tasks continuously; you regularly switch between different devices.
Not a good fit: you need a local GPU for model training or inference; iOS development requires Xcode; you're highly sensitive to code completion latency (network delay will affect the experience); you have no Linux background at all.
Server selection: what configuration is sufficient
Minimum and recommended specs
| Use case | CPU | RAM | Storage |
|---|---|---|---|
| Lightweight coding + testing | 2 cores | 4GB | 40GB NVMe |
| Primary development environment | 4 cores | 8GB | 80GB NVMe |
| Multi-project + Docker | 4 cores | 16GB | 100GB NVMe |
A 4-core 8GB configuration handles multiple Docker containers simultaneously, compiles medium-sized projects, and runs AI agents—sufficient for most individual developers.
Node selection has an outsized impact on experience
Latency is the most important hidden factor in this setup. When writing code over SSH, delays above 100ms produce noticeable input lag; above 200ms it becomes effectively unusable.
Choose a node close to your physical location: users in China should select Hong Kong, Singapore, or Japan; US users should choose the West Coast; European users should select Germany or the Netherlands. Test evening peak latency to your target node before purchasing—daytime figures don't reflect real conditions.
Hetzner offers the best value on European nodes at around €8–10/month for 4-core 8GB. Vultr and DigitalOcean provide broad global coverage with flexible hourly billing. DMIT offers CN2 GIA routing optimization for users in China with stable low latency.
Complete setup walkthrough
Step 1: Basic security configuration
After purchasing the VPS, complete security configuration before installing the development environment.
# Connect via SSH
ssh root@your_server_IP
# Update system
apt update && apt upgrade -y
# Create a regular user (avoid running as root long-term)
adduser dev
usermod -aG sudo dev
# Switch to new user
su - dev
Configure SSH key login (run locally):
# Generate key pair locally
ssh-keygen -t ed25519 -C "vps-dev"
# Upload public key to server
ssh-copy-id dev@your_server_IP
After confirming key login works, disable password authentication:
sudo nano /etc/ssh/sshd_config
# Find and modify:
# PasswordAuthentication no
# Port 2222 (change from default)
sudo systemctl restart sshd
Configure the firewall:
sudo ufw allow 2222/tcp # Your new SSH port
sudo ufw allow 8080/tcp # code-server port (used later)
sudo ufw enable
Step 2: Install the development environment
# Install essential tools
sudo apt install -y git curl wget build-essential
# Install Docker
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker dev
newgrp docker
# Verify Docker works
docker run hello-world
Install Node.js if needed:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -
sudo apt-get install -y nodejs
Install Python development environment:
sudo apt install -y python3 python3-pip python3-venv
Step 3: Deploy code-server (VS Code in the browser)
code-server runs a full VS Code instance accessible from any browser without installing anything locally:
curl -fsSL https://code-server.dev/install.sh | sh
Edit ~/.config/code-server/config.yaml:
bind-addr: 127.0.0.1:8080
auth: password
password: your_secure_password
cert: false
Enable auto-start on boot:
sudo systemctl enable --now code-server@dev
Set up Nginx with HTTPS for secure access:
sudo apt install nginx certbot python3-certbot-nginx -y
Nginx configuration:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
}
Apply for an SSL certificate:
sudo certbot --nginx -d your-domain.com
Once configured, open https://your-domain.com in any browser, enter your password, and you're in a full VS Code environment.
Step 4: Connect with Cursor (recommended approach)
If you use Cursor rather than code-server, connecting via Remote SSH delivers a smoother experience. Add to ~/.ssh/config locally:
Host my-vps
HostName your_server_IP
User dev
Port 2222
IdentityFile ~/.ssh/id_ed25519
In Cursor, press Cmd+Shift+P, search for "Remote-SSH: Connect to Host", and select my-vps. Cursor automatically installs the necessary components on the server and opens a session running entirely in the server environment.
Keeping AI agents running continuously
This is the biggest advantage of cloud development over local: programs keep running regardless of whether your computer is online. Use systemd to manage long-running agent services:
sudo nano /etc/systemd/system/my-agent.service
[Unit]
Description=My AI Agent
After=network.target
[Service]
Type=simple
User=dev
WorkingDirectory=/home/dev/my-agent
ExecStart=/home/dev/.venv/bin/python agent.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable my-agent
sudo systemctl start my-agent
Use journalctl -u my-agent -f to follow the agent's logs in real time.
Troubleshooting common issues
Input lag from high latency
First confirm actual latency with ping your_server_IP. If the latency itself is low but SSH still feels sluggish, add these options to ~/.ssh/config:
Host my-vps
...
ServerAliveInterval 60
TCPKeepAlive yes
Compression yes
Compression yes helps on slower connections but isn't necessary on fast local networks.
Insufficient memory
free -h
# Check which processes use the most memory
ps aux --sort=-%mem | head -10
If memory is consistently near the ceiling, add swap as a stopgap before upgrading:
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
code-server inaccessible
Check in sequence: whether code-server is running (systemctl status code-server@dev), whether Nginx is healthy (systemctl status nginx), and whether the firewall ports are open (ufw status).
The cost calculation
A 4-core 8GB VPS runs about $20/month on Vultr or around $10/month on Hostinger. Compared to the monthly amortized cost of a MacBook Pro, the difference is significant.
This doesn't mean a VPS replaces your local machine entirely—it means a substantial portion of development work can move to the cloud, with the local machine handling only lightweight tasks and display. An entry-level laptop becomes sufficient for the rest.
If your primary work is web development, backend services, or AI application development, this setup is worth a serious trial.