Video coming soon…
📡 Setup TeslaMate — Self-Hosted Tesla Data Logger
Deploy TeslaMate on Ubuntu with Docker — a powerful data logger for your Tesla that records drives, charging, efficiency, and location over time on your own server, on port 4321.
⚠️ This script is provided for demo and testing purposes only. Not intended for production use.
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/iot/teslamate/teslamate-ubuntu.sh
chmod +x teslamate-ubuntu.sh
sudo bash teslamate-ubuntu.sh
Tutorial Steps
1 Download the Script
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/iot/teslamate/teslamate-ubuntu.sh
2 Make it Executable
chmod +x teslamate-ubuntu.sh
3 Run the Installer
The script installs Docker if needed and starts TeslaMate with its PostgreSQL database and a Mosquitto MQTT broker on port 4321. It generates an encryption key to protect your Tesla tokens; you sign in on first visit.
sudo bash teslamate-ubuntu.sh
4 Open the Web UI and Sign In to Tesla
Open TeslaMate and sign in with your Tesla account (or an API token) to link your vehicle and begin logging its data:
http://<your-server-ip>:4321
Ports Used
| Port | Purpose |
|---|---|
| 4321 | Web UI (host → container 4000) — sign in with Tesla on first visit |
| PostgreSQL + MQTT | Internal — your data, plus a bundled Mosquitto broker |
| encryption key | Generated — protects your Tesla tokens; back it up |