Computer Use - Linux
Computer Use enables programmatic control of desktop environments within Daytona sandboxes. It provides mouse, keyboard, screenshot, and display operations for automating GUI interactions and testing desktop applications.
We recommend using this instance type for most tasks.
Common Use Cases
- GUI Application Testing - Automate interactions with desktop applications, click buttons, fill forms, and validate UI behavior
- Visual Testing & Screenshots - Capture screenshots of applications, compare UI states, and perform visual regression testing
- Desktop Automation - Automate repetitive desktop tasks, file management through GUI, and complex workflows
- Human-in-the-Loop - Access the VNC interface directly from the Daytona Dashboard to manually control and interact with the desktop environment alongside automated scripts
SDK References
Choose your preferred SDK to get started with computer use automation:
TypeScript SDK
Complete API reference for computer use operations in TypeScript.
Python SDK
Complete API reference for computer use operations in Python (sync & async).
Quick Example
from daytona import Daytona
# Initialize using environment variables (recommended)daytona = Daytona()# Or explicitly configure:# daytona = Daytona(# api_key=os.getenv('DAYTONA_API_KEY'),# api_url=os.getenv('DAYTONA_API_URL', 'https://app.daytona.io/api')# )
# Create sandbox from default snapshot (includes desktop environment)sandbox = daytona.create()
# Start computer use processesresult = sandbox.computer_use.start()print("Computer use started:", result.message)
# Take a screenshotscreenshot = sandbox.computer_use.screenshot.take_full_screen()
# Click and typesandbox.computer_use.mouse.click(100, 200)sandbox.computer_use.keyboard.type('Hello, Linux!')sandbox.computer_use.keyboard.hotkey('ctrl+s')
import { Daytona } from '@daytonaio/sdk';
// Initialize using environment variables (recommended)const daytona = new Daytona();// Or explicitly configure:// const daytona = new Daytona({// apiKey: process.env.DAYTONA_API_KEY,// apiUrl: process.env.DAYTONA_API_URL || 'https://app.daytona.io/api'// });
// Create sandbox from default snapshot (includes desktop environment)const sandbox = await daytona.create();
// Start computer use processesawait sandbox.computerUse.start();
// Take a screenshotconst screenshot = await sandbox.computerUse.screenshot.takeFullScreen();
// Click and typeawait sandbox.computerUse.mouse.click(100, 200);await sandbox.computerUse.keyboard.type('Hello, Linux!');await sandbox.computerUse.keyboard.hotkey('ctrl+s');
Environment Variables (.env file):
DAYTONA_API_KEY=your-api-key-hereDAYTONA_API_URL=https://app.daytona.io/api