# deploy()

Canonical URL: https://developers.iagenify.com/sdk/ref/host/deploy/
Language: en

`host.deploy({ files, code?, server? }) → Promise<Deploy>`

Puts files online. A folder path under Node, a list anywhere — and nothing secret ever goes, with what was dropped reported.

Status: POST · 20 000 files · 25 MB each · secrets never ship

```javascript
await site.deploy({ files: "./out" });                               // Node: a folder
await site.deploy({ files: [{ path: "index.html", content: html }] }); // anywhere
await app.deploy({ files: "./build", server: "server/index.js" });
await fn.deploy({ code: "export default { async fetch(request) { … } }" });
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `files` | string | array |  | A folder path (Node), or `[{ path, content }]`. `content` takes text or bytes. |
| `server` | string |  | For an `app`: the server module inside that folder. |
| `code` | string |  | For a `function`: the module itself. |

## Nothing secret ships, and what was dropped is said {#never}

| Dropped | Why |
| --- | --- |
| `.env` and its variants | Credentials, served publicly. |
| `.git/` | The whole history, including what was removed from it. |
| `node_modules/` | Enormous, and not what is served. |

> **Dropping them quietly would be worse than not dropping them**
>
> The answer lists what was skipped. Somebody who meant to deploy a file named like one of these learns it did not go, rather than wondering later why the page is missing.

## An app's server module is not one of its files {#server}

> **It is pulled out of the assets**
>
> An asset is served publicly, so leaving the server module among them would publish the application's source on its own site. It ships as the module instead — and no wrapper is needed, since assets are served first and the module only gets what they do not cover.

## The bounds, imposed before anything is sent {#bounds}

| Thing | Bound |
| --- | --- |
| Files per deploy | 20 000 |
| One file | 25 MB |
| A function's code | 10 MB |

Checked here rather than discovered at the far end, so a deploy that cannot work fails before the bytes travel.

## A deploy replaces the set {#replaces}

It is not additive: a file that was online and is not in this deploy is gone. That is also why a [rollback](/sdk/ref/host/rollback) is a complete return rather than a patch.

## A path cannot leave the root {#paths}

Normalised, and refused if it climbs out. A file cannot be served from somewhere other than where it was put.

## A site needs an index {#index}

A `site` with no entry page is refused: it would answer nothing at its own address.

## Errors {#errors}

| Code | Status | When |
| --- | --- | --- |
| nothing_to_deploy | 400 | No files, no code, or a file with no path. |
| deploy_too_large | 413 | Past one of the bounds. The message names the file. |
| quota_exceeded | 403 | The account's object storage is full. |
| hosting_kind_unavailable | 501 | That kind cannot serve. |

- [deploys()](/sdk/ref/host/deploys): The history.
- [rollback()](/sdk/ref/host/rollback): Going back.
- [deploy](/sdk/agent/tools/deploy): An agent doing it.

```python
site.deploy(files="./out")                                        # a folder on this machine
site.deploy(files=[{"path": "index.html", "content": html}])      # files you hold in memory
fn.deploy(code="export default { async fetch(request) { return new Response('ok') } }")   # an edge module
```
