How to Deploy Voice AI on DigitalOcean
Size the Droplet for live calls, keep its own IP, and give the Cloud Firewall the call ports and its outbound rules.

To deploy voice AI on DigitalOcean, create a Droplet with at least 4 vCPUs and 8 GB of RAM, tag it, and put a Cloud Firewall in front of it that opens the web and call ports and keeps its outbound rules. Then install Docker and run the setup script against the Droplet's own IPv4. The example here is Dograh, the open-source AI voice agent platform, which runs its whole stack on one machine with Docker Compose.
Most of that would look the same on any cloud. Two things catch people out on DigitalOcean in particular, the CPU type hiding behind the plan name and a firewall that blocks outbound traffic as well as inbound. The IP address, on the other hand, is easier than on AWS.
Why a voice agent needs more than a chat bot
Voice asks more of a Droplet than a chat agent does. Browsers only hand over the microphone on pages served over HTTPS, and carriers need a public address to reach your webhooks and send audio. Browser calls also push their media over UDP through a TURN server.
The Docker Compose stack covers all of it on one box, running the call flow and phone connection alongside Postgres, file storage, nginx and the TURN server. It needs 4 vCPUs and 8 GB of RAM at minimum, root access and a public IP. That fits a CPU Droplet when the models are hosted elsewhere.
Pick shared or dedicated CPU first
Three Droplet plans clear that minimum without stepping into the Memory-Optimized or Storage-Optimized lines.
| Plan | Slug | vCPUs and memory | Disk | Price |
|---|---|---|---|---|
| Basic (shared CPU) | s-4vcpu-8gb |
4 vCPUs, 8 GiB | 160 GiB SSD | $48.00 a month |
| CPU-Optimized (dedicated) | c-4 |
4 vCPUs, 8 GiB | 50 GiB SSD | $84.00 a month |
| General Purpose (dedicated) | g-4vcpu-16gb |
4 vCPUs, 16 GiB | 50 GiB SSD | $126.00 a month |
The first two are the same size, and the difference is the hyper-thread. On a Basic Droplet it may be shared with other Droplets, which DigitalOcean pitches at apps running at low to medium load. Dedicated CPU plans get the full hyper-thread at all times. A live call doesn't forgive stalls, so we'd run a trial on Basic and move to a dedicated plan once real callers are on the line.

Create it with a tag
Tag the Droplet now so the firewall can find it later. Ubuntu image slugs change with each release, so list them and copy the Ubuntu 24.04 slug before creating anything.
doctl compute size list
doctl compute image list-distribution
doctl compute droplet create dograh --size s-4vcpu-8gb --image UBUNTU_IMAGE_SLUG --region nyc1 --ssh-keys SSH_KEY_ID --tag-names dograh
Swap s-4vcpu-8gb for c-4 to start on dedicated CPU.
Leave the IP alone
On AWS you'd attach an Elastic IP before setup, and here you can skip it. A Droplet's IPv4 stays the same for the life of the Droplet, so use that address at setup, and the HTTPS certificate and TURN settings get built around it.
The catch is the phrase "life of the Droplet". Destroy it and the address goes back to DigitalOcean's pool, and a rebuilt Droplet needs a new certificate and new carrier settings, so resize and reboot when you can.
A reserved IP is the tool for moving an address between Droplets later. It's free while assigned and $5 a month for an unassigned IPv4. For voice there's a wrinkle. Outbound traffic still leaves from the Droplet's own address unless you route it through the reserved IP's gateway, while the TURN settings use whatever address you entered at setup. If you ever switch, place a browser test call and a phone call straight after.
Keep the firewall's outbound rules
DigitalOcean Cloud Firewalls block every packet no rule permits, in both directions. A firewall with no outbound rules quietly stops Docker pulls, the Let's Encrypt check and every request to a model API. Creating the firewall in the control panel avoids this, because a new one starts with outbound rules that allow all traffic, so leave those exactly as they are.
For inbound, add one rule per port or range, since ports that aren't next to each other each need their own rule.
| Protocol | Ports | Sources |
|---|---|---|
| TCP | 22 | your own IP only |
| TCP | 80, 443, 3478, 5349 | all IPv4 and IPv6 |
| UDP | 3478, 5349 | all IPv4 and IPv6 |
| UDP | 49152-49200 | all IPv4 and IPv6 |
The panel suggests SSH from anywhere, so narrow it to your own address. Keep port 80 open for good, because Let's Encrypt uses it to renew the certificate as well as issue it. Apply the firewall to the tag dograh so any Droplet you tag later gets the same rules.
Install Docker before the script
SSH in as root, add Docker Engine from Docker's own apt repository, then start setup_remote.sh. Order matters here. The script checks for Docker without installing it, and if Docker is missing it falls back to a self-signed certificate. Give it the Droplet's IPv4 at the prompt and it requests a Let's Encrypt certificate for a hostname like 203-0-113-10.sslip.io, then brings the stack up.
It suggests 2 FastAPI workers by default. A 4 vCPU Droplet can take 4, since the scaling guidance is one worker per vCPU up to 8, each using roughly 300 to 500 MB of RAM. If the certificate step fails, port 80 is missing or the firewall never reached the Droplet. Fix that and run the certbot retry command the script prints.
Test in the browser, then on a real phone
The Droplet runs the call flow and phone connection, while the models come from any provider you add with your own key under Providers, or from our own models. The Agent Builder runs on our models, so a self-hosted Droplet connects to a free account to use it.
Run a Web Call from Test Agent first. It proves the UDP rules, since a missing TURN range is the usual reason browser audio breaks. Then connect your carrier under Telephony, give the agent a number and ring your own mobile. Don't stop at the browser test. Our standing view is that most phone calls still reach the agent as 8 kHz audio while a browser runs at 16 kHz, so speech recognition and the voice can behave differently on a real handset.
Before your team relies on it
Point a real domain at the Droplet with an A record and run the custom domain script from the setup folder. Once everyone has an account, set ENABLE_SIGNUP=false. Postgres and the call recordings live on the Droplet's disk, so turn on DigitalOcean backups or take a snapshot before every upgrade. The install runs 10 calls at once by default, raised with DEFAULT_ORG_CONCURRENCY_LIMIT.
When you self-host Dograh there's no per-minute platform fee. You still pay for the Droplet, $48 a month on Basic or $84 on CPU-Optimized, plus model keys and phone minutes, and keeping the database, certificate and upgrades in order is your team's job.
The control panel clicks for each step and the upgrade routine are in our DigitalOcean voice AI deployment walkthrough.
About the author
- Building Dograh (https://dograh.com) - an open-source alternative to Vapi. Love for OSS and Voice AI
Comments
Join the discussionNo comments yet. Be the first to comment.





