Why Self-Host?

Why self-hosting Locus agents is recommended and how to get started.

The Problem with Running AI Agents Locally

When you run AI coding agents like Claude or Codex on your development machine, they typically operate in interactive mode — you see what they're doing, approve file changes, and maintain control.

But on a server, these agents need to run autonomously. This means:

triangle-exclamation

This is powerful for automation, but it also means you need to control the environment carefully.


Why Self-Host?

Self-hosting gives you:

Full Control Over Your Code

Your source code stays on your infrastructure. Locus only syncs task metadata (titles, descriptions, statuses) with the cloud — never your codebase.

spinner

24/7 Agent Availability

With self-hosted agents, you can:

  • Dispatch tasks from the dashboard and have them executed automatically

  • Control everything from Telegram while away from your desk

  • Run agents around the clock without keeping your laptop open

Isolated Environment

Running on a dedicated server means:

  • Agents can't interfere with your local development environment

  • You can limit filesystem access and network permissions

  • Crashes or runaway processes don't affect your workstation


Security Considerations

circle-exclamation
  1. Dedicated user account — Run agents under a restricted user, not root

  2. Repository-scoped access — Only give agents access to the specific repository they need

  3. GitHub token scope — Use fine-grained tokens with minimum required permissions

  4. Network restrictions — Consider firewall rules to limit outbound access

  5. Monitor logs — Review agent output regularly via Telegram or log files

  6. Chat ID restriction — Always configure the Telegram bot's chat ID to restrict access to your account only


Getting Started

Locus provides automated setup scripts for:

  • Linux — Ubuntu/Debian with systemd services

  • macOS — macOS with LaunchAgent services

Quick Install

The installer is interactive — just run the command and follow the prompts:

You'll be guided through entering your repository URL, API key, GitHub token, and optional Telegram configuration. The installer auto-detects your OS (Linux or macOS) and runs the appropriate setup script.

circle-info

You can also pass all parameters as flags for non-interactive (scripted) usage:


What Gets Installed

Component
Description

Node.js 22+

JavaScript runtime

Bun

Fast JavaScript bundler/runtime

GitHub CLI (gh)

GitHub operations

Claude CLI

Anthropic's AI agent

Locus CLI

@locusai/cli

Locus Telegram

@locusai/telegram (if configured)

Repository clone

Your project code

System services

Background processes for agent and bot

Last updated