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

# Deploy

> Deploy your app in one command — from local files or straight from a GitHub repo. Creates the pod if needed, builds, and runs it.

The `deploy` command is a one-shot workflow that creates a pod (if it doesn't exist), syncs your local code, installs dependencies, and reloads the app service. You can also deploy straight from a GitHub repo with `--repo` — no local files needed.

## Basic Usage

```bash theme={null}
# Deploy current directory (auto-detects preset)
instapods deploy myapp

# Deploy a specific directory
instapods deploy myapp --local ./src

# Explicit preset
instapods deploy myapp --preset nodejs

# Skip reload (just sync files)
instapods deploy myapp --no-reload
```

## What Happens

1. **Pod check** — If the pod doesn't exist, it's created (and the CLI waits for it to be running)
2. **File sync** — Local directory is uploaded to the pod's app root, skipping unchanged files and anything excluded (see [Which files get uploaded](#which-files-get-uploaded))
3. **Reload** — Dependencies are installed, the app is rebuilt where the preset has a build step, the app service is restarted and health-checked (skip with `--no-reload`)

If the pod already exists, the command skips creation and goes straight to syncing.

<Tip>
  Not sure whether you want `deploy`, `pods reload` or `pods restart`? See
  [Deploy, Reload, Restart](/guides/operations).
</Tip>

## Which files get uploaded

`deploy` uploads a file only if it differs from the copy already on the pod, and skips it entirely if
it matches either of these:

* One of the `--exclude` patterns. The defaults are `node_modules`, `vendor`, `.git`, `.env`,
  `__pycache__`, `.DS_Store`, `.venv`, `venv`, `.next`, `.instapods-build-hash`. Passing `--exclude`
  **replaces** that list rather than adding to it.
* A pattern in the `.gitignore` of the directory you are deploying. This happens by default, whether
  or not the directory is a git repository, and only that top-level `.gitignore` is read.

Pass `--no-gitignore` to ignore the `.gitignore` and sync everything except the `--exclude` patterns.
Pass `--force` to re-upload every file instead of only the changed ones.

<Warning>
  `.env` is on the default exclude list, so your local `.env` is **not** uploaded. Set those values
  with [`instapods env set`](/guides/environment-variables) instead. The same applies to a build
  directory listed in your `.gitignore` (`dist/`, `build/`, `.next/`): if you meant to ship built
  files, deploy that directory directly with `--local ./dist`.
</Warning>

## Deploy from a GitHub repo

Point `deploy` at a GitHub repository instead of local files. InstaPods detects the stack from the repo, creates the pod, attaches the repo, and builds & runs it. Every push after that redeploys automatically (with build logs and rollback, like [`git deploy`](/cli/git)).

```bash theme={null}
# Name is optional — derived from the repo when omitted
instapods deploy --repo https://github.com/owner/repo

# Choose the name, branch, and a monorepo subdirectory
instapods deploy my-api --repo https://github.com/owner/repo --branch dev --subdir services/api
```

With `--repo` the CLI skips local file sync: it detects the preset from the repo's root files (same rules as below), creates the pod, then follows the first build to completion. Public repos work out of the box; private repos need a GitHub account connected in the dashboard. If the stack can't be detected, pass `--preset`.

## Flags

| Flag | Description | Default |
| - | - | - |
| `--local` | Local directory to sync | Current directory (`.`) |
| `--repo` | Deploy a GitHub repo URL instead of local files | None |
| `--branch` | Git branch to deploy (with `--repo`) | Repo default branch |
| `--subdir` | Subdirectory to deploy (with `--repo`, for monorepos) | Repo root |
| `-p, --preset` | Preset: `static`, `php`, `nodejs`, `python`, `go` | Auto-detected |
| `--no-reload` | Skip reloading app service after sync (files are uploaded, nothing is restarted) | `false` |
| `--no-build` | Skip the build step during reload. Only `nodejs` and `go` have one, so it is a no-op on the other presets | `false` |
| `--no-gitignore` | Don't read `.gitignore` for exclude patterns | `false` |
| `--force` | Re-upload every file, ignoring what is already on the pod | `false` |
| `--exclude` | Patterns to exclude from sync (repeatable; replaces the defaults) | `node_modules`, `vendor`, `.git`, `.env`, `__pycache__`, `.DS_Store`, `.venv`, `venv`, `.next`, `.instapods-build-hash` |
| `-r, --region` | Target region | Auto-select |
| `--plan` | Plan slug | `launch` |
| `--cpu` | CPU cores (overrides the plan) | Plan default |
| `--memory` | Memory limit, e.g. `512MB` (overrides the plan) | Plan default |
| `--disk` | Disk size, e.g. `5GB` (overrides the plan) | Plan default |
| `--ssh-key` | SSH public key or path | None |
| `--timeout` | Max seconds to wait for pod creation | `120` |

### What `--no-build` skips, per preset

| Preset | With `--no-build` |
| - | - |
| `nodejs` | `npm run build` is skipped. `npm install` still runs, with `--production` |
| `go` | `go mod download` and `go build` are skipped, so the previously compiled binary keeps running |
| `python` | Nothing. There is no build step, and `pip install` still runs |
| `php` | Nothing. `composer install` still runs |
| `static` | Nothing |

<Note>
  On `nodejs`, InstaPods already skips the build automatically when your source tree hasn't changed
  since the last one - that is the `build skipped (unchanged)` line in the deploy output. You rarely
  need `--no-build`.
</Note>

## Preset Auto-Detection

If `--preset` is omitted, the CLI scans your local directory for signature files:

| Files Found | Detected Preset |
| - | - |
| `artisan`, `wp-config.php` | `php` |
| `hugo.toml`, `hugo.yaml`, `theme.toml` (with no `.go` files) | `static` |
| `go.mod`, `go.sum`, `go.work` | `go` |
| `package.json`, `tsconfig.json`, `yarn.lock`, `bun.lockb`, `next.config.js`, `vite.config.ts`, etc. | `nodejs` |
| `composer.json`, `phpunit.xml`, `*.php` | `php` |
| `requirements.txt`, `pyproject.toml`, `Pipfile`, `manage.py`, `app.py`, `*.py` | `python` |
| `*.go` with no `go.mod` | `go` |
| `index.html`, `*.html` | `static` |

The first match wins, top to bottom. The order matters for repos that carry more than one marker: a
Laravel or WordPress app ships a `package.json` to build its front-end assets but is still PHP, and a
Go service with a JavaScript front-end in the same repo is still Go. Pass `--preset` to override.

## Examples

```bash theme={null}
# Deploy a Node.js app (new pod)
instapods deploy my-api
# →
# →   Deploying my-api
# →   Detected nodejs (package.json)
# →
# →   Creating pod ······································ ✓ 1.2s
# →   42 files uploaded ································· ✓ 0.8s
# →   Reloading ········································· ✓ 1.4s
# →     npm deps installed · service active · HTTP 200
# →
# →   ✓ Deployed in 3.4s
# →   → https://my-api.nbg1-1.instapods.app

# Re-deploy to an existing pod
instapods deploy my-api
# →
# →   Deploying my-api
# →   Pod exists (nodejs · running)
# →
# →   42 files uploaded ································· ✓ 0.6s
# →   Reloading ········································· ✓ 1.1s
# →     npm deps installed · service active · HTTP 200
# →
# →   ✓ Deployed in 1.7s
# →   → https://my-api.nbg1-1.instapods.app

# Deploy to a specific plan and region
instapods deploy staging-api --preset python --plan build -r us-east

# Deploy without reload (just sync files)
instapods deploy my-site --local ./dist --no-reload

# Deploy with custom excludes (this replaces the default list)
instapods deploy myapp --exclude "*.log" --exclude "tmp"

# Sync files your .gitignore would otherwise skip
instapods deploy myapp --no-gitignore
```

<Tip>
  Reload is on by default — it auto-installs dependencies from `package.json` or `requirements.txt` before restarting the service. Use `--no-reload` to skip this step if you only want to sync files.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.