Software Technology Tesla

How to Setup TeslaMate with Docker

In this article I am going to walk you through step by step on how to install and setup TeslaMate onto your Vultr Cloud Instance. From selecting your VM configuration to installing and configuring the tool onto your virtual machine. Looking for a guide on BuyVM? BuyVM Guide.

In this tutorial, I use Vultr because they have an ideal way of setting up a docker server with their preset image and getting started very quickly. I also like if you aren’t happy with TeslaMate you can easily destroy the cloud instance and go on with your day. However, see how far you can take it with the $100 in free credits (must use credits within 30 days)!

$100 in free credits
SSD VPS Servers, Cloud Servers and Cloud Hosting by Vultr

Easily deploy cloud servers, bare metal, and storage worldwide.

  • Cloud Compute, Bare Metal, Dedicated Cloud, Kubernetes
  • Receive $100 to test out the Vultr platform.
We earn a commission if you make a purchase, at no additional cost to you.

TeslaMate Features:

  • Drive and charging reports
  • Driving efficiency report
  • Energy Consumption (net / gross)
  • Charge Energy Added vs Energy Used
  • Vampire Drain
  • Projected 100% Range (Battery Degradation)
  • Charging Stats
  • Drive Stats
  • History of Installed Updates
  • See When Your Car Was Online or Asleep
  • Lifetime Driving Map
  • Visited Addresses

ALSO check the status of your car (inc. battery level) without waking your car up!

We will be following the developers advanced instructions due to the fact that we will be using a cloud instance, alternatively, you could install this on a Rasberry Pi or an extra computer you had lying around. I however like this option with Vultr due to being easy to re-produce for just about anyone.

Deploy New Instance

vultrplus20200413 | Graydon Schwartz
Mouse over the (+) plus sign and click on Deploy New Server

Choose Server: Cloud Compute

vultrchooseservercloudcompute20200413 | Graydon Schwartz
How to Setup TeslaMate with Docker 24

Server Location: Chicago (I selected Chicago but you can select whatever is best for you):

  • Atlanta, USA
  • New York (NJ), USA
  • Chicago, USA
  • Dallas, USA
  • Los Angeles, USA
  • Miami, USA
  • Seattle, USA
  • Silicon Valley, USA
  • Toronto, CANADA
  • Amsterdam, Netherlands
  • Paris, France
  • Frankfurt, Germany
  • London, UK
  • Tokyo, Japan
  • Singapore, Singapore
  • Sydney, Australia

Server Type: Application: Docker: On CentOS 7 x64 19.03.4-ce

vultrservertypeappdocker20200413 | Graydon Schwartz
How to Setup TeslaMate with Docker 25

Server Size: 25 GB SSD
$5.00/mo OR $0.007/h
1024MB Memory*
1000GB Bandwidth

vultrserversize20200413 | Graydon Schwartz
How to Setup TeslaMate with Docker 26

*Note: Docker requires a plan with at least 768MB of memory.

Click on Deploy Now!

vultrdeploynow20200413 | Graydon Schwartz
How to Setup TeslaMate with Docker 27

Click on Products!

vultrproducts20200413 | Graydon Schwartz
How to Setup TeslaMate with Docker 28
vultryourproducts20200413 | Graydon Schwartz
How to Setup TeslaMate with Docker 29

Server Information

vultrserverinfodocker20200413 | Graydon Schwartz
How to Setup TeslaMate with Docker 30

Download PuTTY

Enter the IP Address
and click on Open!

GUIDE: Advanced Docker install (Traefik, Let’s Encrypt, HTTPS, HTTP Basic Auth)

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Setup – docker-compose.yml

version: "3"

    image: teslamate/teslamate:latest
    restart: always
      - database
      - DATABASE_HOST=database
      - MQTT_HOST=mosquitto
      - CHECK_ORIGIN=true
      - TZ=${TM_TZ}
      - ./import:/opt/app/import
      - "traefik.enable=true"
      - "traefik.port=4000"
      - "traefik.http.middlewares.redirect.redirectscheme.scheme=https"
      - "traefik.http.middlewares.teslamate-auth.basicauth.realm=teslamate"
      - "traefik.http.middlewares.teslamate-auth.basicauth.usersfile=/auth/.htpasswd"
      - "traefik.http.routers.teslamate-insecure.rule=Host(`${FQDN_TM}`)"
      - "traefik.http.routers.teslamate-insecure.middlewares=redirect"
      - "traefik.http.routers.teslamate-ws.rule=Host(`${FQDN_TM}`) && Path(`/live/websocket`)"
      - "traefik.http.routers.teslamate-ws.entrypoints=websecure"
      - "traefik.http.routers.teslamate-ws.tls"
      - "traefik.http.routers.teslamate.rule=Host(`${FQDN_TM}`)"
      - "traefik.http.routers.teslamate.middlewares=teslamate-auth"
      - "traefik.http.routers.teslamate.entrypoints=websecure"
      - "traefik.http.routers.teslamate.tls.certresolver=tmhttpchallenge"
      - all

    image: postgres:13
    restart: always
      - teslamate-db:/var/lib/postgresql/data

    image: teslamate/grafana:latest
    restart: always
      - DATABASE_HOST=database
      - GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s/grafana

      - teslamate-grafana-data:/var/lib/grafana
      - "traefik.enable=true"
      - "traefik.port=3000"
      - "traefik.http.middlewares.redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.grafana-insecure.rule=Host(`${FQDN_TM}`)"
      - "traefik.http.routers.grafana-insecure.middlewares=redirect"
      - "traefik.http.routers.grafana.rule=Path(`/grafana`) || PathPrefix(`/grafana/`)"
      - "traefik.http.routers.grafana.entrypoints=websecure"
      - "traefik.http.routers.grafana.tls.certresolver=tmhttpchallenge"

    image: eclipse-mosquitto:2
    restart: always
    command: mosquitto -c /mosquitto-no-auth.conf
      - mosquitto-conf:/mosquitto/config
      - mosquitto-data:/mosquitto/data

    image: traefik:v2.4
    restart: always
      - "--global.sendAnonymousUsage=false"
      - "--providers.docker"
      - "--providers.docker.exposedByDefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.tmhttpchallenge.acme.httpchallenge=true"
      - "--certificatesresolvers.tmhttpchallenge.acme.httpchallenge.entrypoint=web"
      - ""
      - 80:80
      - 443:443
      - ./.htpasswd:/auth/.htpasswd
      - ./acme/:/etc/acme/
      - /var/run/docker.sock:/var/run/docker.sock:ro


Setup – .env




Setup – .htpasswd

As per the documentation for TeslaMate. I recommend you use this tool to create your .htpasswd file:
Enter your desired username, password and select Bcrypt (Apache v2.4 onwards)
In the example below, I entered username and password for these fields:



Now copy and paste this information into your .htpasswd file.

vi .htpasswd (or your favorite text editor)

Make sure you set up your password before you start the Teslamate with Docker!

docker-compose up

Note: You may need to run this command twice to get it work.

DNS Setup

You will need to point + (your subdomain) to the IP Address provided to you by Vultr when you created your virtual server. This is done by contacting your web host or logging into your control panel to manage your DNS records and having these entries added.

Logging Into TeslaMate

  1. Open the web interface
    Login with the details you entered into the .htpasswd file and then you will be prompted to log in with your Tesla Account.
  2. Sign in with your Tesla account
  3. The Grafana dashboards are available at:
  4. Enter username:password:admin:admin first and you will be prompted to change the password on your first login.

I spent $0.01 or 1 penny to test out Teslamate. $0.02 to complete the tutorial. 🙂

vultrdockercloudinstance | Graydon Schwartz
Vultr Control Panel

You can change from Celcius to Fahrenheit and Kilometers to Miles in the settings.

teslamatehomescreenfeb212020 | Graydon Schwartz
TeslaMate Home Screen

This is what the home screen looks like. You would also see a map with a pin on the location of your Tesla vehicle.

teslamatehomescreencharging1kwfeb212020 | Graydon Schwartz
5 mi/hr | 12A | 3kW

I went for a charge session at the closest regular 12a outlet to show what a charge session looks like with TeslaMate. Clean interface! 🙂

teslamatehomescreencharging3kwfeb212020 | Graydon Schwartz
13 mi/hr | 16A | 3kW
teslamatecharginggraph3kwfeb212020 | Graydon Schwartz
13 mi/hr | 16A | 3kW

March 10, 2020 Update

TeslaMate released an update to v1.17.1 about 16 days ago.

  • Add Trip dashboard: This dashboard was built to visualize longer trips. It provides an overview of all drives and charges that were logged over a period of several hours or days.
  • TeslaMate Release Page

I am excited to test out this new Trip dashboard added in the new release. This will be super helpful for Tesla road trips of course! 🙂

This is the documentation I used to build portions of this tutorial:

March 21, 2020 Update

How to use the new trip feature apart of Teslamate:

  1. Open the web interface
  2. Dashboards => Tap or click on “Trip
  3. Tap or click on “Today so far
  4. Select preset from “Last 5 minutes“, all the way to “Last 5 years” or custom date range selection.
teslamatehomescreenmarch212020 | Graydon Schwartz
TeslaMate Home Screen
teslamatehomescreenmarch212020 1 | Graydon Schwartz
Tap or mouse over “Dashboards
teslamatehomescreenmarch212020 2 | Graydon Schwartz
Tap or click on “Trip
teslamatehomescreenmarch212020 3 | Graydon Schwartz
Select preset from “Last 5 minutes“, all the way to “Last 5 years” or custom date range selection.
teslamatetriplast1yearmarch212020 | Graydon Schwartz
TeslaMate > Trip Example
teslamatehomescreenmarch212020 4 | Graydon Schwartz
TeslaMate > Trip Example (Closeup)

I hope you found this setup guide helpful. 🙂

| Graydon Schwartz

By Graydon Schwartz

Find out more about Graydon on the About Me page.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share to...