- OS: Linux (recommended), macOS, Windows with WSL2
- Python: 3.11 or newer
- Node.js: 20 or newer
- Docker: 24+ with Docker Compose v2
- GPU: NVIDIA GPU with 8+ GB VRAM (for VLM inference)
- Enable Developer Options: Settings > About Phone > Tap "Build Number" 7 times
- Enable USB Debugging: Settings > Developer Options > USB Debugging
- Connect via USB and authorize the computer when prompted
- Ollama — local LLM runtime (installed on the host)
- ADB — Android Debug Bridge
- scrcpy — screen mirroring (optional)
git clone https://github.com/gotogrub/PhonePilot.git
cd PhonePilot
cp .env.example .envOllama runs on the host machine by default. This is the recommended setup, especially if other services (Open WebUI, etc.) also depend on it.
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull qwen2.5-vl:7b
ollama serveVerify Ollama is accessible:
curl http://localhost:11434/api/tagsThe ADB server must run on the host so that Docker containers can connect to it:
# Start ADB server listening on all interfaces
adb kill-server
adb -a -P 5037 nodaemon server &
# Verify your device is visible
adb devicesdocker compose up -dThis starts 3 services:
- backend (FastAPI) — port 8000
- frontend (React + nginx) — port 3000
- redis — port 6379
docker compose ps
curl http://localhost:8000/devicesOpen http://YOUR_SERVER_IP:3000 in a browser.
If you prefer running Ollama inside Docker instead of on the host:
docker compose -f docker-compose.yml -f docker-compose.ollama.yml up -dThis adds an Ollama container with GPU passthrough and overrides the backend to connect to it. Requires NVIDIA Container Toolkit:
sudo apt install nvidia-container-toolkit
sudo systemctl restart dockerThen pull a model inside the container:
docker compose exec ollama ollama pull qwen2.5-vl:7bFor development with hot-reload:
./scripts/dev.shOr manually:
# Terminal 1: Redis
docker compose -f docker-compose.dev.yml up -d redis
# Terminal 2: Backend
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
uvicorn app.main:app --reload
# Terminal 3: Frontend
cd frontend
npm install
npm run devTo connect your device wirelessly:
# With device connected via USB:
adb tcpip 5555
# Disconnect USB, then:
adb connect 192.168.1.YOUR_DEVICE_IP:5555Or use the API:
curl -X POST http://localhost:8000/devices/connect \
-H "Content-Type: application/json" \
-d '{"address": "192.168.1.100", "port": 5555}'adb kill-server
adb -a -P 5037 nodaemon server &
adb devicesMake sure USB debugging is enabled and the computer is authorized on the phone.
Ensure Ollama is running on the host:
ollama serve
curl http://localhost:11434/api/tagsIf using Docker Ollama, check the container:
docker compose -f docker-compose.yml -f docker-compose.ollama.yml logs ollamaThe backend uses network_mode: host and connects to the ADB server at 127.0.0.1:5037. Make sure:
- ADB server is running on the host (
adb -a -P 5037 nodaemon server &) - The phone is authorized and visible (
adb deviceson host shows it)
Install the NVIDIA Container Toolkit:
sudo apt install nvidia-container-toolkit
sudo systemctl restart docker- Use a smaller model:
ollama pull qwen2.5-vl:3b - Reduce screenshot resolution in config
- Ensure GPU is being used (check
nvidia-smi)