This repository contains scripts to run TeslaMate's PostgreSQL, MQTT, and Grafana using apple/container service stack.
-
Copy the configuration template:
cp config.sh.example config.sh
-
Edit the configuration file:
nano config.sh
Update the following values:
POSTGRES_PASSWORD: Set a secure database passwordENCRYPTION_KEY: Set a secure encryption key for TeslaMateCADDY_FROM_DOMAIN: Set your Tailscale domain or public domain
-
Set up container DNS:
- Configure your system to resolve
*.testdomains to containers - Set up Tailscale and its HTTPS cert (if using Tailscale)
- Configure your system to resolve
./run.sh./stop.shThe setup includes the following services:
- PostgreSQL Database (
tm-db.test) - MQTT Broker (
tm-mqtt.test) - TeslaMate Web Application (
tm-web.test) - Grafana Dashboard (
tm-grafana.test) - Caddy Reverse Proxy (routes external traffic to Grafana)
All sensitive configuration is stored in config.sh (ignored by git). The following variables can be configured:
POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB: Database credentialsENCRYPTION_KEY: TeslaMate encryption keyCADDY_FROM_DOMAIN: External domain for Caddy reverse proxy- Container names and network hosts
- The
config.shfile contains sensitive information and is excluded from version control - Copy
config.sh.exampletoconfig.shand customize for your environment - Never commit
config.shto version control