Skip to content

How-to guides

How to set up a cloud development environment

Create a Linux machine in the cloud, put your repository and its tools on it, and connect an editor to it.

Updated · Facts checked · By Runtime Cloud

3 min read

Read as Markdown

A cloud development environment replaces "it works on my laptop" with one machine that has the right versions, that a new teammate can open in minutes, and that keeps running a long build after you close the lid. Setting one up comes down to four decisions:

  1. Size. CPU, memory and disk for your heaviest task: a full build, a test suite, an IDE's language server.
  2. Setup. How the repository, packages and services get onto the machine: a script, a Dockerfile, or a prepared image.
  3. Editor. VS Code in the browser, or a local editor over SSH.
  4. Idle time. What happens when nobody is working, and what it costs.

On Runtime, a dev environment is a Linux machine with VS Code in the browser already running on port 8080 over /workspace. You size it, name it, and reach it through a private HTTPS preview, and when nobody uses it, it pauses with its memory kept: open terminals, running servers and the editor's state come back as they were. (Dev environments)

Create it once, by name

getOrCreate with a name makes the environment the first time, and returns the same one on every later call. This script creates it at 4 vCPU, 8 GB of memory and 16 GB of disk, clones a repository, installs its packages, and prints a link to VS Code:

TerminalAPI=https://api.withruntime.comAUTH="Authorization: Bearer $RUNTIME_API_KEY"JSON="Content-Type: application/json"ws=$(curl -sf -X POST "$API/v2/workspaces" -H "$AUTH" -H "$JSON" -d '{  "name": "my-dev",  "getOrCreate": true,  "vcpu": 4,  "memoryGB": 8,  "diskGB": 16,  "idlePauseSeconds": 1800}')id=$(echo "$ws" | jq -r .id)# Put the project in /workspace and install what it needs.curl -sf -X POST "$API/v2/workspaces/${id}:exec" -H "$AUTH" -H "$JSON" -d '{  "cmd": "cd /workspace && { [ -d express ] || git clone --depth 1 https://github.com/expressjs/express; } && cd express && npm install --no-audit --no-fund"}' | jq -r .exitCode# Share VS Code's port, 8080, with a private preview and print the link.preview=$(curl -sf -X POST "$API/v2/sandboxes/${id}/previews" -H "$AUTH" -H "$JSON" \  -d '{"port": 8080}')echo "$(echo "$preview" | jq -r .url)?folder=/workspace/express&runtime_preview_token=$(echo "$preview" | jq -r .token)"

Set the sizes in the request rather than relying on a default, so the environment is the same for everyone who runs the script. Run it again tomorrow and it returns the same machine, with the clone and node_modules already there.

Keep a server running between sessions

Start long-running processes with "wait": false. The call returns at once and the process keeps running:

Terminalcurl -s -X POST "$API/v2/workspaces/${id}:exec" -H "$AUTH" -H "$JSON" -d '{  "cmd": ["node", "-e", "require(\"http\").createServer((q, s) => s.end(\"hi\")).listen(3000)"],  "wait": false}' | jq -r .state# running

A pause keeps that process in memory. After a pause and a resume, the same server still answers on port 3000, without being started again. To reach it from your browser, give port 3000 a preview of its own (share a port).

Connect a local editor instead

VS Code Remote - SSH and JetBrains Gateway can open the same kind of machine from your desktop. See use VS Code Remote - SSH and use JetBrains Gateway. For what a remote environment is and when it helps, see what is a remote development environment?.

Give every developer their own

Run the same script with a different name per person, my-dev-alice, my-dev-bob, and each gets an isolated machine with its own kernel, disk and network. Each one pauses when its owner stops working (per-user dev environments).

Delete it

Terminalcurl -s -X DELETE "$API/v2/workspaces/${id}" -H "$AUTH" | jq -r .state# deleted

Deleting removes the machine and its disk. Push your branches first.

Facts on this page were checked on 17 November 2026.

Cut your cloud billby 66%.

7 days of Pro for $0, and no card to sign up. Billed by the second after.

Start your free trial