> For the complete documentation index, see [llms.txt](https://docs.p0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p0.dev/p0-cli/p0-commands-and-usage/p0-file-transfer.md).

# p0 file-transfer

### **Overview** <a href="#overview" id="overview"></a>

The `p0 file-transfer` command copies a local file to an AWS EC2 instance. In a single command, P0 requests just-in-time access, uploads the file to a temporary S3 staging bucket, connects to the instance over SSH, and has the instance download the file from the bucket with `curl`.

For setup, the full transfer flow, and troubleshooting, see the [File Transfer integration guide](/integrations/resource-integrations/file-transfer/transferring-files.md).

***

### **Prerequisites** <a href="#prerequisites" id="prerequisites"></a>

* **Logged-in user**

```plaintext
p0 login <org-slug>
```

* The File Transfer integration installed for the target AWS account. See [Transfer a file to an instance](/integrations/resource-integrations/file-transfer/transferring-files.md) for setup.

***

### **Syntax** <a href="#syntax" id="syntax"></a>

```plaintext
p0 file-transfer <source> <destination> [options]
```

***

### **Positional Arguments** <a href="#positional-arguments" id="positional-arguments"></a>

| Argument    | Description                                                                                |
| ----------- | ------------------------------------------------------------------------------------------ |
| source      | Path to the local file to transfer. Must point to a regular file.                          |
| destination | Instance ID or name of the target EC2 instance — the same identifier you use for `p0 ssh`. |

***

### **Options** <a href="#options" id="options"></a>

| Flag             | Type    | Description                                                                           |
| ---------------- | ------- | ------------------------------------------------------------------------------------- |
| --reason \<text> | string  | The reason you need access. Approvers see this when they review the request.          |
| --debug          | boolean | Print debug information, such as the download URL's expiry and underlying AWS errors. |

***

### **Examples** <a href="#examples" id="examples"></a>

Transfer a local `config.yaml` to instance `i-1234567890abcdef0`:

```plaintext
p0 file-transfer ./config.yaml i-1234567890abcdef0 --reason "Deploy updated config"
```

P0 prompts you through approval, uploads the file, and downloads it to your home directory on the instance, at `/home/<your-username>/config.yaml`.

***

### **Related** <a href="#related" id="related"></a>

* [Transfer a file to an instance](/integrations/resource-integrations/file-transfer/transferring-files.md) — full transfer flow and troubleshooting.
* [p0 scp](/p0-cli/p0-commands-and-usage/p0-scp.md) — copy files over SSH for smaller transfers or remote-to-local copies.
