Launch a ByteBot in a TEE on Phala Cloud

September 30, 2025
5 min read
Launch a ByteBot in a TEE on Phala Cloud

ByteBot is an open-source AI desktop agent: it can click, type, browse, read files, and stitch multi-step workflows together from plain-English prompts. Now it’s available as a Template in Phala Cloud, so AI developers can deploy it in minutes and run it privately inside a Trusted Execution Environment (TEE).


What we’re launching

The ByteBot AI Desktop Agent template provisions four services (via Docker Compose under the hood):

  • bytebot-desktop — Ubuntu 22.04 with XFCE (plus VSCode, Firefox, Thunderbird) and the bytebotd automation daemon
  • postgres — local PostgreSQL database for task/state
  • bytebot-agent — NestJS service that plans and executes tasks using your LLM key
  • bytebot-ui — Next.js web app to create and monitor tasks

Default ports:

9990 (Desktop/VNC + automation daemon), 9991 (Agent API), 9992 (Web UI), 5432 (PostgreSQL, localhost only)

Where to find it: Phala Cloud → Templates → ByteBot


Why run ByteBot inside a TEE?

  • Privacy by construction. Your agent runs inside a confidential VM on Phala Cloud, with container and network isolation—so prompts, screenshots, and files stay under your control.
  • No rewrites. Keep your existing LLM provider (e.g., OpenAI). The template wires in your API key and ByteBot just works.
  • Familiar tooling. Built on Dstack—author your app as containers, deploy into TEEs.

Quick refresher — What ByteBot can do

  • Natural-language tasking (“download my statement”, “summarize this PDF”)
  • Full desktop control across any GUI app (browser, office tools, email, custom software)
  • Autonomous and Takeover modes, with live view, screenshots, and task history
  • REST APIs for programmatic control

Launch in minutes — Phala Cloud UI flow

Purpose: Get from zero to a running desktop agent using the Templates gallery.

1) Pick the template

Go to Phala Cloud → Templates → ByteBot → Deploy.

2) Configure environment

Provide at least one LLM key (e.g., OPENAI_API_KEY). Defaults for internal service URLs and database are fine to start.

# minimum
OPENAI_API_KEY=sk-***

# optional alternatives (if you use them)
ANTHROPIC_API_KEY=***
GEMINI_API_KEY=***

If needed, the DB defaults to internal Postgres:

DATABASE_URL=postgresql://postgres:postgres@postgres:5432/bytebotdb

3) Deploy & open services

Once the stack starts, open:

  • Web UI: http://localhost:9992
  • Desktop/VNC: http://localhost:9990
  • Agent API: http://localhost:9991

Tip: The desktop container benefits from shared memory. Set shm_size: "2g" for smooth browser automation.

Troubleshooting

  • VNC doesn’t load? Confirm port 9990 and container health.
  • Planning stalls? Double-check that at least one LLM API key is set.
  • Need logs? Use service logs from the Phala Cloud UI (or docker compose logs if running locally).

Demo — “Show me today’s MLB scoreboard”

Purpose: Prove ByteBot can browse, read, and save output—end-to-end—without custom code.
  1. Open the ByteBot UI at http://localhost:9992 or your CVM URL → Create New Task
    • Screenshot A

      Caption: Create a new task in the ByteBot UI.

  2. Paste this prompt (edit the date as needed):
Open a browser, search for today’s MLB scoreboard, read each game and final score,
then save a file named mlb_scores_<YYYY-MM-DD>.txt to the desktop.
  • Screenshot B

    Caption: The MLB scoreboard prompt ready to run.

  1. Click Run and watch the agent plan and execute.
    • Screenshot C

      Caption: Live desktop view with the browser on an MLB scoreboard page.

    • Screenshot D

      Caption: Task History showing navigation, waits, reads, and file-write steps.

  2. Verify the output file on the desktop and preview its contents.
    • Screenshot E

Gotcha: Some scoreboard pages load data dynamically. If parsing stalls, add a hint like: “wait for the scores table to load” or “use the site’s Final filter.” You can always take manual control in the Desktop tab.


How this compares (quick view)

CapabilityDesktop agent in a TEE (ByteBot + Phala)Browser-only automation/RPA
App coverageAny Linux GUI app + browserUsually browser-bound or vendor-specific
Data exposureIsolated inside CVMOften plaintext in vendor runtime
VerifiabilityHardware-backed isolation; local logsRarely hardware-anchored
Setup for devsTemplate + Compose semanticsVaries; often proprietary
PortabilityContainer-first, cloud-agnosticOften tied to a managed stack

ByteBot avoids “browser-only” limits, while Phala adds isolation and predictable ops with containerized services.


What’s inside the template (for devs)

  • Services & images: 4 containers (desktop/agent/ui/db) on a private network
  • Env vars: LLM keys (OPENAI_API_KEY, optional others), service URLs, optional DATABASE_URL
  • Ports: 9990/9991/9992 for desktop/agent/ui; 5432 for Postgres (localhost)
  • APIs: task management, direct desktop control, and file operations
  • Scaling: for production, consider external Postgres, reverse proxy/TLS, health checks, and monitoring

Architecture (at a glance)


Checklist — First run

Template deployed; all containers healthy
LLM key set; a simple task (“open example.com and take a screenshot”) completes
Desktop reachable on :9990; UI reachable on :9992
Logs reviewed if anything looks off (docker compose logs)

Call to action

  • Deploy ByteBot on Phala Cloud from the Templates gallery: https://cloud.phala.network/templates/bytebot
  • Kick off the MLB scoreboard task, export the results, then adapt the flow to your own workflows.
  • Explore next steps: integrate private data sources, schedule recurring tasks—and if you’re curious about the TEE plumbing, star Dstack on GitHub.

TLDR

  • New ByteBot template on Phala Cloud lets AI devs deploy a desktop agent inside a TEE in minutes.
  • Four-service stack (desktop, agent, UI, Postgres) with simple env config (e.g., OPENAI_API_KEY).
  • Quick demo: fetch the MLB scoreboard, save results to a text file—no extra code.
  • Works with your existing LLM provider; all runtime stays within your confidential VM.
  • Built on Dstack; portable, container-first workflow.

Recent Posts

Related Posts