Setup guide
Install TeslaMateApi & connect Tezi
Tezi reads your data through TeslaMateApi — a small REST service that sits on top of your existing TeslaMate database. This guide adds it to your Docker stack in about ten minutes.
New to TeslaMate? Set up TeslaMate itself first, following the official Docker installation guide. Come back here once it's logging your drives.
01What you'll need
- A working TeslaMate instance running with Docker Compose.
- Access to its
docker-compose.ymland the machine it runs on. - Two values from your TeslaMate config: the database password and the
ENCRYPTION_KEY.
02Add the TeslaMateApi service
Open your existing docker-compose.yml (the one that runs TeslaMate) and add a new service alongside the others. It connects to the same database and mosquitto containers TeslaMate already uses.
docker-compose.yml — add under services:
teslamateapi: image: tobiasehlert/teslamateapi:latest restart: always depends_on: - database environment: - ENCRYPTION_KEY=your_teslamate_encryption_key # same as TeslaMate - DATABASE_USER=teslamate - DATABASE_PASS=your_database_password - DATABASE_NAME=teslamate - DATABASE_HOST=database - MQTT_HOST=mosquitto - TZ=Europe/Paris - API_TOKEN_DISABLE=false - API_TOKEN=choose-a-long-random-token ports: - 8080:8080
The two must-match values: DATABASE_PASS and ENCRYPTION_KEY have to be identical to the ones in your TeslaMate service, or TeslaMateApi can't read the database. If you don't use MQTT, you can drop the MQTT_HOST line.
03Protect it with a token
Setting API_TOKEN_DISABLE=false requires every request to carry a bearer token. Generate a long random one and keep it — you'll paste it into Tezi. For example:
Terminal
openssl rand -hex 32
Use the output as your API_TOKEN. Never expose TeslaMateApi to the internet without protection — see step 6.
04Start the service
From the folder containing your compose file, pull the image and bring it up:
Terminal
docker compose pull teslamateapi docker compose up -d teslamateapi
Check the logs if anything looks off: docker compose logs -f teslamateapi.
05Test the connection
Confirm the API answers on the machine itself. You should get JSON listing your car(s):
Terminal
curl -H "Authorization: Bearer your-api-token" \
http://localhost:8080/api/v1/cars
A JSON response with your vehicle means TeslaMateApi is working. A 401 means the token is wrong; an empty or error response usually points to a database credential mismatch (step 2).
06Reach it from your iPhone
Pick whichever fits how you use your phone. Tezi supports all three:
| Access | How | Auth in Tezi |
|---|---|---|
| Home network | Use your server's LAN address, e.g. http://192.168.1.20:8080. Best for use at home. | Bearer token |
| Remote (VPN) | Connect over Tailscale / WireGuard, then use the server's VPN address. Private and simple. | Bearer token |
| Remote (public) | Put it behind a reverse proxy (Traefik / Nginx) with HTTPS, or Cloudflare Access. Never expose port 8080 raw. | Bearer, Basic, or Cloudflare Access |
iOS 18 tip: the first time Tezi reaches a device on your local network, iOS asks for permission — tap Allow so it can connect.
07Add the server in Tezi
- Open Tezi and tap Add server.
- Paste your server URL (including
http://orhttps://and the port). - Choose Bearer token and paste the
API_TOKENfrom step 3 — or Basic / Cloudflare Access if that's how you secured it. - Tap Test connection, then save. Your vehicles load automatically.
That's it — your entire TeslaMate history is now in your pocket. Prefer to look around first? Tap Explore the demo on Tezi's welcome screen, no server required.
Stuck on a step? Email tezi@leyad.net — happy to help. Full API reference lives at the TeslaMateApi project.