Setup Guide

Expose TeslaMate Database

To allow Teslatlas to connect to your data over your local network, you need to map the database container's internal port to your host machine.

1. Edit docker-compose.yml

Locate the database service block in your docker-compose.yml file. You need to add the ports section to map the internal database port to your host.

Original database block:
database: image: postgres:18-trixie restart: always environment: - POSTGRES_USER=teslamate - POSTGRES_PASSWORD=password #insert your secure database password! - POSTGRES_DB=teslamate volumes: - teslamate-db:/var/lib/postgresql
Updated database block (Add ports):
database: image: postgres:18-trixie restart: always environment: - POSTGRES_USER=teslamate - POSTGRES_PASSWORD=password #insert your secure database password! - POSTGRES_DB=teslamate ports: - "5432:5432" volumes: - teslamate-db:/var/lib/postgresql
Note: This binds port 5432 on all available network interfaces (0.0.0.0) on the host machine.

2. Apply Changes

Run the following command in the directory containing your docker-compose.yml to recreate the container with the new port mapping:

docker-compose up -d

3. Verify Connectivity

Your TeslaMate database is now accessible from your iPhone on the same network. You can verify the connection during the app onboarding process.

  • Host: Your server's IP (e.g., 192.168.1.50)
  • Port: 5432
  • User: teslamate
  • Password: The database password from your .env file
  • Database: teslamate
Firewall Note: If your host machine runs a firewall (like ufw on Ubuntu), ensure port 5432 is allowed:
sudo ufw allow 5432/tcp