selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

TeslaMate logo

Self-host TeslaMate

v4.4.0

Tesla drive-data logger with Grafana dashboards and MQTT

ReleaseOpen SourceAGPL-3.0
Docker ComposeCompose file & guide
docker compose up -d
Updated2 weeks ago
LanguageElixir
Setup difficultyModerate
ThemeDark mode
Stars
9 247
RAM
At least 1 GB of RAM
Port
4000 (TeslaMate web interface)
Docker
teslamate/teslamate
TeslaMate web interface with the logged carsOverview dashboard of the current vehicle stateDrive details dashboard with route and consumptionBattery health dashboard showing degradation over timeCharging statistics dashboardLifetime driving map of visited locations

What is TeslaMate?

TeslaMate alternatives

Should you self-host TeslaMate?

TeslaMate scores 74/100 on selfhost.directory (how scoring works) and ranks #1 of 5 in Vehicle Management. It has 9 247 GitHub stars, +166 in the last 30 days.

It shipped 9 stable releases in the past year. The latest, v4.4.0, came out on 23 October 2026. New versions land roughly every 2 weeks.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is AGPL-3.0-licensed and written mostly in Elixir.

Its closest alternative on selfhost.directory is LubeLogger (66/100, 2 955 stars). TeslaMate scores higher overall. See TeslaMate vs LubeLogger side by side.

Features

  • Automatic address lookup
  • Battery-friendly sleep handling
  • Bundled Grafana dashboards
  • Charge Cost Tracking
  • Estimated consumption valuesEstimates only, refined by every future charge session.
  • Geo-fencing / custom locations
  • Home Assistant MQTT discovery
  • Import from other Tesla loggers
  • MQTT data publishing
  • Multilingual UI
  • Multi-Vehicle Support
  • Public API / direct database access
  • Web management interface

TeslaMate README

TeslaMate

License OpenSSF Best Practices CI Publish Docker images Coverage current version docker image size docker pulls

A powerful, self-hosted data logger for your Tesla.

  • Written in Elixir
  • Data is stored in a Postgres database
  • Visualization and data analysis with Grafana
  • Vehicle data is published to a local MQTT Broker

⚠️ Security Warning

Caution

Use Official Versions Only

To protect yourself from malicious forks, malware, and data theft, please ensure you only obtain TeslaMate from the official source:

We have received reports of deceptive websites and unofficial mobile apps (e.g. on the App Store) using the TeslaMate name to distribute modified or harmful versions. If you are using a version from another source, your Tesla account credentials and vehicle data may be at risk.

Documentation

The documentation is available at https://docs.teslamate.org

Features

General
  • High precision drive data recording
  • No additional vampire drain: the car will fall asleep as soon as possible
  • Automatic address lookup
  • Easy integration into Home Assistant (via MQTT)
  • Easy integration into Node-Red & Telegram (via MQTT)
  • Geo-fencing feature to create custom locations
  • Supports multiple vehicles per Tesla Account
  • Charge cost tracking
  • Import from TeslaFi and tesla-apiscraper
  • Customizable theme mode (light, dark, or system default)
  • Web interface in 19 languages (Catalan, Danish, Dutch, English, Finnish, French, German, Hungarian, Italian, Japanese, Korean, Norwegian Bokmål, Simplified Chinese, Spanish, Swedish, Thai, Traditional Chinese, Turkish, Ukrainian); untranslated text falls back to English
Dashboards

Sample screenshots of bundled dashboards can be seen by clicking the links below.

Screenshots

Sneak peak into TeslaMate interface and bundled dashboards. See the docs for additional screenshots.

Web Interface

Drive Details

Battery Health

License

TeslaMate is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See NOTICE for the copyright notice, the additional terms under section 7 of the AGPL, and the trademark notice. For the full legal terms, please refer to the LICENSE file.

This license is designed to ensure that TeslaMate remains free and open for everyone and that improvements made by commercial entities or third parties remain open to the entire community. By using, modifying, or building upon this project, you agree to the following:

  • Copyleft: If you modify TeslaMate or incorporate it into another project, you must release the entire source code of your version under the same license (AGPL-3.0-or-later). This applies regardless of how you provide the software to others, in any form, including, without limitation, as a downloadable application, a binary, a package, a pre-packaged image, or a network service (SaaS).
  • No Closed-Source Derivatives: We do not permit the use of TeslaMate or its components in closed-source products. Any software made to work with TeslaMate, including, without limitation, apps, dashboards, integrations, and services, must be open-source under an AGPL-compatible license. Software that integrates with TeslaMate may do so only via the supported integration surface (MQTT). If you build upon this project, you are expected to contribute back to the community.
  • Attribution: You must keep all original copyright notices, the NOTICE file, and license information intact, and clearly mark modified versions as modified.

Trademark Policy: The use of all trademarks of the TeslaMate project is governed by our Trademark Policy.

Disclaimer: TeslaMate is an independent project and is not affiliated with, endorsed by, or sponsored by Tesla, Inc. "Tesla" and related marks are trademarks of Tesla, Inc.

Contributions: All contributors must sign our Fiduciary License Agreement (FLA 2.0). This is handled via cla-assistant.io automatically on first PR and does not take long. Why do we need this? It guarantees that TeslaMate will always remain Free Software and allows the teslamate-org to legally defend the project against license violations.

Popularity

teslamate-org/teslamate on Trendshift

Star History Chart

How to install TeslaMate

Install TeslaMate with Docker Compose

Docker
Environment variables
ENCRYPTION_KEY, DATABASE_USER, DATABASE_PASS, DATABASE_NAME, DATABASE_HOST, MQTT_HOST
  1. Create a docker-compose.yml defining the teslamate, database, grafana and mosquitto services as shown in the docs.
  2. Pick a secure value for ENCRYPTION_KEY (it encrypts your Tesla API tokens) and use the same strong database password everywhere DATABASE_PASS and POSTGRES_PASSWORD appear.
  3. Start the stack:
docker compose up -d
  1. Generate an access and refresh token, open http://your-ip-address:4000, and enter both tokens on the sign-in page; then set the Web App and Dashboards URLs under Settings so TeslaMate and Grafana link to each other.

Recommended for home networks; for internet access the docs suggest a VPN/tunnel or a hardened reverse proxy (Traefik, Apache2 or Caddy guides). Docker images cover aarch64 and amd64; Raspberry Pi needs a 64-bit OS on ARMv8 (Raspberry Pi 3 or newer) because armv7 is no longer supported. Manual Debian, FreeBSD and Unraid installs are listed as unsupported.

How to configure TeslaMate

  • ENCRYPTION_KEYKey used to encrypt the stored Tesla API tokens; required
  • DATABASE_USERDatabase username (also used for socket connections needing password auth)
  • DATABASE_PASSDatabase user password
  • DATABASE_NAMEThe database to connect to
  • DATABASE_HOSTHostname of the database server

TeslaMate releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

Does TeslaMate have a public API? Can I read the database directly?

No public API exists and the PostgreSQL schema is internal storage with no compatibility promise; MQTT is the only supported integration surface. The web UI routes are not an API either.

Which network flows must be authorized?

For hardened setups only HTTPS (TCP/443) to the Tesla auth, owner API and streaming hosts plus OpenStreetMap Nominatim, and HTTP (TCP/80) to step.esa.int, needs egress plus DNS.

Why am I missing data when not using the Streaming API?

In polling mode TeslaMate suspends polling about 3 minutes after the car goes idle and only resumes 15 minutes later, so activity in that window cannot be detected without resetting the inactivity timer.

Help, my car does not fall asleep

Turn off accessory power in the car's charging settings, and on MCU1 vehicles enable energy saving and disable always-connected and cabin overheat protection. Running another logger such as TeslaFi at the same time also keeps the car awake.

How can I reorder my cars?

On the Settings page, under General Settings, use Move up or Move next to a car in the Car Order list.

Why are my Docker timestamp logs different than my machine?

Containers default to UTC; set the TZ environment variable in your compose file to get local log times.

What is the geo-fence feature for?

Geo-fences let you define custom locations like home or work, useful where OpenStreetMap addresses are inaccurate or you street-park.

Why is "null" displayed above the panels in Grafana?

The car name is empty in the database, so the Grafana car_id variable resolves to null. Name the car on the touchscreen and let TeslaMate sync it.

Why are no consumption values displayed in Grafana?

The Tesla API gives no per-trip consumption, so TeslaMate derives estimates from charging data. At least two qualifying charge sessions are needed before the first value appears.

TeslaMate stopped recording data. How can I fix it?

Check the logs to see whether Tesla, the database or new credentials are the problem, then generate fresh tokens and sign in again. Missed drives and charges cannot be recovered, though a TeslaFi import may fill the gap.

My car does not show up in TeslaMate

Use Reload vehicles on the car overview or the Settings page, since the vehicle list is only read at start-up; if nothing new appears the car is not yet in your Tesla account or data collection is disabled.

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…