How I Stopped Fighting My MacBook’s RAM and Started Using a €0.01/hr Cloud Server
I’m a student. I run macOS on my MacBook M1. I use Claude, Claude Code, VS Code, and Arc browser all at the same time. And my MacBook’s RAM was constantly screaming at me.
The fix? A disposable cloud server I can spin up in 30 seconds, use for a few hours, and delete when I’m done — for literally cents.
Here’s how I set it up.
The Problem
Running Claude Code, VS Code with a bunch of extensions, the Claude.ai tab in Arc, and macOS all at once was pushing my M1 to its limit. Swapping, stuttering, the works. I needed more RAM but didn’t want to pay for a permanent server I’d forget to turn off.
The Idea: A Throwaway Server
The solution is simple: spin up a cloud server when you need extra power, do your work, delete it when you’re done. No monthly commitment. No idle billing. Just pay for the hours you actually use.
I went with Hetzner Cloud because it’s absurdly cheap (a decent 8GB server costs €0.0126/hr), has a great CLI, and spins up in about 20 seconds.
The Setup
1. Install the Hetzner CLI
brew install hcloud
hcloud context create my-project
# paste your API token from console.hetzner.cloud
2. Upload your SSH key
hcloud ssh-key create --name mba-key --public-key-from-file ~/.ssh/id_rsa.pub
3. The burst script
I keep everything in ~/.burst.zsh, sourced automatically from my .zshrc. Here’s what it does:
- Shows a TUI menu to pick a server size (with prices)
- Creates the server
- Sets up a firewall allowing only my IP (and my Coolify server)
- Waits until SSH is actually ready
- Opens VS Code Remote SSH automatically
- Sets Mac notifications at 30min and 1.5hr so I don’t forget to shut it down
burst-up # spin up a server and open VS Code
burst-down # delete server, stop billing
burst-ssh # SSH into the server
burst-code # reconnect VS Code if it drops
Full script — drop this into ~/.burst.zsh
burst-up() {
trap 'echo "\nCancelled. Cleaning up..."; hcloud server delete burst 2>/dev/null; hcloud firewall delete burst-fw 2>/dev/null; trap - INT; return 1' INT
echo "Select server type:"
echo ""
echo " Shared x86:"
echo " 1) cx23 - 2 cores, 4GB RAM €0.0077/hr"
echo " 2) cx33 - 4 cores, 8GB RAM €0.0126/hr (default)"
echo " 3) cx43 - 8 cores, 16GB RAM €0.0232/hr"
echo " 4) cx53 - 16 cores, 32GB RAM €0.0436/hr"
echo ""
echo " Shared ARM:"
echo " 5) cax11 - 2 cores, 4GB RAM €0.0087/hr"
echo " 6) cax21 - 4 cores, 8GB RAM €0.0155/hr"
echo " 7) cax31 - 8 cores, 16GB RAM €0.0310/hr"
echo " 8) cax41 - 16 cores, 32GB RAM €0.0611/hr"
echo ""
echo " Dedicated x86:"
echo " 9) ccx13 - 2 cores, 8GB RAM €0.0329/hr"
echo " 10) ccx23 - 4 cores, 16GB RAM €0.0659/hr"
echo " 11) ccx33 - 8 cores, 32GB RAM €0.1261/hr"
echo " 12) ccx43 - 16 cores, 64GB RAM €0.2520/hr"
echo " 13) ccx53 - 32 cores, 128GB RAM €0.5042/hr"
echo " 14) ccx63 - 48 cores, 192GB RAM €0.7562/hr"
echo ""
read "choice?Enter choice [1-14] (default 2): "
case $choice in
1) TYPE="cx23" ;;
2) TYPE="cx33" ;;
3) TYPE="cx43" ;;
4) TYPE="cx53" ;;
5) TYPE="cax11" ;;
6) TYPE="cax21" ;;
7) TYPE="cax31" ;;
8) TYPE="cax41" ;;
9) TYPE="ccx13" ;;
10) TYPE="ccx23" ;;
11) TYPE="ccx33" ;;
12) TYPE="ccx43" ;;
13) TYPE="ccx53" ;;
14) TYPE="ccx63" ;;
*) TYPE="cx33" ;;
esac
echo "Creating server with type $TYPE..."
if ! hcloud server create --type $TYPE --image ubuntu-24.04 --ssh-key mba-key --name burst --location nbg1; then
echo "Failed, trying hel1..."
if ! hcloud server create --type $TYPE --image ubuntu-24.04 --ssh-key mba-key --name burst --location hel1; then
echo "Server creation failed in all locations."
trap - INT
return 1
fi
fi
echo "Waiting for SSH..."
until ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@$(hcloud server ip burst) echo ok &>/dev/null; do sleep 2; done
MY_IP=$(curl -s ifconfig.me)
COOLIFY_IP=$(dig +short coolify.devkas.nl)
hcloud firewall create --name burst-fw
hcloud firewall add-rule burst-fw --direction in --protocol tcp --port 22 --source-ips $MY_IP/32
hcloud firewall add-rule burst-fw --direction in --protocol tcp --port 22 --source-ips $COOLIFY_IP/32
hcloud firewall apply-to-server burst-fw --server burst
echo "Firewall set for $MY_IP and Coolify $COOLIFY_IP"
burst-add-coolify
(sleep 1800 && osascript -e 'display notification "30 minutes elapsed - still running!" with title "Burst Server Reminder" sound name "Hero"') &
(sleep 5400 && osascript -e 'display notification "1.5 hours elapsed - run burst-down to stop billing!" with title "Burst Server Still Running" sound name "Hero"') &
echo "Reminders set for 30min and 1.5 hours"
trap - INT
burst-code
}
burst-down() {
echo "This will delete the burst server and all its resources."
read "confirm?Are you sure? (y/n): "
if [[ $confirm != "y" ]]; then
echo "Cancelled."
return 1
fi
if [ -f ~/.burst_state ]; then
source ~/.burst_state
echo "Removing burst server from Coolify..."
curl -s -X DELETE "$COOLIFY_URL/api/v1/servers/$BURST_SERVER_UUID?force=true" \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
-H "Content-Type: application/json"
rm ~/.burst_state
echo "Server removed from Coolify."
else
echo "No burst server UUID found, skipping Coolify cleanup."
fi
hcloud server delete burst
hcloud firewall delete burst-fw
echo "Server deleted, billing stopped."
}
burst-ssh() {
ssh root@$(hcloud server ip burst)
}
burst-ip() {
hcloud server ip burst
}
burst-code() {
IP=$(hcloud server ip burst)
sed -i '' "s/HostName .*/HostName $IP/" ~/.ssh/config
ssh-keygen -R burst &>/dev/null
ssh-keygen -R $IP &>/dev/null
code --remote ssh-remote+burst /root
}
burst-setup() {
IP=$(hcloud server ip burst)
ssh root@$IP "apt update && apt install -y git curl && curl -fsSL https://claude.ai/install.sh | bash && echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.bashrc && source ~/.bashrc"
echo "Claude Code installed. Logging in..."
ssh -t root@$IP "claude"
}
burst-add-coolify() {
IP=$(hcloud server ip burst)
echo "Adding burst server to Coolify..."
RESPONSE=$(curl -s -X POST "$COOLIFY_URL/api/v1/servers" \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"burst\",
\"ip\": \"$IP\",
\"port\": 22,
\"user\": \"root\",
\"private_key_uuid\": \"$COOLIFY_KEY_UUID\"
}")
echo $RESPONSE | python3 -m json.tool
BURST_SERVER_UUID=$(echo $RESPONSE | python3 -c "import sys,json; print(json.load(sys.stdin)['uuid'])")
echo "export BURST_SERVER_UUID=$BURST_SERVER_UUID" > ~/.burst_state
echo "Server added to Coolify."
}
burst-remove-coolify() {
if [ -f ~/.burst_state ]; then
source ~/.burst_state
echo "Removing burst server from Coolify..."
curl -s -X DELETE "$COOLIFY_URL/api/v1/servers/$BURST_SERVER_UUID?force=true" \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
-H "Content-Type: application/json"
rm ~/.burst_state
echo "Server removed from Coolify."
else
echo "No burst server UUID found, skipping Coolify cleanup."
fi
}Then add this to your .zshrc:
source ~/.burst.zsh
4. The server type menu
When you run burst-up you get a menu like this:
Select server type:
Shared x86:
1) cx23 - 2 cores, 4GB RAM €0.0077/hr
2) cx33 - 4 cores, 8GB RAM €0.0126/hr (default)
3) cx43 - 8 cores, 16GB RAM €0.0232/hr
4) cx53 - 16 cores, 32GB RAM €0.0436/hr
Shared ARM:
10) cax11 - 2 cores, 4GB RAM €0.0087/hr
...
Dedicated x86:
14) ccx13 - 2 cores, 8GB RAM €0.0329/hr
...
Pick a number, hit enter, done.
5. VS Code Remote SSH
The real magic. Install the Remote - SSH extension in VS Code, and burst-code connects VS Code directly to the server. Your editor runs locally, but all the heavy lifting — language servers, extensions, file indexing — happens on the VPS. Your Mac barely notices.
6. Claude Code on the server
After spinning up, run burst-setup to install git and Claude Code on the server, then SSH in and run claude directly. All that RAM usage is now Hetzner’s problem.
What Does It Actually Cost?
A typical 2-hour coding session on a cx33 (4 cores, 8GB RAM):
2 hours × €0.0126/hr = €0.025
That’s two and a half cents. For 8GB of extra RAM for two hours.
Even a full 8-hour day on a dedicated 32GB server (ccx33) costs about €1.
Coolify Integration
I run Coolify on a separate VPS for deploying apps. When I spin up a burst server, it automatically gets added to Coolify as a remote server so I can deploy to it straight away if needed.
The script calls the Coolify API on burst-up to register the server, saves the server UUID, and removes it again on burst-down. No manual clicking in the dashboard.
burst-add-coolify # adds burst server to Coolify (runs automatically on burst-up)
burst-remove-coolify # removes it (runs automatically on burst-down)
This means I can spin up a beefy server, deploy a heavy workload to it via Coolify, and delete the whole thing when I’m done – all without touching a UI.
The Firewall
Every server gets a firewall that only allows SSH from my current IP and my Coolify server:
MY_IP=$(curl -s ifconfig.me)
COOLIFY_IP=$(dig +short [my_vps.domain])
hcloud firewall create --name burst-fw
hcloud firewall add-rule burst-fw --direction in --protocol tcp --port 22 --source-ips $MY_IP/32
hcloud firewall add-rule burst-fw --direction in --protocol tcp --port 22 --source-ips $COOLIFY_IP/32
Combined with burst-down deleting the server when I’m done, there’s basically no attack surface.
The Reminder Notifications
The one thing that would ruin this setup is forgetting to run burst-down. So I added Mac notifications:
- 30 minutes: gentle reminder
- 1.5 hours: more urgent reminder
Both fire automatically when you run burst-up, running in the background. They use macOS’s native notification system with the Hero sound so they’re hard to miss.
Student Tip: Google Cloud Credits
If you have access to Google Cloud student credits (through GitHub Education or your university), you can run this same setup on Google Cloud’s on-demand instances for free. The workflow is identical – spin up, work, delete – just with gcloud instead of hcloud. Google Cloud’s e2-standard-4 (4 cores, 16GB RAM) is a solid equivalent to the cx43 on Hetzner. Worth checking if your school offers it before spending any money at all.
Is It Worth It?
Yes, completely. The setup took an afternoon to get right, but now it’s just three commands:
burst-up # start
# ... do work ...
burst-down # stop
My M1 is happy, I have as much RAM as I need for any task, and I’ve spent maybe €0.50 total on compute so far.
If you’re a student running a lot of dev tools on a limited machine, this is the move.