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

# Deploy

> Deploy, monitor, and manage your Zeplo server

Deploy and manage your Zeplo server instance. These commands handle first-time server setup, pushing new code, viewing logs, and restarting the server.

## zeplo deploy setup

Run the first-time setup wizard for your Zeplo server. This command configures your server environment, installs dependencies, sets up PM2 as the process manager, and initializes the database connection. Run this once when provisioning a new server.

```bash theme={null}
zeplo deploy setup
```

### Options

| Flag | Description |
| - | - |
| `--server <address>` | The SSH address of the target server (e.g., `user@192.168.1.100`). Skips the interactive prompt for the server address. |
| `--key <path>` | Path to the SSH private key for authentication. Defaults to `~/.ssh/id_rsa`. |
| `--env <environment>` | The target environment. Accepts `production`, `staging`, or `development`. Defaults to `production`. |

### Examples

```bash theme={null}
# Run the interactive setup wizard
zeplo deploy setup

# Set up a production server non-interactively
zeplo deploy setup --server deploy@my-server.com --env production

# Set up a staging server with a specific SSH key
zeplo deploy setup --server deploy@staging.my-server.com --key ~/.ssh/staging-key
```

## zeplo deploy push

Deploy the latest version of your Zeplo project to the configured server. This command builds your project locally, transfers the build artifacts to the server via SSH, and restarts the Zeplo process through PM2.

```bash theme={null}
zeplo deploy push
```

### Options

| Flag | Description |
| - | - |
| `--env <environment>` | Deploy to a specific environment. Defaults to the environment set during `zeplo deploy setup`. |
| `--skip-build` | Skip the local build step and deploy the existing build artifacts. Useful when you have already built manually. |
| `--verbose` | Print detailed output for each deployment step including file transfer progress. |

### Examples

```bash theme={null}
# Deploy to the default environment
zeplo deploy push

# Deploy to staging
zeplo deploy push --env staging

# Deploy without rebuilding
zeplo deploy push --skip-build

# Deploy with verbose output
zeplo deploy push --verbose
```

## zeplo deploy logs

Display logs from the Zeplo server managed by PM2. By default, this shows the most recent log entries. Use the `--follow` flag to stream logs in real time.

```bash theme={null}
zeplo deploy logs
```

### Options

| Flag | Description |
| - | - |
| `--follow` | Stream logs in real time. Press `Ctrl+C` to stop streaming. |
| `--lines <n>` | Number of log lines to display. Defaults to `50`. |
| `--env <environment>` | Fetch logs from a specific environment's server. |

### Examples

```bash theme={null}
# Show the last 50 log lines
zeplo deploy logs

# Stream logs in real time
zeplo deploy logs --follow

# Show the last 200 log lines
zeplo deploy logs --lines 200

# Stream staging server logs
zeplo deploy logs --follow --env staging
```

## zeplo deploy restart

Restart the Zeplo server process via PM2. This performs a graceful restart: PM2 sends a SIGINT to the current process, waits for it to shut down, and then starts a fresh instance.

```bash theme={null}
zeplo deploy restart
```

### Options

| Flag | Description |
| - | - |
| `--env <environment>` | Restart the server in a specific environment. |
| `--hard` | Perform a hard restart (kill and respawn immediately) instead of a graceful restart. Use with caution. |

### Examples

```bash theme={null}
# Restart the Zeplo server gracefully
zeplo deploy restart

# Restart the staging server
zeplo deploy restart --env staging

# Perform a hard restart
zeplo deploy restart --hard
```


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