Remote access
At home, your phone reaches the hub over your local network. To use it from anywhere else, the phone needs a way to reach two things on the hub PC: the hub's web address, and the broker's phone listener.
What the phone connects to
| Connection | Default port | Used for |
|---|---|---|
| Hub, plain HTTP | 8765 (server.port) | Web UI and API on your local network. |
| Hub, HTTPS | your choice (server.ssl_bind_port) | Web UI and API with TLS. Optional. |
| Broker, phone listener | your choice, 1884 in the examples | Live log entries, states, feed nudges, and approval requests. |
The phone uses the hub address for lists, feeds, plugin pages, and crash reports, and the broker for everything that arrives live. Both need to be reachable for the hub to work fully.
Don't expose the broker's local anonymous listener (127.0.0.1:1883 in the examples) to the network. See MQTT and Mosquitto.
HTTPS on the hub
The hub can serve HTTPS itself, without a separate web server in front. Set all three of ssl_bind_port, ssl_cert_file, and ssl_key_file in the server block of config.json (and optionally ssl_bind_host), then restart the hub. The HTTPS listener serves the same web UI and API as the plain one.
"server": {
"host": "127.0.0.1",
"port": 8765,
"ssl_bind_port": 8443,
"ssl_cert_file": "/path/to/hub.crt",
"ssl_key_file": "/path/to/hub.key",
"external_host": "hub.example.com",
"external_scheme": "https"
}
With host set to 127.0.0.1, the plain HTTP listener stays on the hub PC and other devices use HTTPS only. external_host and external_scheme set the links the hub shows in its startup log entry.
A self-signed certificate works. LemmeKnow trusts the certificate it sees on its first connection and warns you if it ever changes. The same goes for the broker's TLS listener.
The app only sends crash reports to a hub address that starts with https://, because a report carries your access key. See Crash reports.
Ways to reach home
Pick whichever suits your network:
- A VPN. Your phone joins your home network (or a private network that includes the hub PC) and uses the same local addresses it uses at home. Nothing on the hub PC is open to the internet, which makes this the simplest safe choice.
- Port forwarding on your router. Forward the hub's HTTPS port and the broker's phone listener to the hub PC. Use TLS on both, and only forward those two ports.
- A reverse proxy. A web server in front of the hub handles TLS and forwards requests to it.
If the reverse proxy runs on the hub PC itself, every request it forwards arrives from the loopback address, which the hub treats as this PC. Set "local_admin": false in the server block in that case, or anyone reaching the proxy without a key would be signed in as the admin. Letting the hub serve HTTPS directly avoids this.
Keep the hub signed in
Before you open anything to the internet, make sure the hub has at least one user (see First run). Until then, anyone who reaches it may be treated as the admin.
Every remote request then needs a user's username and access key, or a signed-in web session. Webhooks have their own secrets. Failed and refused requests are recorded in the hub's User Authentication feed, which shows the caller's address and network and what credentials it sent. See Server feeds.