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

# cubby deploy

> Deploy your app to Cubby

# cubby deploy

Deploy your app to the Cubby platform. This command packages your source code, uploads it, builds a Docker image, and starts your container.

## Usage

```bash theme={null}
cubby deploy [directory] [flags]
```

## Arguments

| Argument    | Description               | Default                 |
| ----------- | ------------------------- | ----------------------- |
| `directory` | Path to the app directory | `.` (current directory) |

## Flags

| Flag        | Short | Description                                       | Default        |
| ----------- | ----- | ------------------------------------------------- | -------------- |
| `--name`    | `-n`  | App name (overrides directory name)               | Directory name |
| `--yes`     | `-y`  | Skip confirmation prompts (auto-confirm redeploy) | `false`        |
| `--verbose` | `-v`  | Show detailed build logs                          | `false`        |
| `--port`    | `-p`  | Port the app listens on                           | `3000`         |

## Examples

```bash theme={null}
# Deploy current directory
cubby deploy

# Deploy a specific directory
cubby deploy ./my-app

# Deploy with custom name
cubby deploy --name myapp

# Deploy and auto-confirm redeploy
cubby deploy --yes

# Deploy with verbose build logs
cubby deploy --verbose
```

## What Happens During Deploy

1. **Authentication check** - Verifies you're logged in
2. **Dev container detection** - Prompts to stop local dev containers if running
3. **Framework detection** - Auto-detects Next.js, Vite, Remix, or Node.js
4. **Dockerfile generation** - Creates optimized Dockerfile if not present
5. **Packaging** - Creates tarball of source code (respects `.gitignore`)
6. **Upload** - Sends tarball to Cubby servers
7. **Build** - Docker image built on remote server
8. **Database provisioning** - Provisions the database (SQLite volume by default; Neon Postgres on Builder/Pro)
9. **Migration** - Runs `prisma db push` automatically
10. **Container start** - Launches your app with injected secrets
11. **Health check** - Verifies app responds on configured port

## App Name Rules

App names are used in URLs (`<app>--<username>.cubby.pro`) and must follow DNS-safe naming rules:

* 3-30 characters
* Lowercase letters, numbers, and hyphens only
* Must start and end with a letter or number
* No consecutive hyphens

Invalid names are automatically normalized (spaces and special characters become hyphens).

## Redeploying

When deploying an app that already exists:

```bash theme={null}
$ cubby deploy
App "myapp" already exists.
Redeploy? [y/N]
```

Use `--yes` to skip this confirmation:

```bash theme={null}
cubby deploy --yes
```

## Deploy Output

A successful deploy shows:

```
Deploying myapp to Cubby
Directory: /Users/you/projects/myapp

Detected Next.js (high confidence)
Packaged 142 files (1.2 MB)
Upload complete
Building Docker image...
Starting container...
Deployment complete!

Your app is live at:
https://myapp--yourname.cubby.pro
```

## Troubleshooting

### "Could not detect framework"

Cubby auto-detects common frameworks. If detection fails:

* Ensure `package.json` exists with correct dependencies
* Or provide your own `Dockerfile` in the project root

### "Build failed"

Run `cubby check` first to validate your project locally:

```bash theme={null}
cubby check
```

This runs the same validations as the deploy process.

### "Not logged in"

Authenticate first:

```bash theme={null}
cubby login
```

### Verbose Build Logs

If deployment fails, use `--verbose` to see detailed build output:

```bash theme={null}
cubby deploy --verbose
```

## Related Commands

* [`cubby check`](/cli-reference/check) - Validate before deploying
* [`cubby init`](/cli-reference/init) - Create a new app
* [`cubby secrets`](/cli-reference/secrets) - Manage environment variables
* [`cubby delete`](/cli-reference/overview) - Remove a deployed app
