Server
The Server page groups controller-level configuration and connectivity into six tabs: General (operational flags and site identity), Email (outbound SMTP), SMS (outbound text alerts), Network & Database (read-only connection info), SSL / TLS (HTTPS certificates), and Tunnel (the reverse connection to the cloud orchestrator).
The General, Email, SMS, and Network tabs edit sections of the on-disk gem.json configuration file. Saves are atomic (written to a temporary file and renamed) and only touch the keys exposed in the form, so unrelated gem.json sections are preserved. Some changes — server ports, the REST API toggle, SMTP server/credentials — take effect only after a restart.
:::info Secrets are write-only
Passwords and API keys are never sent back to the browser. Each secret field shows only whether a value is currently set (•••••••• (unchanged)) and is left blank on load. Leave it blank to keep the stored value; type a new value only to replace it.
:::
General
The General tab edits operational flags and site identity stored in gem.json.
| Setting | Description |
|---|---|
| Start Offline | Start GEM even if devices are unreachable |
| REST API | Enable the /api endpoints (takes effect after restart) |
| Device Alerts | Email when a device goes offline |
| Alert Threshold | Consecutive monitor failures before a device alert is sent |
| Start Alert | Email when GEM starts |
| Failed Start Alert | Email when startup fails |
| Monitor Alert | Email on monitor (ping) state changes |
| External URL | Public URL used in notifications and links |
| Location | Site location used for weather and sunrise/sunset |
Click Save to write the section back to gem.json.
Email
The Email tab configures the outbound SMTP server used for alerts and notifications.
| Field | Description |
|---|---|
| SMTP Host | Mail server hostname |
| Port | SMTP port (e.g. 587 for STARTTLS, 465 for implicit TLS) |
| Secure Connection | Use implicit TLS (SMTPS) |
| Username | SMTP authentication user |
| Password | SMTP authentication password (write-only — leave blank to keep current) |
| From Address | Envelope/from address for outbound mail |
| Default Recipient | Default destination for alert emails |
Server and credential changes take effect after a restart.
SMS
The SMS tab configures outbound text alerts via Telnyx.
| Field | Description |
|---|---|
| From Number | Sending number in E.164 format (e.g. +15551234567) |
| Default Recipient | Default destination number |
| Telnyx API Key | Telnyx API key (write-only — leave blank to keep current) |
If gem.json specifies a non-Telnyx provider, that provider is reported as read-only here and must be managed directly in gem.json.
Network & Database
The Network & Database tab is read-only. It displays the listen port and database connection (dialect, host, port, name, user) read from gem.json at boot.
The database connection is not editable from the admin UI — an incorrect value could prevent GEM from starting. Change these settings directly in gem.json and restart.
SSL / TLS
The SSL / TLS tab manages HTTPS certificates for secure browser connections to GEM. GEM uses a self-signed Certificate Authority (CA) to issue certificates, providing enterprise-grade encryption without dependency on external certificate providers.
Overview
GEM's SSL implementation:
- Self-Signed CA: GEM creates its own Certificate Authority
- Automatic Certificates: Server certificates generated automatically
- Subject Alternative Names (SANs): Includes all detected IP addresses
- Auto-Renewal: Certificates regenerate on expiry or IP changes (when enabled)
- Easy Device Trust: One-time CA installation on each device
Certificate Status
The status section displays current certificate information:
SSL Status
- Enabled: HTTPS is active, HTTP redirects to HTTPS
- Disabled: HTTP only (no encryption)
CA Certificate
- Generated: Certificate Authority is created
- Not Generated: SSL not configured (enable and restart to create)
Server Certificate
- Generated: Server certificate is active
- Not Generated: Server certificate not created
Expiration
- Expires: Certificate expiration date
- Days remaining: Countdown to expiration
- ⚠️ Warning: Shows in red when < 30 days remaining
IP Match
- OK: Certificate SANs match current server IPs
- IPs Changed: Server IP addresses changed since certificate creation
- Certificate should be regenerated to match new IPs
- Clients may see warnings when connecting via new IPs
SANs (Subject Alternative Names)
Lists all IP addresses and hostnames included in the server certificate:
192.168.1.100, 10.0.0.50, gem-server.local
Browsers check this list when connecting via HTTPS.
Configuration
Enable SSL
Toggle Enable SSL to activate/deactivate HTTPS.
When Enabled:
- Server listens on HTTPS port (default: 443)
- HTTP port redirects to HTTPS
- Certificates are generated on first restart
- Client devices can access via HTTPS
When Disabled:
- Server listens on HTTP port only
- No encryption or certificate validation
- Simpler configuration for local-only installations
HTTPS Port
Port for encrypted connections (default: 443)
Common Ports:
- 443: Standard HTTPS (requires root/admin privileges)
- 8443: Alternative HTTPS (no special privileges needed)
- 9000: Custom port
Firewall: Ensure chosen port is open in firewall.
HTTP Port
Port for unencrypted connections (default: 80)
Uses:
- CA certificate download (works without trust)
- Redirect to HTTPS
- Initial setup before devices trust CA
Auto-Regenerate
When enabled, GEM automatically regenerates certificates when:
- Certificate approaches expiration (< 30 days)
- Server IP addresses change
- Hostname changes
Recommended: Enabled (default)
Prevents expired certificates and IP mismatch issues.
Saving Configuration
- Save: Saves configuration only
- Save & Restart: Saves and restarts GEM to apply changes
SSL changes require a restart to take effect.
CA Certificate Download
Why Download the CA Certificate?
Each client device (browser, tablet, phone) must trust GEM's CA certificate to:
- Avoid browser security warnings
- Enable secure HTTPS connections
- Allow embedded webviews to load
One-Time Setup: Each device installs the CA once. Future server certificate renewals work automatically.
Download Formats
PEM Format (.pem):
- Text-based format
- Use for: macOS, Linux, Chrome, Firefox
- View in text editor
DER Format (.crt):
- Binary format
- Use for: Windows, iOS, Android
- Double-click to install
HTTP Download URL
When SSL is enabled, GEM serves the CA certificate over HTTP:
http://192.168.1.100:80/ssl/ca.pem
http://192.168.1.100:80/ssl/ca.crt
Why HTTP?: Devices can download without already trusting the certificate (chicken-and-egg problem).
Installation Instructions
The page provides platform-specific installation guides:
iOS / iPadOS
- Open Safari and navigate to
http://<server-ip>:<http-port>/ssl/ca.pem - Tap "Allow" when prompted to download profile
- Open Settings > General > VPN & Device Management
- Tap "GEM Local CA" profile and install
- Go to Settings > General > About > Certificate Trust Settings
- Enable full trust for "GEM Local CA"
Important: Must use Safari, not Chrome or other browsers.
Android
- Download the .crt file from
http://<server-ip>:<http-port>/ssl/ca.crt - Open Settings > Security > Encryption & credentials
- Tap "Install a certificate" > "CA certificate"
- Select the downloaded gem-ca.crt file
- Confirm installation
Note: Steps vary slightly by Android version and manufacturer.
Windows
- Download the .crt file
- Double-click the file
- Click "Install Certificate"
- Select "Local Machine" and click Next
- Select "Place all certificates in the following store"
- Click Browse and select "Trusted Root Certification Authorities"
- Click Next and Finish
Requires: Administrator privileges
macOS
- Download the .pem file
- Double-click to open in Keychain Access
- Add to the "System" keychain
- Find "GEM Local CA" in the certificate list
- Double-click, expand "Trust"
- Set to "Always Trust"
- Close and authenticate with password
Ubuntu / Debian
Terminal commands:
# Download CA certificate
wget http://192.168.1.100:80/ssl/ca.crt -O gem-ca.crt
# Install system-wide
sudo cp gem-ca.crt /usr/local/share/ca-certificates/gem-ca.crt
sudo update-ca-certificates
# For Chrome browser
certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n "GEM Local CA" -i gem-ca.crt
# For Firefox
# Import via Settings > Privacy & Security > Certificates > View Certificates > Import
Copy Commands: Click Copy Commands button to copy to clipboard.
Certificate Management
Regenerate Server Certificate
Creates a new server certificate signed by the existing CA.
When to Use:
- Certificate expiring soon
- IP addresses changed
- Hostname changed
- SANs need updating
Impact:
- Devices already trusting CA: No action needed
- New certificate is trusted automatically
- No client device reconfiguration
Process:
- Click Regenerate Server Cert
- New certificate generated with current IP addresses
- Server certificate updated
- Restart may be required
Regenerate All Certificates
Creates a new CA and server certificate.
When to Use:
- CA certificate compromised
- Starting fresh
- CA certificate expiring (rare, usually 10-year validity)
Impact:
- All devices lose trust
- Must re-install new CA on all devices
- Significant reconfiguration effort
Process:
- Click Regenerate All
- Confirmation dialog warns about impact
- Click Regenerate All to confirm
- New CA and server certificates created
- Download new CA certificate
- Re-install on all client devices
Important: Only use when absolutely necessary. Server-only regeneration is preferred.
Common Workflows
Initial SSL Setup
- Navigate to System > Server and open the SSL / TLS tab
- Enable Enable SSL
- Configure ports (443/80 recommended)
- Enable Auto-Regenerate
- Click Save & Restart
- Wait for GEM to restart
- Download CA certificate (both .pem and .crt)
- Install on all client devices
- Access GEM via
https://<server-ip>
Adding a New Client Device
- On the new device, navigate to
http://<server-ip>:<http-port>/ssl/ca.pem(or .crt) - Follow platform-specific installation instructions
- Access GEM via HTTPS
- Verify no security warnings
Server IP Address Changed
If Auto-Regenerate Enabled:
- GEM detects IP change
- Automatically regenerates server certificate
- Restarts server
- Devices continue working (same CA)
If Auto-Regenerate Disabled:
- Access shows "IP Changed" warning
- Manually click Regenerate Server Cert
- Server certificate updated with new IPs
- Access via new IP works without warnings
Certificate Expiring Soon
If Auto-Regenerate Enabled:
- Certificate automatically renews when < 30 days remaining
- No manual intervention needed
If Auto-Regenerate Disabled:
- Status shows expiry warning
- Click Regenerate Server Cert
- New certificate issued with extended validity
Security Considerations
Self-Signed vs. Public CA
Self-Signed (GEM's Approach):
- ✅ No external dependencies
- ✅ Works offline
- ✅ No recurring costs
- ✅ Full control
- ⚠️ Requires manual trust installation
- ⚠️ Not trusted by default
Public CA (Let's Encrypt, etc.):
- ✅ Trusted by default
- ✅ No manual installation
- ⚠️ Requires public DNS
- ⚠️ Requires internet connectivity
- ⚠️ External dependency
- ⚠️ Not suitable for local-only networks
GEM's Choice: Self-signed is appropriate for local automation systems.
CA Key Security
The CA private key is the most sensitive component:
Protection:
- Stored with restrictive file permissions
- Not exposed via web interface
- Not included in backups by default
Compromise Scenarios:
- Physical server access
- Backup file theft (if included)
- Root-level system compromise
If Compromised:
- Regenerate all certificates
- Re-install CA on all devices
- Review access logs
- Investigate breach source
HTTPS Benefits
- Encryption: All traffic encrypted in transit
- Authentication: Verifies server identity
- Integrity: Prevents man-in-the-middle attacks
- Compliance: Required for many security standards
HTTP Fallback
GEM keeps HTTP port active even with SSL enabled:
Use Cases:
- CA certificate download
- Initial setup
- Troubleshooting
Security Note: HTTP port only serves:
- CA certificate
- Redirect to HTTPS
Configuration and control interfaces require HTTPS.
Troubleshooting
Browser Shows "Not Secure" Warning
Causes:
- CA certificate not installed on this device
- Wrong CA certificate installed
- Certificate expired
- IP mismatch
Solutions:
- Download and install current CA certificate
- Verify certificate is "GEM Local CA"
- Check expiration date in certificate status
- Regenerate server certificate if IPs changed
Mobile App Can't Connect
Symptoms: App shows connection error or certificate warning
Solutions:
- Install CA certificate using platform instructions
- Verify HTTPS port is accessible (firewall)
- Confirm Auto-Regenerate is enabled
- Check if accessing via IP in SANs list
Certificate Installation Fails
iOS: Must use Safari browser, not Chrome Android: May need to set screen lock PIN first Windows: Need administrator privileges macOS: Must authenticate with password
"NET::ERR_CERT_COMMON_NAME_INVALID"
Cause: Accessing via IP not in certificate SANs
Solutions:
- Access via an IP in the SANs list
- Regenerate server certificate to add current IPs
- Enable Auto-Regenerate to prevent recurrence
Regenerate Button Disabled
Cause: No CA certificate exists yet
Solution: Enable SSL and restart to generate initial certificates
Advanced Topics
Multiple Network Interfaces
GEM automatically detects all network interfaces:
- Ethernet
- Wi-Fi
- VPN interfaces
- Docker bridges (if applicable)
All IPs are included in server certificate SANs.
Excluding Interfaces: Not currently configurable. All IPs are included.
Custom Hostnames
Add custom hostname to certificate:
- Configure DNS or hosts file:
gem-server.local→ server IP - Regenerate server certificate (auto-includes hostname)
- Access via
https://gem-server.local
Certificate Validity Period
- CA Certificate: 10 years
- Server Certificate: 2 years
Auto-regenerate renews server certificate when < 30 days remain.
Port Conflicts
Port 443 Already in Use:
- Another service is using HTTPS port
- Choose alternative port (8443, 9000)
- Update firewall rules
Port 80 Already in Use:
- Another web server is running
- Choose alternative HTTP port
- Update CA download URLs in documentation
Firewall Configuration
Open required ports in firewall:
iptables (Linux):
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
firewalld (RHEL/CentOS):
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --reload
ufw (Ubuntu):
sudo ufw allow 443/tcp
sudo ufw allow 80/tcp
Best Practices
-
Enable Auto-Regenerate: Prevents expiration and IP mismatch issues
-
Document CA Installation: Create site-specific installation guide for technicians
-
Test on All Platforms: Verify CA installation process on all client device types
-
Backup CA Certificate: Download and store CA certificate in documentation
-
Monitor Expiration: Even with auto-regenerate, monitor expiration dates
-
Use Standard Ports: 443/80 unless there's a conflict
-
Secure Server Access: Protect physical and remote access to GEM server
-
Update Documentation: When regenerating all certificates, update client documentation
Tunnel
The Tunnel tab controls the reverse connection from this controller to the cloud orchestrator. The tunnel is a single persistent outbound WebSocket that lets the orchestrator reach the controller for remote management without any inbound port forwarding or public IP.
How it works
The controller initiates the connection outbound, so nothing needs to be opened on the site firewall. The connection binding — orchestrator URL, tenant, and a short-lived rotating token — is delivered automatically inside the signed update check; the controller does not store long-lived credentials. You normally only decide whether the tunnel runs.
Enable Tunnel
Toggle Enable Tunnel to start or stop the connection. Changes take effect immediately — no restart required. Disabling stops the active tunnel; re-enabling reconnects and fetches a fresh token on the next update check.
The toggle is backed by the tunnel system attribute. When no attribute is set, the tunnel defaults to on.
Status
The status panel reflects the live transport:
- State: Connected, Connecting, Reconnecting, Waiting (enabled but no binding yet), Disabled, or Identity Fail
- Connected: whether the WebSocket is currently established
- Identity Pinned: whether the orchestrator's public key is pinned and verified. Unpinned means the orchestrator's identity is not cryptographically verified — set
orchestrator_pubkeyto pin it - Orchestrator URL / Tenant / Site: the active binding
- Active Streams: in-flight multiplexed requests
- Last Connected / Reconnect In: connection age and current backoff
- Config Source: whether the effective config came from
gem.jsonor thetunnelsystem attribute - Last Error / Reconcile Error: most recent transport or reconciliation failure
Refresh re-reads the status on demand; the panel also polls periodically.
Advanced
Advanced binding overrides — orchestrator url, tenant_id, and pinned orchestrator_pubkey — are set on the tunnel system attribute under System → Attributes. The attribute is a single JSON object that fully overrides the gem.json tunnel block, so include every field you need:
{ "enabled": true, "url": "wss://tunnel.example.com", "tenant_id": "…", "orchestrator_pubkey": "…hex…" }
A read-only Orchestrator Tunnel dashboard widget shows the same status at a glance; add it from the admin dashboard's Customize editor.
Related Documentation
- Backup & Restore - Certificate backup considerations
- Users - User authentication over HTTPS
- Access Control - HTTPS access policies
- Attributes - Editing the
tunnelsystem attribute