Skip to main content

Install the Private Relay

There are two ways to run it. Both are the same relay with the same panel.

  • As a Home Assistant app if you run Home Assistant OS or Supervised. The panel opens in Home Assistant's sidebar and MQTT is set up for you.
  • With Docker on anything else: a home server, a NAS, a small VPS.

As a Home Assistant app​

  1. In Home Assistant's app store, click ⋮ → Repositories, add

    https://github.com/getciconia/relay

    and close the dialog.

  2. Find Ciconia Private Relay in the store and click Install. The image is pre-built for 64-bit ARM (Raspberry Pi 4 and 5) and x86-64, so this takes about a minute.

  3. Click Start, and turn on Show in sidebar.

  4. Open Ciconia Private Relay in the sidebar.

For Home Assistant to show your trackers by itself, install the Mosquitto broker app too, start it, and accept the MQTT integration Home Assistant offers under Settings → Devices & services. Then restart the Private Relay app. See Home Assistant and Loxone.

App options​

OptionWhat it does
Keep positions (days)Older positions are deleted. Each tracker's latest one is always kept. Default 7.
Log packetsLogs every packet as hex, to see exactly what a tracker sends.
Home Assistant through MQTTOn by default: uses the Mosquitto broker app when it's installed.
MQTT broker, user name, passwordAnother broker instead of the Mosquitto app, e.g. mqtt://192.168.1.10:1883.
Names for the TLS certificateNames or IP addresses trackers use for this machine, put in the self-signed certificate.
Certificate file, Key fileYour own certificate for port 7172, from /ssl.
Map tilesTile address for the panel's maps; OpenStreetMap by default.

With Docker​

Get the source and start it with Docker Compose:

git clone https://github.com/getciconia/relay.git ciconia-private-relay
cd ciconia-private-relay
docker compose up -d

Then open http://<your server>:8080.

Ports already taken? Pick others: RELAY_TRACKER_PORT=7271 RELAY_TRACKER_TLS_PORT=7272 RELAY_PANEL_PORT=8081 docker compose up -d.

No tracker at hand yet? docker compose --profile demo up -d also starts three simulated trackers. They show up under Waiting to be added; add them and watch them move. docker compose --profile demo down stops them.

Everything is configured with environment variables: the full list is in the relay's configuration reference. The data lives in /data/relay.db on the container's volume.

Open the tracker port​

Your trackers are on the mobile network, so they need to reach the relay from the internet.

PortWhatOpen to
7171Trackers over TCPThe internet
7172Trackers over TLSThe internet
8080Panel, Home Assistant, LoxoneYour home network only
  • At home: forward 7171 or 7172 (or both) in your router to the machine running the relay. Use a dynamic DNS name if your public address changes.
  • On a VPS: allow 7171 or 7172 in its firewall.
Never open port 8080 to the internet

The panel has no password. Anyone who can reach it can see and change your trackers. Keep it on your home network, or behind a VPN if you run the relay on a VPS.

The tracker ports are built to face the internet: the relay limits connections per address, closes connections that don't introduce themselves within 15 seconds, and refuses every tracker you haven't added.

TLS​

Port 7172 takes the same tracker connection inside TLS 1.2 or newer.

  • By default the relay makes a self-signed certificate on its first start. The panel shows it, with its fingerprint, under Integrations → Trackers. Put the names or IP addresses trackers use for your relay in Names for the TLS certificate (RELAY_TLS_HOSTS in Docker) before the first start.
  • Or use your own (recommended for Ciconia trackers), for example from Let's Encrypt: set Certificate file and Key file (RELAY_TLS_CERT and RELAY_TLS_KEY in Docker). The relay picks up a renewed certificate by itself.

Updating​

  • Home Assistant app: Home Assistant shows the update under Settings. Click Update.
  • Docker: git pull && docker compose up -d --build.

Your trackers, areas and connections are kept.

Next​

Add your trackers.