A self-hosted app that logs into your Google account, keeps polling your Find My Device / Find Hub trackers and Android phones, and forwards each new location to your own Traccar, Nextcloud PhoneTrack, OwnTracks Recorder or Home Assistant server, so you keep your location history on your own infrastructure instead of nowhere. One Docker container, a web UI, nothing else to run.
It's built on top of GoogleFindMyTools, the original reverse-engineering work that figured out how to talk to Google's Find My Device / Find Hub network at the protocol level (querying trackers, decrypting end-to-end encrypted locations, registering custom ESP32/Zephyr trackers). That original tool is still in here and still works as a set of Python scripts - see Advanced: running it as a CLI tool below. Everything described in the rest of this README is a self-hosted app built around it: a web UI, a scheduler, multi-destination forwarding, and the operational stuff (logging, throttling, auth, encryption at rest) a service you actually leave running needs.
Caution
This holds long-lived Google account tokens and live device location data. It's meant for local/LAN use - see Security below before exposing it any further than that.
- Devices page - every tracker and phone on your account, in one list. Manual "Locate" and "Play sound" buttons, plus whatever the last scheduled poll found. Shows last-seen time for phones and tags alike.
- Stale-device alerts - each device's card has its own Alerts section: turn on tracking, set how long is too long before it's worth a warning, and optionally repeat the alert while it stays stale. Fires through the same Apprise targets as the logging below, so a dead battery or a BLE tag that's drifted out of range shows up wherever you already watch for forwarding failures, not just as a quiet chip on the page.
- Scheduled forwarding, not a one-off export - each device polls on its own cron schedule and forwards to as many destinations as you want, each with its own schedule and its own alias. Every destination is really the same generic HTTP request builder (method, URL - query string and all - headers, body, all with
{{latitude}}-style placeholders) - Traccar, OwnTracks (Recorder or Home Assistant's OwnTracks integration), and Nextcloud PhoneTrack's OsmAnd, GpsLogger, Locus Map, uLogger, OwnTracks, and Overland-compatible log endpoints are just one-time presets that pre-fill it when you're setting up a new endpoint, so you can add a custom endpoint (a different self-hosted service, a webhook, whatever takes HTTP) without waiting on this project to add it by name. - Skip pointless updates - two independent, opt-in gates per destination: skip sending if the device hasn't moved far enough, and skip re-sending the same stale cached fix Google keeps returning. Both are local math (haversine distance), no external API calls, no extra cost.
- Logging - every forwarding attempt and every warning/error anywhere in the app (a failed locate, an expired token, a forwarding failure) lands in a searchable in-app log, with errors also pushed out live through Apprise to whatever you already use (ntfy, Discord, Telegram, Pushover, email, 100+ others) - configured from the Config page, no restart needed.
- Register your own trackers - pair a custom ESP32- or Zephyr-based BLE tracker straight from the web UI.
- Build and flash ESP32 firmware from the browser - the Firmware page bakes a registered tracker's key into an ESP32/ESP32-C3 build (device name, advertising interval, TX power, and the unwanted-tracking-protection flag are all configurable), then flashes it over USB via Web Serial, or gives you a plain
.binto flash yourself. Still marked experimental in the UI - hasn't been exercised across every board/setup yet. Other Zephyr-supported boards link out to a manual build/flash guide instead. - Account-wide rate limiting - every call to Google's backend (device list, locate, sound, register) goes through one shared throttle, tunable live from the Config page, so a burst of manual clicks and every device's poll loop can never combine into something that gets your account flagged.
/metrics- a small set of Prometheus-format gauges (uptime, sign-in status, query-throttle queue depth, forwarding/system log entry counts by outcome) if you already scrape other self-hosted services and want this one in the same dashboard. Behind the same Basic Auth as everything else when configured.
docker compose up -d
This pulls the pre-built image from ghcr.io/p6g9yhk6/googlefindmytools - no local build, no Chrome install on the host. Then open http://localhost:4321 and go to Config → Sign in with Google.
Chrome and the Xvfb/x11vnc/noVNC stack needed for that one-time Google login aren't baked into the image - they install on demand into an in-memory directory the first time you sign in. The Config page shows live progress while this happens, and you complete the actual Google login in an embedded browser view right there on the page - no separate machine, no VNC client needed.
Building from source instead: docker compose -f docker-compose.dev.yml up --build.
Copy .env.example to .env and fill in what you need, or pass these directly to docker run/docker compose. Everything is optional - the defaults are a reasonable, auth-free single-user setup.
| Variable | Default | What it does |
|---|---|---|
HTTP_USER / HTTP_PASSWORD |
unset | Set both to require this username/password pair (HTTP Basic Auth) for the whole web UI, including the embedded login view. |
SECRETS_ENCRYPTION_KEY |
unset | Any string. When set, every credential in auth.yaml (OAuth tokens, FCM credentials, vault keys, ...) is encrypted at rest (AES-256-GCM). Unset keeps the old plain-text behavior and logs a one-time startup warning saying so. Losing/changing this makes existing encrypted values unreadable; you'd need to sign in again to regenerate them. |
TZ |
UTC | Timezone for timestamps shown in the UI and logs. |
Advanced / rarely changed
| Variable | Default | What it does |
|---|---|---|
GFMT_DATA_DIR |
/data (in the container) |
Where all persisted state lives: device/forwarding config, credentials, location history, logs - one flat directory, just mount a volume onto it. |
GFMT_FIRMWARE_DIR |
webui/firmware/ locally, /firmware in the Docker image |
Where the on-demand ESP-IDF toolchain and firmware-build sandboxes live - deliberately separate from GFMT_DATA_DIR so they never bloat your backed-up volume. Not mounted by default in Docker, so they're ephemeral unless you opt in to a -v .../firmware:/firmware volume (see docker-compose.yml, the Unraid template). On first startup after upgrading, anything left from before the split (the old esp-idf/, esp-idf-tools/, firmware_builds/ under GFMT_DATA_DIR) is auto-moved here, so your /data volume sheds the multi-GB install without a fresh download. |
GFMT_FIRMWARE_KEEP_BUILDS |
5 | Max recent firmware build sandboxes to keep on disk (the rest are pruned). Combined with GFMT_FIRMWARE_BUILD_TTL_S for a two-pronged sweep. |
GFMT_FIRMWARE_BUILD_TTL_S |
2592000 (30 days) | Delete a firmware build sandbox once it's sat around this long (seconds), even if under the keep-count. 0 disables the age sweep, leaving only the count cap above. |
GFMT_ESP_IDF_IDLE_TTL_S |
2592000 (30 days) | Delete the on-demand ESP-IDF toolchain after this much idle time (seconds). The next build just re-downloads it. 0 keeps the toolchain indefinitely once provisioned. |
DEFAULT_POLL_INTERVAL_S |
300 | Fallback poll interval for a newly added device before you set its own cron schedule. |
LOCATE_CONCURRENCY |
5 | Max number of devices being actively located at once. |
LOCATE_TIMEOUT_S |
60 | How long to wait for a single locate before giving up. |
STALENESS_SWEEP_INTERVAL_S |
3600 | How often a device with no forwarding endpoints configured gets re-checked against its own Alerts threshold (set from its card on the Devices page). A device with endpoints is checked inline on every one of its own polls instead, so this only matters for the rest. |
EID_UPLOAD |
on | Experimental. Your Android phone normally uploads your trackers' upcoming rotating IDs to Google every few days; if it's off for longer than that, crowdsourced reports stop arriving. By default gfmt does that upload itself; dry-run only logs what it would send (payload size, entry counts, timestamps) without posting to Google, off disables it. Each tracker's clock is calibrated from the reports Google still holds for it (one locate per tracker per run), falling back to its pairing date. Clock zeros are persisted to data/clock_zeros.yaml to survive restarts; only re-calibrated if >24h old or reports changed. |
EID_UPLOAD_INTERVAL_S / EID_UPLOAD_DRIFT_SLOTS |
43200 / 2 | How often that upload runs (min 3600), and how many neighbouring ID periods (17 min each) either side of the estimated tracker clock to include, to cover what the calibration can't pin down. |
EID_UPLOAD_MAX_DAYS |
1 | How many days of future EIDs to upload (each day ≈ 85 entries per tracker). Lower = smaller payload, faster upload. Was 4 days before v2.83; 1 day is enough for the 12h upload interval. |
QUERY_THROTTLE_MAX / QUERY_THROTTLE_WINDOW_S / QUERY_MIN_SPREAD_S |
20 / 60 / 1 | Account-wide rate limit against Google's backend. Also editable live from the Config page - no restart needed. |
HTTPS_ENABLED |
unset | Set to 1 to serve HTTPS instead of HTTP on the same port, using a self-signed certificate generated automatically on first start and reused after that (not regenerated every restart). See Security. |
GFMT_TLS_CERT_PATH / GFMT_TLS_KEY_PATH |
unset | Bring your own cert/key instead of the self-signed one - both must point at existing files, or startup fails rather than silently falling back to self-signed. |
GFMT_TLS_SAN |
unset | Comma-separated extra hostnames/IPs to add to the generated self-signed cert (it always covers localhost/127.0.0.1/::1) - set this to your LAN hostname or static IP if you reach the box by either. |
GFMT_TLS_VALIDITY_DAYS |
825 | How long a generated self-signed cert is valid for. Defaults to Apple's ATS cap (Safari/iOS/macOS reject longer-lived certs even after you manually trust them) - raise it if you don't care about Safari. |
DEMO_MODE |
unset | Set to 1 for a public-showcase demo instance: every page shows fake data instead of a real account, and real Google sign-in and every outbound network call are disabled. |
The Config page also has fields for the query throttle and Apprise notification settings, applied immediately without a restart.
Caution
By default this is plain HTTP with no auth - meant for a trusted LAN (or behind your own reverse proxy/VPN if you need remote access), not exposed directly to the public internet. HTTPS_ENABLED=1 gets you transport encryption (see below), but self-signed TLS still isn't the same as a real reverse proxy or VPN for anything beyond casual LAN use.
- Set
HTTP_USER/HTTP_PASSWORDto gate the whole UI, including/docs(FastAPI's interactive API explorer) - it's one more route behind the same middleware, not a separate hole. - Set
HTTPS_ENABLED=1to serve HTTPS with an automatically generated, persisted self-signed certificate - no separate reverse proxy needed. Your browser will show a one-time "not trusted" warning the first time (expected for any self-signed cert, not a sign something's wrong) - accept/pin it, or pointGFMT_TLS_CERT_PATH/GFMT_TLS_KEY_PATHat a real cert instead if you have one. This defeats passive network snooping but gives no identity guarantee the way a CA-signed cert does. It's a toggle, not a dual mode - with it on, plainhttp://to the same port gets a connection reset, not a redirect. - Set
SECRETS_ENCRYPTION_KEYto encrypt credentials at rest instead of plain YAML. Back this up somewhere alongside (or independent of) yourGFMT_DATA_DIRvolume: it's not stored anywhere itself, and losing or changing it makes every already-encrypted value inauth.yamlpermanently unreadable - your only recovery is signing in again from scratch, not restoring the key. - Everything you'd want to back up - config, credentials, logs - lives in the one data directory you control; the on-demand ESP-IDF toolchain and build files (
GFMT_FIRMWARE_DIR) are entirely rebuildable and intentionally kept outside that mount. Nothing phones home except to Google's own APIs and (if you configure it) your Apprise notification targets.
The original scripts this project is built on still work standalone, without Docker or the web UI - useful for scripting or if you just want to query a device once.
Caution
Before starting, ensure Chrome and Python are up to date - if Chrome isn't current, this will not work.
- Clone this repository:
git cloneor download the ZIP file cd GoogleFindMyToolsWebUi- Optional: create/activate a venv (
python -m venv venv, thenvenv\Scripts\activateon Windows orsource venv/bin/activateon Linux/macOS) pip install -r requirements.txt- Install the latest Google Chrome
python main.py
On first run this walks you through the same Google sign-in as the web UI, storing the result in Auth/auth.yaml - copy that file to run on a headless machine without Chrome. (Upgrading from an older version that still has Auth/secrets.json migrates it automatically the first time it's read; the old file is left in place, untouched.) SECRETS_ENCRYPTION_KEY (see Configuration) applies here too.
- Add a new Bluetooth tracker via browser api
- Finish the live data scraper: battery level, wifi, wifi signal strength, force a phone update and any other data found via this api.
- AirTag support, with the help of a reverse-engineered locate app: AirtagAlex, demo video.
- Delete a device from the Google account (remove it from Find My Device), from the web UI.
