> ## 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.

# Managing Pods

> Start, stop, restart, resize, and delete your pods.

## Pod Lifecycle

Pods have the following statuses:

| Status      | Description                            |
| ----------- | -------------------------------------- |
| `running`   | Pod is active and accessible           |
| `stopped`   | Pod is shut down but data is preserved |
| `creating`  | Pod is being provisioned               |
| `error`     | Something went wrong during creation   |
| `suspended` | Pod is suspended due to billing issues |

## Start / Stop / Restart

<Tabs>
  <Tab title="Dashboard">
    On the pod detail page, use the action buttons in the header to **Start**, **Stop**, or **Restart** your pod.
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    instapods pods stop my-app
    instapods pods start my-app
    instapods pods restart my-app

    # Wait until the operation completes
    instapods pods start my-app -w
    instapods pods stop my-app -w --timeout 30
    instapods pods restart my-app -w
    ```
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://app.instapods.com/api/pods/my-app/start \
      -H "Authorization: Bearer YOUR_TOKEN"

    curl -X POST https://app.instapods.com/api/pods/my-app/stop \
      -H "Authorization: Bearer YOUR_TOKEN"

    curl -X POST https://app.instapods.com/api/pods/my-app/restart \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>
</Tabs>

<Warning>
  Stopping a pod preserves all files but terminates running processes. Any in-memory data not written to disk will be lost.
</Warning>

## Resize

Change the CPU, memory, or disk allocation of a running pod.

<Tabs>
  <Tab title="CLI">
    ```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.
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://app.instapods.com/api/pods/my-app/resize \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"plan_slug": "build"}'
    ```
  </Tab>
</Tabs>

## Delete

Deleting a pod permanently removes the container and all its data.

<Tabs>
  <Tab title="Dashboard">
    Go to the pod detail page, click the delete button, and confirm.
  </Tab>

  <Tab title="CLI">
    ```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
    ```
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl -X DELETE https://app.instapods.com/api/pods/my-app \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>
</Tabs>

<Warning>
  Deletion is irreversible. All files, databases, and configurations inside the pod will be permanently destroyed. Deleted pod names are reserved for 7 days before they can be reused.
</Warning>

## List Pods

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    instapods pods list
    ```

    Output shows a table with name, preset, plan, CPU, memory, disk, status, and domain.
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl https://app.instapods.com/api/pods \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>
</Tabs>

## Get Pod Details

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    instapods pods get my-app
    ```
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl https://app.instapods.com/api/pods/my-app \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>
</Tabs>

## Reload Application

Restart the application service inside the pod without restarting the container itself. Useful after deploying new code.

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

This restarts different services depending on the preset:

* **Static**: Reloads nginx
* **PHP**: Restarts nginx and PHP-FPM
* **Node.js**: Restarts the `app` systemd service
* **Python**: Restarts the `app` systemd service

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 before restarting the service.
