Dograh

How to Deploy Voice AI on Google Cloud With One Compute Engine VM

How to Deploy Voice AI on Google Cloud With One Compute Engine VM
TutorialDecember 4, 2026·11 min read

How to Deploy Voice AI on Google Cloud With One Compute Engine VM

Abhishek Kumar
Abhishek Kumar·Co-founder, Dograh AI

Co-founder of Dograh, building the future of open-source voice AI agents. Own your voice AI stack.

To deploy voice AI on Google Cloud, pick a Compute Engine machine type with at least 4 vCPUs and 8 GB, reserve a static external IP, open the web and call ports with tagged firewall rules, then run the setup on Docker. Dograh, the open-source AI voice agent platform, installs this way, or you can use Dograh Cloud.

Key Takeaways

  • Reserve the static IP first, because stopping a VM releases an ephemeral one.
  • Google's default network opens SSH and RDP to everyone, so narrow both.
  • Dograh runs Gemini, Vertex AI and Google speech models on your own key.

A voice platform on Google Cloud needs a VM that stays up for every call and a public address that survives a restart. Compute Engine handles both its own way, so we walk through its parts and connect Google models in Dograh. The upkeep that stays with you comes last.

What you need before you start

These steps follow the published Dograh and Google Cloud docs, so try them in a trial project before any production traffic arrives. Installing Docker and running Dograh's setup script are the same on every cloud, so this post points to our AWS deployment guide for those commands and spends its time on what Google Cloud does differently.

  • A Google Cloud project with billing turned on and Compute Engine quota for a 4 vCPU VM in your region.
  • The gcloud CLI, signed in and set to that project, or Cloud Shell in the console.
  • Your own public IP address, so you can limit SSH to it.
  • A phone carrier account such as Twilio, Telnyx or Plivo, and keys for the models you plan to use.

Why a voice platform wants one long-running VM

A phone call is a long conversation, and the process handling it has to live for the whole call. A Google Cloud developer forum post by two Google engineers calls a voice agent a long-lived, stateful worker. It keeps audio buffers and the conversation in memory, and a crash drops the caller. The same post says Cloud Run is designed for short-lived requests, which is why they moved voice workers to a host that keeps them alive.

Dograh needs more than a worker process. Its remote server setup runs the call flow, the phone connection, Postgres, file storage, nginx and a TURN server for browser audio together in Docker Compose. That stack wants at least 8 GB RAM and 4 vCPUs, root access and a public IP, so a single Compute Engine VM is the plain fit.

Step 1: Pick a machine type with 4 vCPUs and 8 GB

Choose the machine type before anything else, because it decides whether the stack starts at all. Among Google's general-purpose machine types, only some clear Dograh's minimum of vCPUs and memory.

e2-standard-4 is the smallest predefined type that meets both numbers, with 4 vCPUs and 16 GB. e2-highcpu-8 gives 8 vCPUs and exactly 8 GB, which suits more FastAPI workers. e2-standard-2 has enough memory but only 2 vCPUs, and e2-highcpu-4 has the vCPUs but only 4 GB, so both fall short. An E2 custom type with 4 vCPUs and 8 GB also works if you want to pay for only that.

Skip the shared-core E2 types such as e2-medium. They time-share a physical core and burst for short periods, which is fine for a small web app and wrong for live audio that needs steady CPU through every call.

Check: the type you picked shows at least 4 vCPUs and 8 GB in the console's machine configuration list for your zone.

Step 2: Reserve a static external IP first

This is the step that matters most on Google Cloud. Google releases an ephemeral external IP when you stop or delete the VM, and Dograh's setup issues its HTTPS certificate for the address it is given. If the address changes after a restart, the certificate no longer matches and browsers refuse the page. So reserve a static external IP in the region where the VM will run, before the VM exists.

The first command below reserves an address named dograh-ip in us-central1, and the second prints it. Replace the region with yours.

gcloud compute addresses create dograh-ip --region=us-central1
gcloud compute addresses describe dograh-ip --region=us-central1

What this does: It sets aside one public IPv4 address in your project that stays yours until you release it. The address line in the second command's output is the IP you give the VM in Step 3 and the setup script in Step 5.

If you already created a VM with an ephemeral address, you can promote that address instead with gcloud compute addresses create dograh-ip --addresses=IP_ADDRESS --region=us-central1, where IP_ADDRESS is the VM's current IP.

Check: gcloud compute addresses describe dograh-ip --region=us-central1 shows the address with status RESERVED.

Dograh

Open Source Alternative to Vapi / Retell

Self-hosted voice agent platform — no per-minute fees

dograh-hq/dograh

Star on GitHub

Step 3: Create the VM with the address and a tag

Create the VM with the reserved IP, a network tag and a larger boot disk in one command. Each flag below comes from gcloud compute instances create, and --address takes the reserved IP or the address name dograh-ip.

gcloud compute instances create dograh-vm \
    --zone=us-central1-a \
    --machine-type=e2-standard-4 \
    --image-family=ubuntu-2404-lts-amd64 \
    --image-project=ubuntu-os-cloud \
    --address=IPV4_ADDRESS \
    --tags=dograh \
    --boot-disk-size=50GB

What this does: It creates an Ubuntu 24.04 VM in us-central1-a with 4 vCPUs and 16 GB, the reserved IP and the network tag dograh. The firewall rules in Step 4 match that tag, so they reach this VM and nothing else.

Always set --image-family, because without it gcloud picks a Debian image. We picked 50 GB ourselves, since neither Google nor Dograh sets a disk size. Dograh's images, the Postgres database and call recordings all live on this disk, so size it for the recordings you plan to keep.

Check: gcloud compute instances list shows dograh-vm as RUNNING with your reserved IP as its external IP.

Step 4: Open Dograh's ports, narrow SSH and RDP

Google Cloud blocks inbound traffic until a rule allows it, because every network has an implied deny ingress rule. Dograh needs TCP 80, 443, 3478 and 5349, and UDP 3478, 5349 and 49152 to 49200. The two commands below use gcloud compute firewall-rules create, where --rules takes a protocol with a port or a range and --target-tags limits the rule to tagged VMs.

gcloud compute firewall-rules create dograh-tcp --network default --action allow --direction INGRESS --rules tcp:80,tcp:443,tcp:3478,tcp:5349 --source-ranges 0.0.0.0/0 --target-tags dograh
gcloud compute firewall-rules create dograh-udp --network default --action allow --direction INGRESS --rules udp:3478,udp:5349,udp:49152-49200 --source-ranges 0.0.0.0/0 --target-tags dograh

What this does: It opens the web, certificate and TURN ports over TCP, and the TURN and media range over UDP, for VMs tagged dograh only. Port 80 must stay open for Let's Encrypt to issue and renew the certificate.

The default network needs a second look. It comes with firewall rules of its own, and two of them allow SSH on port 22 and RDP on port 3389 from any address. An Ubuntu VM has no use for RDP, so delete default-allow-rdp with gcloud compute firewall-rules delete default-allow-rdp, and limit SSH to your own address with gcloud compute firewall-rules update default-allow-ssh --source-ranges=YOUR_IP/32. Both rules cover every VM on the network, so check with your team before changing them on a shared project.

Google's default network drawn as one cable with four VMs hanging from it, the Dograh VM among them. Two rule cards hang from the same cable. The remote desktop card, open to any address, is stamped for deletion, and the remote login card is changed from any address to your own address, while you look closely with a magnifier.
A Dograh VM placed on Google's default network starts out reachable for remote access from every address, because those rules belong to the network rather than to the VM. Removing the unused desktop rule and fencing login to one address shuts that gap.

Check: gcloud compute firewall-rules list shows dograh-tcp and dograh-udp with the target tag, and SSH limited to your address.

Step 5: Install Docker and run Dograh's setup

From here the steps match any Ubuntu server. SSH in with gcloud compute ssh dograh-vm --zone=us-central1-a, install Docker Engine from Docker's apt repository, then run setup_remote.sh. Steps 4 to 6 of our AWS guide give every command with its source, and they work unchanged on this VM.

Install Docker before the script. The script checks for Docker but does not install it, and without Docker it falls back to a self-signed certificate. When it asks for the server's public IP, enter the reserved address from Step 2. On a public IP it gets a Let's Encrypt certificate for a name such as 203-0-113-10.sslip.io and starts the stack.

The script offers 2 FastAPI workers by default. On e2-standard-4 you can enter 4, since Dograh's scaling guide suggests one per vCPU, capped at 8. If the script warns that Let's Encrypt failed, the dograh-tcp rule is missing or the VM lacks the tag. Fix it, then run the certbot retry command the script prints.

Check: the dashboard opens at the printed https://...sslip.io address with no browser warning.

Step 6: Connect Google models in Dograh

Running on Google Cloud does not tie the agent to Google models. Dograh runs the call flow, the tools and the phone side, while the speech and language models plug in as a separate layer that you pick for each agent. Add a provider with your key under Providers, build a named configuration under Models, then pick it in the agent's Model tab. The Providers and Models page covers the screens.

Six Google entries ship in the current release. Google runs Gemini from AI Studio on an API key, with gemini-3.5-flash as the default model. Google Vertex runs Gemini on Vertex AI and takes a project ID and a location. Google Realtime runs Gemini Live (gemini-3.8-live) from AI Studio, and Google Vertex Realtime runs Gemini Live on Vertex AI. For a normal pipeline, Google STT uses Speech-to-Text V2 with latest_long by default or chirp_3, and Google TTS speaks with Chirp 3 HD voices. A Realtime configuration also needs a separate language model for extraction and QA.

The Vertex location field is where data region gets decided. It takes global, the eu or us multi-regions, or a single region such as europe-west4. Dograh's field text notes that global routes anywhere and carries no residency guarantee, while eu and us keep processing inside that area.

For the Vertex, STT and TTS entries, paste a service-account JSON key. If you leave the field empty, Dograh tries the VM's Application Default Credentials instead. The two AI Studio entries use an API key. Our post on Google speech-to-text on phone calls covers which Google model hears phone audio best.

Check: a Test Agent call with this configuration hears you and replies. A wrong key, project ID or location shows up on that first call.

Step 7: Test in the browser, then on a phone

Describe the agent in plain language to the Agent Builder, approve the requirements it lists and fine-tune the flow on the canvas. The builder runs on Dograh's models, so this install connects to a free Dograh account to use it, while on a VM with no outbound internet access you build every node on the canvas by hand. Pick your configuration in the agent's Model tab, then test in two passes. Test Agent opens a Web Call in the browser, which proves the UDP rule, since browser audio is what a missing TURN range breaks. Then open Telephony in the sidebar, add your carrier, point a number at the agent and use the Phone Call button to ring your own mobile. Phone audio usually arrives at 8 kHz, so it can sound different from the 16 kHz browser test.

Check: the web call has two-way audio and the agent answers a real phone call.

Join the Dograh Community

Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.

Before you ship it

Give the deployment a name your team will remember. Point an A record at the reserved IP and run Dograh's custom domain script from the folder where you ran setup. Our guide to a self-hosted voice agent on your own domain covers what to update after the move. Set ENABLE_SIGNUP=false once your team has accounts, and telemetry can be switched off with ENABLE_TELEMETRY=false.

Schedule snapshots of the boot disk, since Postgres and the recordings live on it, and plan upgrades with Dograh's update guide. Our post on how to update a self-hosted voice agent adds the backup and test-call routine around update_remote.sh.

Self-hosted Dograh carries no per-minute platform fee. You still pay Google for the VM and the static IP, plus model keys and phone minutes. Google charges $0.005 an hour for a static IP in use on a standard VM, about $3.65 over a 730-hour month, and the IP still counts as in use while the VM is stopped. Your team looks after the database, the certificate and each upgrade, with support from the open-source community or a custom SLA on an Enterprise plan. Dograh Cloud runs the platform for a 1¢-a-minute platform fee, with models and phone minutes on top.

Glossary

Network tag
A label on a Compute Engine VM that firewall rules can target. Rules with --target-tags dograh reach only VMs carrying that tag.
Ephemeral external IP
A public address Google assigns for as long as the VM keeps it. It is released when the VM stops, so a certificate issued for it breaks.
Implied deny ingress rule
The lowest-priority rule every VPC network has. It blocks all inbound traffic that no other firewall rule allows.
Application Default Credentials (ADC)
Google's way for code to find credentials on its own, from a key file, the gcloud login or the VM's attached service account.

Frequently Asked Questions

Get started with Dograh

Build, deploy, and scale AI agents with Dograh. Join the community of developers building the future.