# CLI: VPS Instances

Manage VPS instances using the DanubeData CLI.

## Prerequisites

- [DanubeData CLI installed](https://docs.danubedata.ro/cli-overview)
- Authenticated via `danube auth`, `danube login`, or `DANUBE_TOKEN`

## Quick start

List your instances:

```bash
danube vps ls
```

Create a new VPS interactively:

```bash
danube vps create
```

## Listing instances

```bash
danube vps ls
```

Shows all VPS instances with ID, name, status, IP address, resource profile, and creation date.

## Creating a VPS

### Interactive

```bash
danube vps create
```

The CLI guides you through selecting an OS image, resource profile, and optional SSH key.

### With flags

```bash
danube vps create \
  --name my-server \
  --image ubuntu-24.04 \
  --plan nano_shared \
  --ssh-key-id <key-id>
```

### Available OS images

```bash
danube vps images
```

Lists all available operating system images with their identifiers.

## Viewing instance details

```bash
danube vps get <id>
```

Displays full instance details including connection info, IP addresses, resource profile, and status.

## Power management

### Start

```bash
danube vps start <id>
```

Starts a stopped VPS instance.

### Stop

```bash
danube vps stop <id>
```

Gracefully stops a running VPS instance.

### Reboot

```bash
danube vps reboot <id>
```

Reboots a running VPS instance.

### Check status

```bash
danube vps status <id>
```

Shows the current status and available actions for an instance.

## Updating a VPS

```bash
danube vps update <id>
```

Update VPS configuration. The instance must be stopped before updating.

## Reinstalling the OS

```bash
danube vps reinstall <id>
```

Reinstalls the operating system on an existing VPS. **This destroys all data on the instance.** The CLI prompts for confirmation before proceeding.

## Monitoring

```bash
danube vps metrics <id>
```

Shows current resource usage:

- CPU utilization
- Memory usage
- Storage usage
- Network throughput

## SSH access

### Retrieve SSH password

```bash
danube vps password <id>
```

Displays the root SSH password. The CLI asks for confirmation before revealing it.

### Connect via SSH

```bash
ssh root@<public-ip>
```

Use the IP address shown in `danube vps get <id>` or `danube vps ls`.

## Deleting a VPS

```bash
danube vps delete <id>
```

Prompts for confirmation before deleting. This is irreversible — all data on the instance will be destroyed.

## Complete workflow example

```bash
# Install the CLI
npm install -g @danubedata/cli

# Authenticate
danube auth

# List available OS images
danube vps images

# Create a VPS
danube vps create \
  --name web-server \
  --image ubuntu-24.04 \
  --plan nano_shared

# Check instance details
danube vps ls

# View metrics
danube vps metrics <id>

# Stop instance (note: still billed — delete to stop charges)
danube vps stop <id>

# Start again
danube vps start <id>

# Delete when no longer needed (stops billing)
danube vps delete <id>
```

## Next steps

- [CLI Overview](https://docs.danubedata.ro/cli-overview) — Installation, auth, and configuration
- [CLI: Object Storage](https://docs.danubedata.ro/cli-storage) — Manage storage buckets and access keys
- [VPS overview](https://docs.danubedata.ro/vps-overview) — Full VPS product reference

---

**Questions?** Contact support at support@danubedata.ro
