Legion

Chapter 08

Running the platform

Deployment: your own devices, rented slots, providers and every common setup.

8 min read

Where do nodes live?

Nodes can run on literally any device that can run C code and connect to a network. This includes:

Hardware collage: The many shapes a Legion node can take — phone, laptop, Raspberry Pi or cloud server.
The many shapes a Legion node can take — phone, laptop, Raspberry Pi or cloud server.
  • Smartphones — the default starting point. Always on, always connected, with cameras and microphones.
  • Laptops and desktops — powerful enough for most tasks, great as interface devices.
  • Raspberry Pi — low power, always-on, perfect for home servers.
  • Rented cloud servers — powerful, always-on, accessible from anywhere.
  • Embedded devicesESP32 microcontrollers with small screens, for minimal interfaces.
  • Docker containers — ephemeral workers that spin up, do a task, and shut down.

Every device type runs the same core Legion software. The difference is which modules (capabilities) it loads.

Installation formats

Legion software is distributed in several ways:

PackageWhat it containsInstalled on
legionCore library + node daemon + CLI toolEvery device
legion-aiAI modules (speech, language, text-to-speech)Orchestrator nodes only
legion-alsa-audioAudio modulesAudio specialist nodes
legion-desktopDesktop GUI (Tauri app)Desktop interface nodes
legion-base-appsReference apps (CLI assistant, etc.)Any interface device

Notice that an interface device (your smartphone or laptop) doesn't need the AI modules. It only needs the core package. The AI work happens on the orchestrator node.

Three ways to get hardware

Option 1: Your own devices

You already have some of these. Your smartphone, your laptop, maybe a Raspberry Pi gathering dust in a drawer. These are your personal nodes — zero cost, full control, zero dependencies.

To start:

  1. Install the legion package.
  2. Run legion-node-runner to start your node.
  3. Pair it with your smartphone (your main device).
  4. Done. You're in the network.

Option 2: Rent a slot

If you need more power than your personal devices can provide, you can rent compute from a provider. Providers are independent operators who rent out hardware slots.

The process:

  1. Browse the provider directory on legios.cloud.
  2. Pick a package (e.g., “GPU Worker — AI language model + speech”).
  3. Pay the provider directly (Legion doesn't handle payments).
  4. Scan a QR code with your smartphone to approve the connection.
  5. The rented server starts and joins your group automatically.
Flow illustration: Renting a slot: browse, pay, scan a QR code, and the server joins your group.
Renting a slot: browse, pay, scan a QR code, and the server joins your group.

Key security points:

  • The provider never sees your keys or your data.
  • The provider just rents you compute. Your identity and data stay on your devices.
  • You can revoke the rented server at any time from your smartphone.

Option 3: Self-hosted bridge

If you want to enable internet access for your home network (so you can reach your servers from a hotel, a cafe, etc.), you need a bridge node.

You can use a public bridge (listed on legios.cloud), or run your own:

  1. Install the bridge daemon on a publicly accessible server (VPS, cloud instance, etc.).
  2. Your home nodes register with the bridge on startup.
  3. When you connect from anywhere, the bridge routes your connection to your home nodes.

This is like having your own private VPN server, but Legion handles the routing automatically. You don't configure IP addresses or firewall rules.

Deployment scenarios

Here are the most common setups:

The “Just My Phone” setup

Minimal architecture: The simplest cohort: a single phone providing every capability.
The simplest cohort: a single phone providing every capability.

Your smartphone is everything. It captures audio, displays output, handles authentication. If you have no other devices, this is your complete cohort. You can still use Legion — just with fewer capabilities.

The “Home Server” setup

Home network diagram: A home server setup: phone, laptop and a Raspberry Pi, with a bridge to the internet.
A home server setup: phone, laptop and a Raspberry Pi, with a bridge to the internet.

Your smartphone + a Raspberry Pi or mini PC running at home. The home server runs AI modules (orchestrator), and your smartphone is the interface. Simple, private, fast (local network).

The “Full Setup” setup

Complete architecture: The full setup: phone, home server, rented GPU and laptop, meshed through a bridge.
The full setup: phone, home server, rented GPU and laptop, meshed through a bridge.

Phone + home server + rented cloud power + laptop. The home server handles everyday tasks. The rented server handles heavy computation. The bridge connects everything across the internet. Your laptop is a seamless extension of your smartphone.

Running as a service

On Linux, Legion runs as a system service (using systemd). This means:

  • It starts automatically on boot.
  • It restarts automatically if it crashes.
  • Logs are managed by the system journal.

On Docker, it runs as a container:

dockerfile
FROM legios/node-runner:latest
COPY my-node.cert /etc/legion/node.cert

The container starts, loads its certificate, joins your cohort, and runs. If the container is replaced (e.g., after an update), the same identity is preserved because the node key is stored as a Docker secret.

What providers need to do

If you want to become a Legion provider (renting out your hardware):

  1. Run a public bridge node (port 7575 accessible).
  2. Implement the Legion Installer API (the protocol for onboarding new users).
  3. Run the signed Legion node runner binary.
  4. Provide an uptime guarantee (recommended: 99.9%).
  5. Register on the legios.cloud provider directory (optional — you can also be added manually by users).

Anyone can be a provider. Legion doesn't approve or vet providers — the marketplace is federated, meaning trust comes from user reviews and reputation, not from a central authority.

Offline operation

Legion works fully offline. If your devices are all on the same local network with no internet connection:

  • Discovery works via multicast (Layer 1).
  • Communication works via direct LAN connections.
  • Consensus works normally.
  • Apps run from cache.
  • AI models run locally on your orchestrator.

The bridge and seed nodes are only needed for remote access — reaching your home devices from outside your network.

Summary

SetupDevicesInternet needed?Cost
Phone onlyPhoneNo (local) / Yes (remote)$0
Home serverPhone + Pi/mini PCYes (for remote)Hardware cost
Full setupPhone + Pi + rented GPU + laptopYesHardware + rental

The beauty of Legion is that you can start at any point and grow organically. There's no “right” setup. Your setup is whatever you need it to be.

What comes next

Now that you know how to deploy Legion, you might want to know: how do you build applications that run on it? Read Building apps to find out.