Get the Edge Server
The Write API and the outlet and Controller reads run on the Growbud Edge Server. Install it on a computer on your site. It keeps working when the internet is down.
Calls to the Edge Server are free. API costs apply to Growbud Cloud only.
Install on Linux or macOS: version 5.3.10
curl -fsSL https://growbud.io/edge/install.sh | sudo bashRun it on the Edge Server computer. Run it again to upgrade. For Windows, the files, the SHA-256 and the signature, go to Download Edge Server.
1. Check the computer
| Item | Need |
|---|---|
| CPU | 4 cores, x86-64 or ARM64 |
| Memory for Docker | 16 GB (8 GB for a test) |
| Free disk | 100 GB SSD (20 GB for a test) |
| Software | Docker Engine 24+ with Compose v2, or Docker Desktop 4.30+ |
| Network | A fixed IP address on your LAN |
2. Install
Run the command above. The installer:
- Downloads the latest release and checks its SHA-256 and signature.
- Installs it in
/opt/growbud-edge. - Starts the Edge Server and shows its address, for example
https://192.168.1.27:8443. - Shows the administrator email and password one time. Write them down.
3. Make an API token
On the Edge Server computer, make a token for the administrator. Add --scope control to let the token switch equipment:
cd /opt/growbud-edge
sudo docker compose exec outlets node /app/edge-outlets.mjs token create \
--email <administrator email> --name "My integration" --scope control
The command shows the token one time only. See Authentication for read-only tokens, expiry and revoking.
4. Send your first call
Add your outlets and Controllers in the Growbud app first. Then:
export TOKEN=eyJ...
export EDGE=https://192.168.1.27:8443
# Your outlets
curl -sk -H "Authorization: Bearer $TOKEN" "$EDGE/sensing/v1/outlets"
# Switch an outlet on, and wait up to 30 s for it to confirm
curl -sk -X POST -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"on": true}' "$EDGE/control/v1/outlets/f50be8ffff9ddd81/switch?wait=30"
The Edge Server uses a self-signed certificate. curl -k accepts it.
Upgrade
Run the install command again on the Edge Server computer:
curl -fsSL https://growbud.io/edge/install.sh | sudo bash
The installer:
- Downloads the latest release and checks its SHA-256 and signature.
- Saves both databases and the settings file (
.env) in/opt/growbud-edge/backups/. If the backup fails, it stops and changes nothing. - Keeps your settings, data, devices and API tokens.
- Starts the new version and updates the database.
Outlets and Controllers stop for a short time while the Edge Server restarts. They do not have to join again.
To see the version that runs now:
cat /opt/growbud-edge/VERSION
To go back to the previous version, use the backup. See the README in /opt/growbud-edge, section 8. Data that the Edge Server wrote after the upgrade is lost.
Next
- Outlets: switch an outlet, with or without retry.
- Controllers: switch a Controller output.
- Read API reference: every read call.