codegraff
Open gateway
Docs/Guides/Move from DigitalOcean to a Codegraff machine

Move from DigitalOcean to a Codegraff machine

A Codegraff machine is a private, always-on Linux machine with nightly verified backups that your own coding agent drives over an API. This page is the whole move: what you get, what is different from a droplet, and a prompt to hand your agent.

What you get

  • One machine: 4 vCPUs, 30 GB RAM, 250 GB disk, Debian, root access. It stays on until you stop it; stopping pauses it with memory and disk kept, and starting resumes it where it was.
  • $284 per month, a flat fee: subscribe from the offer on your dashboard. It pays for the machine itself; nothing goes to your balance. It renews every month; we email you a week before each renewal, and you can cancel any time from the dashboard (the machine runs to the end of the month you paid for).
  • Nightly backups of the whole machine to separate storage. Each one is downloaded again and checked byte for byte, including a filesystem check, before it counts. The newest 7 are kept, and you pay only for what they actually store: $0.021 per GB per month (a fresh machine backs up to about 0.3 GB).
  • Claude Code, Codex, graff, Cursor, Grok, Devin, OpenCode and Hermes can be installed and kept up to date on it, and it can show up in Harness as one of your devices. Ask us and we set that up.

What is different from a droplet

Check these before you move

  • Public traffic is HTTPS, to any port. Turn it on with POST /v1/machines/{id}/inbound and the machine answers at https://m-<id>.preview.codegraff.com (port 80) and https://m-<id>-<port>.preview.codegraff.com (any other port), with HTTPS handled for you. It carries HTTP and websockets; raw TCP such as SSH or a database port is not reachable from the internet.
  • No systemd and no cron. Run services as background processes (supervisord, or a start script) and scheduled jobs as a small loop. Your agent sets this up as part of the move.
  • Commands over the API stop after 60 seconds. Long work runs in the background and is checked on; your agent handles this.

The move, step by step

  1. Pay the machine offer on your Codegraff dashboard. That pays for the machine for the month.
  2. On the Codegraff dashboard, create an API key with the sandbox and api scopes, and give it to your agent as CODEGRAFF_API_KEY.
  3. Give your agent the prompt below. It looks at the droplet first and tells you its plan before it creates anything.
  4. Check what it shows you, side by side with the droplet.
  5. Shut the droplet down yourself once you are happy. Keep it until then.

Prompt for your agent

Copy this into Codegraff, Claude Code, Codex or whichever agent you use. It needs SSH access to the droplet and the API key above.

code
You are moving my DigitalOcean droplet to a persistent Codegraff machine. Work carefully, ask me before anything that costs money or deletes anything, and never touch the droplet beyond reading from it.

Codegraff machine API: https://gateway.codegraff.com, header "Authorization: Bearer $CODEGRAFF_API_KEY" (a cg_sk_ key with the sandbox and api scopes). Every POST that changes state (quotes, create, start, stop, backups, delete) needs an "Idempotency-Key: <new UUID>" header; reuse the same key only to retry the same request. JSON bodies.
- GET  /v1/machine-plans                          plans and prices
- POST /v1/machine-quotes  {"cpu":4,"memoryGiB":30,"diskGiB":250,"termSeconds":2592000,"billingMode":"monthly","backup":true,"name":"..."}
- POST /v1/machines        {"quoteId":"...","acceptedTotalMicroUsd":<quote totalMicroUsd>,"acceptedStoragePriceId":"<quote backupBilling.priceId>"}
                           answers 202 while it boots and takes its first verified backup: poll GET /v1/machines/{id} until "state" is "ready"
- POST /v1/machines/{id}/exec      {"command":"...","cwd":"/root","timeoutSeconds":60}   (60 s max: run longer work with setsid nohup ... > log 2>&1 & and poll the log)
- POST /v1/machines/{id}/upload    {"path":"/root/x","contentBase64":"..."}   (1 MB per call)
- POST /v1/machines/{id}/download  {"path":"/root/x"}
- POST /v1/machines/{id}/stop | /start      pause / resume (memory and disk kept)
- POST /v1/machines/{id}/backups   take a backup now (202, about a minute); GET /v1/machines/{id}/backups lists them
- POST /v1/machines/{id}/inbound   {"enabled":true}   publish the machine: port 80 at inbound.url, any other port at inbound.urlForPort
- POST /v1/machines/{id}/harness   {}   make the machine my Harness device (installs Harness, graff and a daily updater; safe to repeat). With a key that has GitHub access and GitHub connected on Codegraff, git and gh on the machine also reach my repositories with short-lived tokens; {"github":false} leaves that out
- GET /v1/machines/{id}/vitals     CPU, memory, disk, load and uptime right now
- DELETE /v1/machines/{id}         only if I ask

The machine: Debian, 4 vCPUs, 30 GB RAM, 250 GB disk, root. It reaches the internet, and the internet reaches it over HTTPS once inbound is on: https://m-<id>.preview.codegraff.com goes to port 80 on the machine and https://m-<id>-<port>.preview.codegraff.com to any other port (TLS is handled for you; apps listen on plain HTTP; point my domains at an address with a CNAME only when I say so). Raw TCP (SSH, a database port) is not reachable from the internet, only HTTP and websockets. There is no systemd and no cron: run services as background processes (a supervisor such as supervisord, or setsid nohup) and scheduled jobs as a small loop. It is backed up every night; a stop/start keeps running processes, but write a /root/start-services.sh that brings everything up from scratch and test it.

Steps:
1. Inventory the droplet over SSH (read only): OS and packages, running services (systemctl list-units --type=service --state=running), timers and crontabs (crontab -l, /etc/cron.d, systemctl list-timers), Docker containers and volumes, databases (Postgres, MySQL, Redis, SQLite files) and their sizes, application directories, disk usage, listening ports (ss -ltnp), domains pointing at it, and any secrets/env files the apps need.
2. Tell me what you found and a plan: what moves as is, what needs changing (systemd units, cron, anything that must accept traffic from the internet), how long the copy will take, and what you will verify. Wait for my OK.
3. With my OK, quote and create the machine: a monthly 4 vCPU / 30 GB / 250 GB machine is covered by the month I already paid for, so it costs nothing more. Wait for "ready".
4. On the machine, create an SSH key (ssh-keygen -t ed25519 -N "" -f /root/.ssh/do_migrate), print the public key, and ask me to add it to the droplet's authorized_keys (or add it yourself if I say so). Then pull data FROM the droplet with rsync -aHAX --numeric-ids over SSH, application files first, then consistent database dumps (pg_dump/mysqldump), never a live database's files.
5. Install the same packages and runtimes, restore databases, put secrets and config in place, and start the services with /root/start-services.sh plus a loop for each former cron job.
6. Verify against the droplet: file counts and checksums for the data, row counts per table, each service answering locally, scheduled jobs running. Show me the comparison.
7. Take a backup (POST /v1/machines/{id}/backups) and confirm it appears. Remove the migration key from the droplet. Do not shut down or delete the droplet: I will do that after I have checked.

After the move

  • Your agent can keep using the same API: run commands, move files, stop and start, take a backup before a risky change.
  • Backups run every night by themselves. If you ever need one restored, ask us: we bring it back as a separate machine first, so nothing overwrites your running one.
  • Billing shows on your dashboard: the month as one line, backup storage as small daily amounts.