selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Containarium logo

Self-host Containarium

v0.120.1

Agent runtime giving each AI a persistent SSH-isolated box

BetaOpen SourceApache-2.0
Updated5 hours ago
LanguageGo
Setup difficultyAdvanced
Stars
313
Ports
8080 (REST API (gRPC-gateway)), 50051 (gRPC API (mTLS))
Requires
Incus/LXC, Kernel modules (overlay, br_netfilter, nf_nat), PostgreSQL, ZFS kernel module
Install with Kubernetes
Animated demo showing install, box creation, and agent driving the box via SSH to install Caddy and expose an appOpen Graph image for Containarium project

What is Containarium?

Containarium provides persistent, isolated Linux environments for AI agents. Each agent receives its own system container (LXC/Incus or Kubernetes pod) with full systemd, real networking, and SSH access. The platform includes a sentinel (sshpiper + Caddy) for routing SSH and HTTPS traffic to containers, two MCP servers (platform-level and in-container agent-box) for structured tool access, and features like GPU passthrough, eBPF egress policies, ZFS-backed persistent storage, and JWT-based authentication with RBAC. It runs on a single Ubuntu VM or across a fleet of cloud/on-prem nodes, and exposes a CLI, REST/gRPC API, and a basic web UI. The project is Apache 2.0 licensed with no CLA.

Should you self-host Containarium?

Containarium scores 49/100 on selfhost.directory (how scoring works) and ranks #104 of 209 in AI Agents. It has 313 GitHub stars.

It shipped 12 stable releases in the past year. The latest, v0.120.1, came out on 28 October 2026.

Setup is advanced: plan for several services and some ongoing maintenance. It is Apache-2.0-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is agentOS (64/100, 4 833 stars). It scores higher overall, so compare the two before you pick. See Containarium vs agentOS side by side.

Features

  • Agent-box MCP server
  • Audit log with hash chain
  • CI runner with debug-on-failure
  • Detached agent runs with resumable logs
  • eBPF egress policy
  • GPU passthrough
  • KMS envelope encryption
  • Kubernetes backendExperimental
  • MCP-native CLI
  • Multi-OS support
  • Persistent storage with ZFS
  • Sentinel for SSH/HTTPS routing
  • SSH-native agent isolation
  • Web UI dashboardFunctional, not opinionated

Containarium README

How to install Containarium

Install Containarium with Kubernetes

Kubernetes cluster, KUBECONFIG or in-cluster config
Environment variables
CONTAINARIUM_RUNTIME=k8s

CONTAINARIUM_RUNTIME=k8s containariumd daemon

Experimental Kubernetes backend; local bring-up under 5 minutes with kind

How to configure Containarium

  • AGENTBOX_ROOTSandbox root directory to constrain agent-box file operations

    Sandbox root directory to constrain agent-box file operations

    values: directory path

  • CONTAINARIUM_ALLOWED_IMAGE_REGISTRIESRestrict which simplestreams remotes the daemon will pull from

    Restrict which simplestreams remotes the daemon will pull from

    values: comma-separated list

  • CONTAINARIUM_HTTPUse HTTP instead of gRPC for CLI communication

    Use HTTP instead of gRPC for CLI communication

    values: true/false

  • CONTAINARIUM_KMS_BACKENDnoneKMS backend for envelope encryption of secrets

    KMS backend for envelope encryption of secrets

    values: none,inproc,vault,gcp

  • CONTAINARIUM_POSTGRES_URL_FILEPath to file containing PostgreSQL connection URL

    Path to file containing PostgreSQL connection URL

    values: file path

  • CONTAINARIUM_REQUIRE_ENVELOPEfalseRefuse legacy master-key-only rows (Phase E retirement gate)

    Refuse legacy master-key-only rows (Phase E retirement gate)

    values: true/false

  • CONTAINARIUM_REQUIRE_IMAGE_DIGESTfalseRefuse images without @sha256 digest

    Refuse images without @sha256 digest

    values: true/false

  • CONTAINARIUM_RUNTIMElxcRuntime backend selection

    Runtime backend selection

    values: lxc,k8s

  • CONTAINARIUM_SERVERhttp://localhost:8080Daemon API server address

    Daemon API server address

    values: host:port

  • CONTAINARIUM_TOKENAdmin token for API authentication

    Admin token for API authentication

    values: JWT token

  • CONTAINARIUM_VERIFY_IMAGE_DIGESTfalseVerify digest against registry index (pre- and post-pull)

    Verify digest against registry index (pre- and post-pull)

    values: true/false

  • CONTAINARIUM_WAKE_TRUSTED_PROXIESSource-IP allowlist for /wake/ endpoint on sentinel

    Source-IP allowlist for /wake/ endpoint on sentinel

    values: comma-separated IPs/CIDRs

  • OTEL_BEARER_REQUIREDfalseCollector rejects un-bearer OTLP submissions (set on OTel collector)

    Collector rejects un-bearer OTLP submissions (set on OTel collector)

    values: true/false

Containarium releases & version history

FAQ

Why LXC at all?

LXC provides full Linux OS with systemd, first-class SSH access, working Docker-in-LXC, real persistent filesystem, real users, and real sudo — feeling like a VM for the agent at a fraction of the resource cost.

Why not e2b / Modal / Daytona?

These are SaaS-only sandboxes for AI agents that optimize for short-lived, process-per-call execution. Containarium is self-hostable, MCP-native, and gives full persistent Linux boxes.

Why not Codespaces / Gitpod?

Codespaces and Gitpod are browser-IDE-as-a-Service, per-hour billed, and vendor-locked. Containarium is self-hosted, persistent, SSH/MCP-based, with no per-hour billing in OSS.

Why not Dev Containers / VS Code Remote Containers?

Dev Containers are project-scoped, IDE-coupled, and single-developer. Containarium gives many users or agents their own persistent boxes on shared infrastructure, IDE-agnostic.

Why not Vagrant?

Vagrant orchestrates VMs on a developer's local machine. Containarium hosts environments on shared remote infrastructure for many agents.

Why not Kubernetes?

Kubernetes orchestrates application containers across nodes. Containarium is the agent runtime that runs on top of Kubernetes (or LXC), giving each agent a persistent SSH-native box without handing it cluster credentials.

Why not Docker / Podman?

Docker is for application containers. Containarium uses LXC system containers with full Linux OS per container, real systemd, native SSH, Docker-in-LXC support, and persistent filesystem.

More in Infrastructure

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…