---
title: Configure a compute session
slug: configure-a-compute-session
createdAt: 2026-11-25T00:13:10.598Z
---

A compute session runs any container image on a rented machine. This guide covers every start parameter: disk, environment, ports, commands, startup scripts, SSH, the file manager and apps.

## Parameters

| Field            | CLI flag           | Meaning                                                                                                          | Default                               |
| ---------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `node_number`    | `--node`           | Machine from the listing. **Required**                                                                           |                                       |
| `image`          | `--image`          | Container image, for example `ubuntu:24.04`, `pytorch/pytorch:latest`. **Required**                              |                                       |
| `disk_size`      | `--disk`           | Disk in GB, charged per GB per hour                                                                              | `1`                                   |
| `envs`           | `-e KEY=VALUE`     | Environment variables: up to 64; names of letters, digits and `_`, not starting with a digit; values up to 4 KiB | none                                  |
| `ports`          | `--ports`          | TCP/UDP container ports to expose on the node's public IP. Port 22 is always exposed                             | none                                  |
| `http_ports`     | `--http-ports`     | HTTP container ports to expose with a public URL, up to 10. 7681 and 7682 are reserved                           | none                                  |
| `entrypoint`     | `--entrypoint`     | Replaces the image's `ENTRYPOINT`; one line, up to 4 KiB                                                         | the image's                           |
| `args`           | `--args`           | Replaces the image's `CMD`; one line, up to 4 KiB                                                                | the image's                           |
| `startup_script` | `--startup-script` | Script run as root once the container is up, up to 64 KiB                                                        | none                                  |
| `ssh`            | `--ssh`            | SSH access and a web terminal                                                                                    | the app's setting, off without an app |
| `fm`             | `--fm`             | Web file manager, **without a login**                                                                            | the app's setting, off without an app |
| `app`            | `--app`            | Application UUID from `GET /compute/apps`                                                                        | none                                  |

Unknown fields are rejected with `400`, so a typo cannot silently fall back to a default.

## Disk

Allocate enough for the image, your data and outputs: the default 1 GB is only enough for small images. Storage is charged per GB per hour (`storage_price`), so do not over-allocate either.

```bash
octa compute start --node 7KQ4-M2XD-4 --image pytorch/pytorch:latest --disk 100 --ssh --wait
```

## Environment variables

```bash
octa compute start --node 7KQ4-M2XD-4 --image python:3.12 \
  -e MODEL=llama-3.1-8b -e HF_TOKEN="$HF_TOKEN" --wait
```

```json
{ "envs": { "MODEL": "llama-3.1-8b", "HF_TOKEN": "hf_..." } }
```

:::BlockQuote
Variables are visible in the session info (`envs`). Anyone with your API key can read them; do not use a key you share with others for sessions that hold secrets.
:::

## Commands: entrypoint and args

`entrypoint` and `args` replace the image's `ENTRYPOINT` and `CMD`. They are split like a shell command line, but **nothing is expanded**: no `$VAR`, no `*`, no `&&`. For any of that, run a shell:

```bash
octa compute start --node 7KQ4-M2XD-4 --image python:3.12 \
  --entrypoint "sh -c" --args "'pip install -r requirements.txt && python app.py'"
```

```json
{ "entrypoint": "sh -c", "args": "\"pip install -r requirements.txt && python app.py\"" }
```

:::BlockQuote
**The session lives as long as its main process.** When the command exits, the session stops and its data is gone. For an interactive machine, keep it alive: `--entrypoint "sh -c" --args "'sleep infinity'"`, or use an image that runs a long-lived process.
:::

## Startup script

A startup script runs as root once the container is up, in addition to the main process. Use it to install packages or prepare data without building a custom image. Its output goes to `/var/log/onstart.log` inside the container.

```bash
cat > onstart.sh <<'EOF'
apt-get update && apt-get install -y htop git
git clone https://github.com/example/project /workspace/project
EOF

octa compute start --node 7KQ4-M2XD-4 --image ubuntu:24.04 \
  --startup-script @onstart.sh --ssh --wait
```

It runs with bash when the image has it, with sh otherwise.

## Ports and URLs

- `ports` exposes TCP/UDP ports on the node's public IP. The session's `ports` field maps each container port to the public port: `{"6006": 40123}` means `public_ip:40123`.
- `http_ports` gives each HTTP port a public URL. The session's `urls` field maps each port to its URL.

```bash
octa compute start --node 7KQ4-M2XD-4 --image jupyter/base-notebook \
  --http-ports 8888 --wait
octa sessions info <uuid> -o json | jq .urls
```

:::BlockQuote
Exposed ports and URLs are public. Protect the service behind them (a password, a token) as you would on any server on the internet.
:::

## SSH and the web terminal

With `ssh: true` the session gets SSH access and a web terminal. Setting it up takes a little extra time at start; if it fails, the session stops.

| Field        | Contains                                                                                  |
| ------------ | ----------------------------------------------------------------------------------------- |
| `ssh.direct` | Straight to the node. Set only when your account has an SSH key (add it in the dashboard) |
| `ssh.proxy`  | Through the OctaSpace proxy                                                               |
| `ssh.web`    | Web terminal URL. It contains credentials: keep it private                                |

You log in as the image's `USER` (with sudo), or root when the image sets none.

```bash
octa compute connect <uuid>           # direct, falling back to the proxy
octa compute connect <uuid> --proxy
```

## File manager

`fm: true` starts a web file manager. It has **no login**: whoever has the URL has your files. Turn it on only when you need it, and never share the URL.

## Apps

An app is a ready-made image with recommended settings: ports, SSH, file manager, minimum disk.

```bash
curl -s https://api.octa.space/compute/apps -H "Authorization: Bearer $OCTA_API_KEY" \
  | jq -r '.[] | [.uuid, .name, .image] | @tsv'
```

Pass the app's `uuid` as `app`, and its `image`. The app's settings decide SSH and the file manager unless you set them explicitly (`ssh: false` turns off SSH that an app enables).

```javascript
const apps = await client.compute.apps()
const app = apps.find((a) => a.name === 'Ubuntu 24.04 LTS')
await client.compute.start({
  node_number: '7KQ4-M2XD-4',
  app: app.uuid,
  image: app.image,
  disk_size: app.extra?.min_disk_size ?? 10,
})
```

`extra.min_disk_size` is a recommendation, not enforced: with less disk the app may run out of space.

## Restart with new parameters

A restart recreates the container on the same node, keeping the session, its UUID and prices.

```bash
octa compute restart <uuid>                                # same parameters
octa compute restart <uuid> --replace --disk 100 --ssh \
  --entrypoint "sh -c" --args "'python app.py'"            # new parameters
```

New parameters **replace** the old ones completely: anything you leave out goes back to its default (1 GB disk, no variables, no ports, no SSH). Pass the full set. The node, image and app cannot change. A session can be restarted once in 5 minutes and 6 times an hour.
