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

# Pod Management

> Create, manage, and delete pods from the CLI.

## List Pods

```bash theme={null}
instapods pods list
```

Displays a table with name, preset, plan, CPU, memory, disk, status, and domain.

## Create a Pod

```bash theme={null}
instapods pods create my-app -p nodejs
```

The pod name can also be passed as a flag:

```bash theme={null}
instapods pods create --name my-app -p nodejs
```

By default, the CLI **returns immediately** after the API accepts the request. Use `-w` to wait until the pod is fully running before returning.

### Create Flags

| Flag            | Description                                       | Default               |
| --------------- | ------------------------------------------------- | --------------------- |
| `-p, --preset`  | Preset: `static`, `php`, `nodejs`, `python`       | Auto-detected         |
| `-v, --version` | Runtime version (e.g. `8.4`, `22`, `3.11`)        | Preset default        |
| `--plan`        | Plan: `launch`, `build`, `grow`, `scale`, `turbo` | `launch`              |
| `-r, --region`  | Region slug (e.g. `eu-nbg`)                       | Auto-select (closest) |
| `--ssh-key`     | SSH public key or path to key file                | None                  |
| `-w, --wait`    | Wait until pod is running before returning        | `false`               |
| `--timeout`     | Max seconds to wait for pod creation              | `120`                 |

<Note>
  The `--preset` flag is optional. If omitted, the CLI auto-detects the preset from your current directory by looking for signature files like `package.json` (Node.js), `composer.json` (PHP), `requirements.txt` (Python), or `index.html` (Static).
</Note>

### Examples

```bash theme={null}
# Node.js with Build plan
instapods pods create api -p nodejs --plan build

# Python with SSH key
instapods pods create ml-service -p python --ssh-key ~/.ssh/id_ed25519.pub

# Static site in a specific region
instapods pods create my-site -p static -r eu-nbg

# Wait until pod is fully running
instapods pods create my-site -p static -w

# Specific runtime version
instapods pods create my-app -p php --version 8.4

# Custom timeout (5 minutes)
instapods pods create big-app -p nodejs --timeout 300
```

## Get Pod Details

```bash theme={null}
instapods pods get my-app
```

Shows all pod information including status, IP, domain, resources, server, and creation time.

## Start / Stop / Restart

```bash theme={null}
instapods pods start my-app
instapods pods stop my-app
instapods pods restart my-app
```

### Lifecycle Flags

| Flag         | Description                        | Default |
| ------------ | ---------------------------------- | ------- |
| `-w, --wait` | Wait until the operation completes | `false` |
| `--timeout`  | Max seconds to wait                | `60`    |

```bash theme={null}
# Start and wait until running
instapods pods start my-app -w

# Stop with a custom timeout
instapods pods stop my-app -w --timeout 30

# Restart and wait
instapods pods restart my-app -w
```

## Resize

Change a pod's plan (and its associated resources):

```bash theme={null}
instapods pods resize my-app --plan build
```

The `--plan` flag is required. Resources (CPU, memory, disk) are automatically set based on the target plan.

| Flag     | Description                                                         |
| -------- | ------------------------------------------------------------------- |
| `--plan` | Target plan: `launch`, `build`, `grow`, `scale`, `turbo` (required) |

<Warning>
  Downgrades check disk usage — if the pod's current disk usage exceeds the new plan's storage limit, the resize will fail.
</Warning>

## Reload Application

Restart the application services inside the pod:

```bash theme={null}
instapods pods reload my-app
```

What gets restarted depends on the preset:

* **Static**: nginx
* **PHP**: nginx + PHP-FPM
* **Node.js**: `app` systemd service
* **Python**: `app` systemd service

<Tip>
  Reload also auto-detects and installs dependencies. If a `package.json` (Node.js) or `requirements.txt` (Python) is present, `npm install` or `pip install` runs automatically before restarting the service.
</Tip>

## Delete

```bash theme={null}
# With confirmation prompt
instapods pods delete my-app

# Skip confirmation
instapods pods delete my-app -f

# Wait until deletion completes
instapods pods delete my-app -f -w
```

| Flag          | Description                   | Default |
| ------------- | ----------------------------- | ------- |
| `-f, --force` | Skip confirmation prompt      | `false` |
| `-w, --wait`  | Wait until deletion completes | `false` |

<Warning>
  Deletion is permanent. All files, databases, and configurations are destroyed. Deleted pod names are reserved for 7 days to prevent SSH host key conflicts.
</Warning>

## JSON Output

Add `--json` to any command for machine-readable JSON output:

```bash theme={null}
instapods pods list --json
instapods pods get my-app --json
```
