Skip to content
English
  • There are no suggestions because the search field is empty.

Deployment Guide

Who this is for: Operators deploying SandGrain, either on a single host or across separate machines.

What you'll learn: The deployment workflow for both topologies, how configuration is managed, and how to roll back.

Single-host deployment

Bring up the Docker stack, then launch the SDK on the same machine:

# 1) Start the TrustBridge stack 
./TrustBridge/TrustBridge-BE/start-all.sh up # or start-all.ps1 on Windows

# 2) Launch the SDK (cloud agent comes from the stack)
./run_all.sh --no-cloud # or run_all.ps1 --no-cloud

Or run components individually with run_gateway.sh / run_device.sh. For the full first-time walkthrough see SDK + TrustBridge on Windows or on Linux & macOS.

Split / Raspberry Pi topology

  • The laptop runs the Docker stack (BE, FE, Mosquitto, MySQL, Cloud SDK).
  • Pi #2 runs the Gateway (test_gw on :8080, no USB).
  • Pi #1 runs the Device (test_device plus the SandGrain USB chip).

Always start in this order: Laptop, then Pi #2 (Gateway), then Pi #1 (Device), so the device finds the gateway listening and the gateway finds the backend up. The worked example is Split Deployment on Raspberry Pi.

Environment preparation

  • Open the Windows firewall ports (3000 / 1883 / 5173).
  • Ensure all boxes share a subnet.
  • Find IPs with ipconfig (Windows) or ip -4 addr show / hostname -I (Linux).

Configuration management

Per-component env files carry the settings: .env, .env.gateway, .env.device. The Gateway derives BE_URL automatically and syncs its whitelist from the backend, so enrolling or removing devices doesn't require recompiling.

Rollback procedures

Command Effect
start-all.* down Stop everything; volumes preserved
start-all.* wipe Stop and wipe volumes; forces a re-seed on next start
start-all.* rebuild Forced --no-cache rebuild when an image is stuck on stale source

Related articles: SDK + TrustBridge on Windows · SDK + TrustBridge on Linux & macOS · Split Deployment on Raspberry Pi · Standalone Cloud SDK Deployment · Infrastructure, Monitoring & Security