> ## Documentation Index
> Fetch the complete documentation index at: https://agdiai-597e782f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DigitalOcean

# DigitalOcean

Run a persistent Agdi Gateway on a DigitalOcean Droplet.

## Prerequisites

* DigitalOcean account ([signup](https://cloud.digitalocean.com/registrations/new))
* SSH key pair (or willingness to use password auth)
* About 20 minutes

## Setup

**1. Create a Droplet**

> [!WARNING]
>
> Use a clean base image (Ubuntu 24.04 LTS). Avoid third-party Marketplace 1-click images unless you have reviewed their startup scripts and firewall defaults.

1. Log into [DigitalOcean](https://cloud.digitalocean.com/).
2. Click **Create > Droplets**.
3. Choose:
   * **Region:** Closest to you
   * **Image:** Ubuntu 24.04 LTS
   * **Size:** Basic, Regular, 1 vCPU / 1 GB RAM / 25 GB SSD
   * **Authentication:** SSH key (recommended) or password
4. Click **Create Droplet** and note the IP address.

**2. Connect and install**

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
ssh root@YOUR_DROPLET_IP

apt update && apt upgrade -y

# Install Node.js 24
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
apt install -y nodejs

# Install Agdi
curl -fsSL https://agdi.ai/install.sh | bash
agdi --version
```

**3. Run onboarding**

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi onboard --install-daemon
```

The wizard walks you through model auth, channel setup, gateway token generation, and daemon installation (systemd).

**4. Add swap (recommended for 1 GB Droplets)**

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
```

**5. Verify the gateway**

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi status
systemctl --user status agdi-gateway.service
journalctl --user -u agdi-gateway.service -f
```

**6. Access the Control UI**

The gateway binds to loopback by default. Pick one of these options.

**Option A: SSH tunnel (simplest)**

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# From your local machine
ssh -L 18789:localhost:18789 root@YOUR_DROPLET_IP
```

Then open `http://localhost:18789`.

**Option B: Tailscale Serve**

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
curl -fsSL https://tailscale.com/install.sh | sh
tailscale up
agdi config set gateway.tailscale.mode serve
agdi gateway restart
```

Then open `https://<magicdns>/` from any device on your tailnet.

**Option C: Tailnet bind (no Serve)**

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi config set gateway.bind tailnet
agdi gateway restart
```

Then open `http://<tailscale-ip>:18789` (token required).

## Troubleshooting

**Gateway will not start** -- Run `agdi doctor --non-interactive` and check logs with `journalctl --user -u agdi-gateway.service -n 50`.

**Port already in use** -- Run `lsof -i :18789` to find the process, then stop it.

**Out of memory** -- Verify swap is active with `free -h`. If still hitting OOM, use API-based models (Claude, GPT) rather than local models, or upgrade to a 2 GB Droplet.

## Next steps

* [Channels](https://agdiai-597e782f.mintlify.site/channels.md) -- connect Telegram, WhatsApp, Discord, and more
* [Gateway configuration](https://agdiai-597e782f.mintlify.site/gateway/configuration.md) -- all config options
* [Updating](https://agdiai-597e782f.mintlify.site/install/updating.md) -- keep Agdi up to date


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