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

# Run Sleekcode in an isolated container

> Run Sleekcode and your coding agent inside Docker, behind a proxy that lets the container reach only the hosts you allow.

For the strongest isolation, run Sleekcode and your coding agent inside a Linux container. The container gets no direct internet access. Everything goes through a proxy that lets requests through only to the hosts on your list: Sleekplan, your AI provider and your git host. The agent can't see your computer's files, can't use your computer's logins, and can't reach any other site.

> [!NOTE]
>
> This setup is optional, for teams that want a hard boundary around the agent. You need Docker: Docker Desktop on macOS or Windows, or Docker Engine with the Compose plugin on Linux. Plan for a few gigabytes of disk space.

## How it works

The setup has three containers on a private Docker network that has no route to the internet:

| Container | What it does | Network |
| - | - | - |
| `desktop` | A Linux desktop that you open in your browser, with Sleekcode, git, the GitHub CLI and your coding agent | The private network only |
| `proxy` | A Squid proxy that lets requests through only to the hosts in `allowed-domains.txt` | The private network and the internet |
| `viewer` | Forwards `http://localhost:3000` on your computer to the desktop | The private network and your computer |

Programs in the desktop send their requests to the proxy. A program that ignores the proxy gets no connection at all, because the private network has no way out.

## Before you start

* **Docker 28 or later.** Docker Desktop, or Docker Engine with the Compose plugin. Check with `docker version`: the setup needs version 28 to keep the desktop away from your computer's own services.
* **An x64 computer, server or virtual machine.** Sleekcode for Linux is built for x64 only. On a Mac with Apple silicon, Docker would have to emulate x64, and the desktop doesn't run reliably that way.
* **A git token for only the repositories the agent works on.** On GitHub, create a fine-grained personal access token that has access to just those repositories, with **Contents** and **Pull requests** set to **Read and write**. The agent can reach anything this token can, so keep it narrow.
* **Your coding agent's sign-in**: your Claude subscription, ChatGPT plan or API key.

## Step 1: Create the files

Create a folder, for example `sleekcode-container`, with these four files.

```yaml compose.yaml theme={"system"}
name: sleekcode

services:
  desktop:
    build: .
    platform: linux/amd64
    shm_size: "1gb"
    security_opt:
      - no-new-privileges:true
    environment:
      PUID: "1000"
      PGID: "1000"
      TZ: Etc/UTC
      # Electron's own sandbox can't start inside a container
      ELECTRON_DISABLE_SANDBOX: "1"
      # the only way out is the proxy; loopback stays direct for Sleekcode's local channel
      http_proxy: http://proxy:3128
      https_proxy: http://proxy:3128
      no_proxy: localhost,127.0.0.1,::1
      HTTP_PROXY: http://proxy:3128
      HTTPS_PROXY: http://proxy:3128
      NO_PROXY: localhost,127.0.0.1,::1
      # Claude Code: no telemetry, no self-updates (rebuild the image to update)
      DISABLE_TELEMETRY: "1"
      DISABLE_AUTOUPDATER: "1"
    volumes:
      - home:/config
    networks:
      - sandbox
    restart: unless-stopped

  proxy:
    build:
      context: .
      dockerfile_inline: |
        FROM ubuntu:24.04
        RUN apt-get update && apt-get install -y --no-install-recommends squid && rm -rf /var/lib/apt/lists/*
        # a PID file left from the last run would make Squid think it's already running
        CMD ["sh", "-c", "rm -f /run/squid.pid && exec squid -N -d 1"]
    volumes:
      - ./squid.conf:/etc/squid/squid.conf:ro
      - ./allowed-domains.txt:/etc/squid/allowed-domains.txt:ro
    networks:
      - sandbox
      - outside
    restart: unless-stopped

  viewer:
    build:
      context: .
      dockerfile_inline: |
        FROM alpine:3.20
        RUN apk add --no-cache socat
    command: ["socat", "TCP-LISTEN:3000,fork,reuseaddr", "TCP:desktop:3000"]
    ports:
      - "127.0.0.1:3000:3000"
    networks:
      - sandbox
      - outside
    restart: unless-stopped

networks:
  sandbox:
    internal: true
    driver_opts:
      # no address for your computer on this network, so the desktop can't reach its services
      com.docker.network.bridge.gateway_mode_ipv4: isolated
  outside: {}

volumes:
  home: {}
```

```dockerfile Dockerfile theme={"system"}
FROM lscr.io/linuxserver/webtop:ubuntu-xfce

# Sleekcode, git and the GitHub CLI: the container can't download anything later
RUN apt-get update \
 && apt-get install -y --no-install-recommends curl git gh nodejs \
 && curl -fsSL -o /tmp/sleekcode.deb https://download.sleekplan.com/sleekcode/Sleekcode-linux.deb \
 && apt-get install -y /tmp/sleekcode.deb \
 && rm -rf /tmp/sleekcode.deb /var/lib/apt/lists/*

# Your coding agent: keep the line for the one you use
RUN npm install -g @anthropic-ai/claude-code
# RUN npm install -g @openai/codex
# RUN npm install -g opencode-ai

# No root for the agent: the desktop user loses its passwordless sudo
RUN gpasswd -d abc sudo
```

```text squid.conf theme={"system"}
# Lets requests through only to the hosts in allowed-domains.txt
http_port 3128
visible_hostname sleekcode-proxy

acl allowed dstdomain -n "/etc/squid/allowed-domains.txt"
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 443
acl CONNECT method CONNECT

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow allowed
http_access deny all

cache deny all
```

```text allowed-domains.txt theme={"system"}
# One host per line. A leading dot also allows every subdomain.
# List a host only once, with or without the dot: listing both stops Squid.

# Sleekplan, and the bot check on its sign-in page
api.sleekplan.com
app.sleekplan.com
download.sleekplan.com
challenges.cloudflare.com

# Claude Code
api.anthropic.com
claude.ai
claude.com
platform.claude.com

# Codex: remove the # if you use it
# auth.openai.com
# chatgpt.com
# api.openai.com

# OpenCode: remove the # if you use it, and add your provider's API host
# opencode.ai
# models.opencode.ai

# GitHub
github.com
api.github.com

# GitLab: remove the # if you use it
# gitlab.com
```

Change the agent in the `Dockerfile` and its hosts in `allowed-domains.txt` if you don't use Claude Code. [Hosts to allow](#hosts-to-allow) lists them.

## Step 2: Start the containers

In the folder, run:

```bash theme={"system"}
docker compose up -d --build
```

The first build downloads the desktop and takes a few minutes. Later starts take seconds.

## Step 3: Open the desktop

Open [http://localhost:3000](http://localhost:3000) in your browser. A Linux desktop appears. The port listens only on `127.0.0.1`, so no other computer can open it.

To open a terminal in the desktop, choose **Applications → Terminal Emulator** in the top bar.

## Step 4: Sign in to your git host

In the desktop's terminal, sign in to the GitHub CLI with the token you created:

```bash theme={"system"}
gh auth login
```

Choose **GitHub.com**, then **HTTPS**, let it authenticate git with your GitHub credentials, and choose **Paste an authentication token**. git and the agent now use this token, and nothing else from your computer.

## Step 5: Clone the repositories

Clone the repositories the agent works on, over HTTPS:

```bash theme={"system"}
mkdir -p ~/repos && cd ~/repos
git clone https://github.com/your-org/your-repo.git
```

git over SSH doesn't work in this setup: the proxy only lets HTTPS through.

## Step 6: Sign in to your coding agent

> [tab] Claude Code
>
> Run `claude` in the terminal and choose how to sign in. The Claude sign-in page needs more hosts than this setup allows, so open the link the terminal shows in the browser on your own computer instead. Sign in there, then paste the code you get into the terminal, where it says **Paste code here if prompted**.

> [tab] Codex
>
> Run `codex login --device-auth`. Open the link it shows in any browser, even on your own computer, and enter the code.

> [tab] OpenCode
>
> Run `opencode auth login`, choose your provider and paste your API key. Add the provider's API host to `allowed-domains.txt`.

## Step 7: Start Sleekcode and sign in

**1. Start Sleekcode**

In the desktop, choose **Applications → Development → Sleekcode**.

**2. Sign in**

Click **Sign in with Sleekplan**. The desktop's browser opens Sleekplan. Sign in, choose the workspace and click **Connect**.

**3. Add the repositories**

In Sleekcode's **Settings**, under **Repositories**, click **Choose folder** and pick the clones in `repos` in the home folder. Under **Agents**, click **Check again** and make sure your agent shows **Signed in**.

The container has no keyring, so Sleekcode shows **Your system has no keyring. Sign in again after each restart.** After the container restarts, open the desktop and sign in to Sleekcode again. Your settings, repositories and the agent's sign-in stay.

[Install and connect](https://sleekplan.com/help/sleekcode/install.md) explains the rest of Sleekcode's setup.

## Step 8: Check that the lock works

In the desktop's terminal, try a site that isn't on your list:

```bash theme={"system"}
curl -sS https://example.com
```

The proxy refuses it, and curl reports `CONNECT tunnel failed, response 403`. Try `https://api.sleekplan.com` the same way, and you get an answer.

## Use it every day

### Start and stop

```bash theme={"system"}
docker compose stop
docker compose start
```

Your sign-ins, repositories and settings live in the `home` volume and survive a stop. After a start, sign in to Sleekcode again.

### See what the proxy blocked

```bash theme={"system"}
docker compose exec proxy tail -f /var/log/squid/access.log
```

A blocked request shows up with `TCP_DENIED/403` and its host, for example `TCP_DENIED/403 3403 CONNECT example.com:443`. When the agent fails because it can't reach something, look here first.

Some blocked requests are expected. The desktop's browser tries Google services, and Sleekplan's sign-in page loads fonts and analytics. None of them are needed.

### Allow another host

Add the host to `allowed-domains.txt`, then reload the proxy:

```bash theme={"system"}
docker compose exec proxy sh -c "squid -k parse && squid -k reconfigure"
```

`squid -k parse` checks the list first, so a mistake doesn't stop the proxy. Hosts you might add: your package registry, such as `registry.npmjs.org` for npm or `pypi.org` and `files.pythonhosted.org` for Python, your company's own git server, or your AI provider's API host.

### Update Sleekcode and your agent

Sleekcode and the agent are part of the image, so you update them by rebuilding it:

```bash theme={"system"}
docker compose build --no-cache desktop
docker compose up -d
```

The `home` volume keeps your sign-ins, repositories and settings.

### Remove everything

```bash theme={"system"}
docker compose down -v
```

This deletes the containers and the `home` volume, with the sign-ins and repositories inside.

## Hosts to allow

| Service | Hosts | Needed for |
| - | - | - |
| Sleekplan | `api.sleekplan.com` | Sleekcode's sign-in, work items and reports |
| | `app.sleekplan.com` | Signing in to Sleekplan in the desktop's browser |
| | `challenges.cloudflare.com` | The bot check on Sleekplan's sign-in page |
| | `download.sleekplan.com` | Update checks |
| Claude Code | `api.anthropic.com`, `claude.ai`, `claude.com`, `platform.claude.com` | The model, and keeping the Claude sign-in fresh |
| Codex | `auth.openai.com`, `chatgpt.com` | Signing in with ChatGPT, and the model on a ChatGPT plan |
| | `api.openai.com` | The model with an API key |
| OpenCode | `opencode.ai`, `models.opencode.ai` | OpenCode's model list |
| | Your provider's API host | The model |
| GitHub | `github.com`, `api.github.com` | Clone and push, and pull requests with `gh` |
| GitLab | `gitlab.com` | Clone, push and merge requests |

Git LFS, package registries and your company's own servers need their own entries. The proxy's log shows the exact host.

## What this protects, and what it doesn't

This setup protects you against an agent that's been steered, by a post or by anything else it reads:

* It can't reach any host that isn't on your list, so it can't send your code or secrets elsewhere, or fetch code from other sites. Names of other hosts don't even resolve, so nothing leaks through DNS lookups.
* It can't reach services on your own computer, such as a local database: the private network has no address for your computer.
* It can't read the files on your computer, only what's inside the container.
* It can't use your computer's logins. The container has its own, with only the access you gave them.
* It can't become root in the container: `sudo` is gone, and `no-new-privileges` stops programs from raising their rights.

What it can't do:

* **It can't tell good from bad on an allowed host.** The proxy sees host names, not paths. If `github.com` is allowed, the agent can reach every repository there that its token can reach. A narrow token is what limits that.
* **It doesn't change what your AI provider receives.** The agent still sends what it works on to your AI provider, under your account.
* **It doesn't stop tools that run on your AI provider's side**, such as a web search the provider runs for the agent.

Even in the container, **Allow everything** lets the agent run any command on what the container holds, including your repositories and the logins inside. **Auto** keeps the agent's own safety checks on.

## Related

> [card] [Security and privacy](https://sleekplan.com/help/sleekcode/security.md)
>
> What Sleekcode sends to Sleekplan, and what never leaves your computer.

> [card] [Install and connect](https://sleekplan.com/help/sleekcode/install.md)
>
> Sleekcode's setup, step by step.


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