Prerequisites
Before installing:
- Windows 10/11 (Pro or Enterprise)
- Python 3.12 installed
- Administrator access
- Internet connectivity
Use Python 3.12, not 3.13+. There are compatibility issues with pywin32 on newer versions.
Installation Steps
Install Python 3.12
Download from python.orgImportant: Check “Add Python to PATH” during installation. Download the Driver
Get the driver package from your Granite dashboard or:git clone https://github.com/your-org/granite-driver.git
cd granite-driver/driver
Install Dependencies
pip install -r requirements.txt
This installs:
- pyautogui (UI automation)
- rpaframework (Robocorp RPA)
- websockets (Backend connection)
- mss (Screen capture)
- aiortc (WebRTC streaming)
Configure the Driver
Create or edit the configuration file:# config.py
BACKEND_URL = "wss://api.getgranite.ai/ws/driver"
MACHINE_ID = "unique-machine-id" # Change this
Test the Installation
Run a quick test:python -c "import pyautogui; print(pyautogui.position())"
Should print your mouse position.
Directory Structure
After installation:
granite-driver/
├── driver/
│ ├── src/
│ │ ├── config.py # Configuration
│ │ ├── connection/ # WebSocket logic
│ │ ├── executor/ # Job execution
│ │ └── streaming/ # Video streaming
│ ├── requirements.txt # Dependencies
│ └── main.py # Entry point
Running the Driver
Manual Start
cd granite-driver/driver
python main.py
As a Service (Recommended)
For production, run as a Windows service:
# Using NSSM (Non-Sucking Service Manager)
nssm install GraniteDriver "C:\Python312\python.exe" "C:\granite-driver\driver\main.py"
nssm start GraniteDriver
Verifying Installation
After starting the driver:
- Check the console for “Connected to backend”
- Go to Driver Management in the dashboard
- Your machine should appear as Online
Environment Variables
Optional configuration via environment:
| Variable | Description | Default |
|---|
GRANITE_BACKEND_URL | WebSocket endpoint | Production URL |
GRANITE_MACHINE_ID | Unique identifier | Hostname |
GRANITE_LOG_LEVEL | Logging verbosity | INFO |
Next Steps