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

# Deploying Servers

> Deploy VPN servers on DigitalOcean, Vultr, or any custom VPS — all with automatic VPN installation.

StartMyVPN can provision and configure a VPN server end-to-end on any of three paths:

| Method            | How it works                                                 |
| ----------------- | ------------------------------------------------------------ |
| **DigitalOcean**  | Creates a new droplet via API, then SSHes in to install VPN  |
| **Vultr**         | Creates a new instance via API, then SSHes in to install VPN |
| **Custom server** | SSHes into an existing VPS you provide to install VPN        |

All three methods use the same background installation job — the only difference is who creates the underlying VPS.

***

## Deploy on DigitalOcean

Requires a configured DigitalOcean API token. See [DigitalOcean setup](/configuration/providers/digitalocean).

1. Go to **Admin → Deployments → DigitalOcean**
2. Fill in the form:
   * **Region** — geographic location for the droplet
   * **Size** — instance size
   * **Protocol** — OpenVPN or WireGuard
   * **Server Name** — display label shown to users
   * **Country / City** — shown in the user-facing server list
3. Click **Deploy**

StartMyVPN creates the droplet, waits for it to boot, then connects via SSH and runs the VPN installation script automatically.

***

## Deploy on Vultr

Requires a configured Vultr API key. See [Vultr setup](/configuration/providers/vultr).

1. Go to **Admin → Deployments → Vultr**
2. Fill in the form with region, plan, protocol, and display info
3. Click **Deploy**

***

## Deploy on a custom server

Use this when you already have a VPS — from any provider (AWS, Hetzner, OVH, etc.) or a dedicated server. StartMyVPN connects via SSH and installs the VPN software automatically, exactly the same as for DigitalOcean and Vultr deployments.

### Requirements for the custom server

* **OS**: Ubuntu 20.04+ or Debian 10+
* **Access**: Root or sudo-capable SSH user
* **SSH port**: Port 22 open (or specify a custom port)
* **Clean install**: Ideally a fresh VPS with no conflicting VPN software

### Steps

1. Go to **Admin → Servers → Add Server**
2. Complete the 3-step wizard:

**Step 1 — Location**

| Field            | Description                                                                   |
| ---------------- | ----------------------------------------------------------------------------- |
| Server Name      | Display label (e.g. "Frankfurt #1")                                           |
| City             | Start typing to search — auto-complete powered by Google Places if configured |
| Country          | Auto-filled when you select a city                                            |
| Hosting Provider | Optional label (e.g. "Hetzner", "AWS")                                        |

**Step 2 — SSH Access**

| Field        | Description                                   |
| ------------ | --------------------------------------------- |
| IP Address   | Public IPv4 address of the server             |
| SSH Port     | Default: `22`                                 |
| SSH Username | Must be `root` or a user with sudo privileges |
| SSH Password | Stored encrypted — never visible after saving |
| VPN Protocol | OpenVPN or WireGuard                          |

**Step 3 — Review & Deploy**

Review the summary and click **Deploy Server**. StartMyVPN will:

1. Connect to the server via SSH using the credentials provided
2. Automatically install and configure the selected VPN protocol
3. Register the server and mark it active

Installation typically takes **3–5 minutes** and runs in the background via the queue worker.

<Warning>
  The queue worker must be running for deployment to proceed. See [Queue Workers](/getting-started/queue-workers).
</Warning>

### SSH credential security

SSH passwords are encrypted at rest using Laravel's `Crypt` facade (AES-256-CBC). They are only decrypted in memory during installation and are never logged or displayed after the server is saved.

***

## Post-deployment steps

After any server is deployed (regardless of method):

1. Go to **Admin → Server Groups** and add the new server to a group
2. Assign the server group to one or more **Plans** (Admin → Plans → Edit Plan)
3. Users subscribed to those plans will see the server in their dashboard immediately

***

## Monitoring deployment progress

Deployment jobs log progress to `storage/logs/laravel.log`. Check queue status:

```bash theme={null}
php artisan queue:monitor
```

If a deployment fails, the job retries up to 3 times before landing in the failed jobs table:

```bash theme={null}
# List failed jobs
php artisan queue:failed

# Retry a specific failed job
php artisan queue:retry {id}

# Retry all failed jobs
php artisan queue:retry all
```

***

## Google Places API (optional)

The city autocomplete field in the custom server wizard uses Google Places. To enable it:

1. Obtain a Google Maps API key with the **Places API** enabled
2. Enter it in **Admin → Settings → API → Google Maps API Key**

Without this key the city field is a plain text input — you can still type city and country names manually.
