☁️ GCP VS Code

Run unlimited VS Code instances in your browser using Google Cloud.
GitHub Codespaces limits you to 2 concurrent instances. With Google Cloud, you can run as many as you want — each one a full VS Code environment with its own terminal, filesystem, Docker, and dev tools.

Why?
| GitHub Codespaces | GCP VS Code |
|---|
| Max instances | 2 (free) / 4 (pro) | Unlimited |
| Max CPU | 4 cores | Up to 96 cores |
| Max RAM | 16 GB | Up to 384 GB |
| Storage | 32 GB | Up to 64 TB |
| Cost | $0.18/hr (4-core) | $0.13/hr (4-core) |
| Customization | Limited | Full root access |
| Docker | Limited | Full Docker support |
Quick Start
# Clone this repo
git clone https://github.com/nirholas/vscode-google-cloud.git
cd vscode-google-cloud
# Make executable
chmod +x gcp-vscode.sh
# One-time setup (installs gcloud CLI, authenticates you)
./gcp-vscode.sh setup
# Set your project ID
export GCP_PROJECT_ID=your-project-id
# Create your first VS Code instance
./gcp-vscode.sh create my-vscode-1
# Wait ~2 min, then get the URL and password
./gcp-vscode.sh url my-vscode-1
./gcp-vscode.sh password my-vscode-1
# Open the URL in your browser, enter the password — done!
What You Get
Each VM comes pre-installed with:
- VS Code in your browser (via code-server)
- Node.js 20 + npm
- Bun runtime
- Docker + Docker Compose
- Python 3 + pip
- Git, curl, wget, jq, build-essential
- 100% root access — install anything you want
Commands
| Command | Description |
|---|
./gcp-vscode.sh setup | One-time: install gcloud, authenticate, set project |
./gcp-vscode.sh create [name] [zone] | Create a new VS Code VM |
./gcp-vscode.sh list | List all your VS Code VMs |
./gcp-vscode.sh url [name] [zone] | Get the browser URL |
./gcp-vscode.sh password [name] [zone] | Get the login password |
./gcp-vscode.sh ssh [name] [zone] | SSH directly into a VM |
./gcp-vscode.sh stop [name] [zone] | Stop a VM (saves money) |
./gcp-vscode.sh start [name] [zone] | Start a stopped VM |
./gcp-vscode.sh resize [name] [type] [zone] | Resize VM (e.g., e2-standard-8) |
./gcp-vscode.sh delete [name] [zone] | Delete a VM permanently |
Defaults: name=vscode-dev-1, zone=us-central1-a, machine=e2-standard-4
Configuration
Configure via environment variables (add to ~/.bashrc for persistence):
export GCP_PROJECT_ID=your-project-id # Required
export GCP_ZONE=us-central1-a # Default zone
export GCP_MACHINE_TYPE=e2-standard-4 # VM size
export GCP_DISK_SIZE=50 # Disk in GB
Machine Types & Pricing
| Machine Type | vCPU | RAM | $/hour | $/day (24/7) | $/month |
|---|
e2-standard-2 | 2 | 8 GB | $0.07 | $1.61 | $48 |
e2-standard-4 | 4 | 16 GB | $0.13 | $3.17 | $95 |
e2-standard-8 | 8 | 32 GB | $0.27 | $6.34 | $190 |
e2-standard-16 | 16 | 64 GB | $0.54 | $12.96 | $389 |
n2-standard-4 | 4 | 16 GB | $0.19 | $4.68 | $140 |
n2-standard-8 | 8 | 32 GB | $0.39 | $9.36 | $281 |
Tip: Stop VMs when not using them. Stopped VMs only cost ~$0.17/day for disk storage.
To change the size of an existing VM:
./gcp-vscode.sh resize my-vscode-1 e2-standard-8
Zones
Choose a zone close to you for the best latency:
| Zone | Location |
|---|
us-central1-a | Iowa, USA (default) |
us-east1-b | South Carolina, USA |
us-west1-a | Oregon, USA |
europe-west1-b | Belgium |
europe-west2-a | London |
asia-east1-a | Taiwan |
asia-northeast1-a | Tokyo |
australia-southeast1-a | Sydney |
# Create a VM in London
./gcp-vscode.sh create uk-dev europe-west2-a
Full list: gcloud compute zones list
Examples