> ## Documentation Index
> Fetch the complete documentation index at: https://docs.microsandbox.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# code-server

> Open an isolated VS Code workspace in the browser

Run VS Code in a disposable microVM when you want an editable Linux workspace without installing its tools or extensions on the host. The project is copied into the sandbox, so edits stay isolated until you explicitly copy them back.

Local-only (This guide publishes code-server to a port on the computer running the CLI, which is not available on microsandbox cloud.)

## Use the editor

**1. Start the editor**

```sh macOS & Linux theme={null}
msb run -d --name code-server-demo --replace \
  --cpus 2 --memory 2G --root-disk 4G \
  -p 127.0.0.1:8080:8080 \
  --entrypoint code-server \
  codercom/code-server:4.130.0 -- \
    --bind-addr 0.0.0.0:8080 \
    --auth none \
    /home/coder/project
```

```powershell Windows theme={null}
msb run -d --name code-server-demo --replace `
  --cpus 2 --memory 2G --root-disk 4G `
  -p 127.0.0.1:8080:8080 `
  --entrypoint code-server `
  codercom/code-server:4.130.0 -- `
    --bind-addr 0.0.0.0:8080 `
    --auth none `
    /home/coder/project
```

The host port is bound to `127.0.0.1`, so the unauthenticated editor is reachable only from the local machine.

**2. Add a project**

Replace `./my-project` with the directory you want to edit:

```sh Shell theme={null}
msb cp ./my-project/. code-server-demo:/home/coder/project
msb exec -u root code-server-demo -- chown -R coder:coder /home/coder/project
```

Open [http://127.0.0.1:8080](http://127.0.0.1:8080). The editor, terminal, extensions, and project commands all run inside the microVM.

> [!WARNING]
>
> Keep the host bind on `127.0.0.1`. Do not expose an editor with `--auth none` to a LAN or public interface.

**3. Check the service**

```sh macOS & Linux theme={null}
curl -fsSI http://127.0.0.1:8080/ | head -n 1
```

```powershell Windows theme={null}
curl.exe -fsSI http://127.0.0.1:8080/ | Select-Object -First 1
```

A healthy server responds with an HTTP status line, usually a redirect into the workspace.

**4. Copy changes back**

Export the edited project into a new host directory:

```sh Shell theme={null}
msb cp code-server-demo:/home/coder/project ./code-server-output
```

Review `code-server-output` before merging its changes into the original checkout.

**5. Clean up**

```sh Shell theme={null}
msb rm -f code-server-demo
```

## Reference

* [code-server documentation](https://coder.com/docs/code-server)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.