Configuring the Data Gateway for Boot

The Data Gateway can be configured to start automatically when its host starts up. The exact steps depend on the operating system.

circle-exclamation

Linux

systemd is the standard service manager on modern Linux distributions (Ubuntu, Debian, RHEL, Fedora, etc.) and is the recommended approach for production deployments. It handles automatic restart on failure and integrates with the system journal.

Create a new service file:

sudo nano /etc/systemd/system/lumi-data-gateway.service 

Add the following content, substituting the actual executable filename and a dedicated service user:

[Unit]
Description=Lumi AI Data Gateway
After=network-online.target
Wants=network-online.target

[Service]
User=lumi
WorkingDirectory=/opt/lumi-gateway
ExecStart=/opt/lumi-gateway/lumi-agent-linux-vX.X.XX
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
  • ExecStart — full absolute path to the executable. The gateway locates config.yaml and writes its logs folder relative to the executable itself, so the directory containing the binary is what matters, not WorkingDirectory.

  • User — a dedicated non-root user is recommended. Create one with useradd -r -s /bin/false lumi if it doesn't exist, and ensure it has read/write access to the gateway directory.

  • Restart=on-failure / RestartSec=10 — automatically restarts the gateway if it exits unexpectedly, with a 10-second delay.

Reload systemd and enable the service to start at boot:

Start the service immediately:

Confirm it is running:

Using cron with @reboot

A simpler option for systems without systemd or for quick setups.

Open the crontab for the user that will run the gateway:

Add a line using the full absolute path to the executable:

Use the full absolute path — the gateway resolves config.yaml and logs relative to the executable itself, so there is no need to cd first.

Using rc.local (Older Systems)

Edit rc.local:

Add the following before the exit 0 line:

Ensure rc.local is executable:

Desktop Environment Autostart (GUI)

If running on a Linux desktop, use the built-in autostart mechanism for your environment:

  • GNOME: gnome-session-properties

  • KDE: Autostart module in System Settings

  • Other environments: refer to their documentation

Note: desktop autostart only runs when the user is logged in. For unattended or server deployments, systemd is the appropriate choice.

Windows

The Windows gateway executable includes built-in Windows Service support — the recommended approach for production deployments. The service runs under the SYSTEM account, starts at boot without requiring a user login, and restarts automatically on failure.

Install the service:

Open a Command Prompt or PowerShell as Administrator in the directory containing the gateway executable, then run:

This installs and starts the service with the default name LumiAIDataGateway. To use a custom name (e.g., for multiple instances):

After installation, the service will start automatically on the next reboot and on any subsequent failure. You can also start it immediately from Services (services.msc) or via:

Uninstall the service:

circle-info

The gateway reads config.yaml from the same directory as the executable when running as a service. Ensure the config file is in place before installing, or supply the token via the LUMI_AI_DATA_GATEWAY_TOKEN environment variable set at the system level.

Using Task Scheduler

An alternative to the Windows Service, suitable if you prefer not to use the built-in service mode.

  1. Open Task Scheduler (search for it in the Start menu) and click Create Task.

  2. General tab: Enter a name (e.g., Lumi AI Data Gateway). Click Change User or Group, type SYSTEM, and confirm.

  3. Triggers tab: Click New..., set Begin the task to At startup, click OK.

  4. Actions tab: Click New..., click Browse... and select the gateway executable. In the Start in (optional) field, enter the directory containing the executable (e.g., C:\lumi-gateway). Click OK.

  5. Conditions tab: Uncheck Start the task only if the computer is on AC power.

  6. Settings tab: Uncheck Stop the task if it runs longer than.

  7. Click OK to save, then reboot to verify the task runs correctly.

Using Group Policy (Domain-Joined Machines)

For domain-joined machines managed via Group Policy:

  1. Create a .bat file:

  1. Open Group Policy Editor (gpedit.msc).

  2. Navigate to Computer Configuration → Windows Settings → Scripts (Startup/Shutdown).

  3. Add the .bat file as a Startup script.


After any startup configuration: reboot the host and confirm the gateway appears as Active in the Lumi AI Admin Settings panel.

Last updated

Was this helpful?