Self-Host InsForge on Containarium
This guide walks through self-hosting the InsForge platform on a Containarium host. Containarium is an open-source, self-hostable platform that gives each tenant a persistent Linux container (LXC) with first-class SSH, MCP, and TLS-on-a-hostname primitives, a natural fit for agent-driven InsForge deployments.This deploys InsForge itself, not the app you built. If you just want to take your app live, use Sites instead. This guide is for running the InsForge backend on your own infrastructure.
This guide is community-maintained and can lag the latest InsForge release. The canonical, always-current setup is the
deploy/docker-compose/ directory in the InsForge repo.When to choose Containarium
Containarium fits InsForge deployments where you want:- Self-hosted, multi-tenant infrastructure: many isolated InsForge projects on one host, each in its own LXC, with one TLS hostname per project — no shared
docker compose -pbookkeeping. - Persistence and resilience: ZFS-backed storage, daily snapshots with 30-day retention, automatic survival across host reboots and spot-VM termination.
- An agent-native control plane: Containarium exposes its admin surface as an MCP server (
mcp-server) and ships a second MCP that runs inside each container (agent-box), so the same agent that builds your app can also provision its backend end-to-end.
Prerequisites
- A running Containarium host. If you don’t have one, the Containarium quickstart takes ~5 minutes on a fresh Ubuntu 24.04 VM.
containariumCLI on your local machine, configured to reach the daemon (--server <host>:8080), or run the CLI directly on the host.- An admin token (
containarium token generate --username admin --roles admin --secret-file /etc/containarium/jwt.secret). - A domain you control, with a DNS A/CNAME record pointing the chosen subdomain at your Containarium sentinel’s public IP.
Deployment
1. Provision a box with Docker pre-installed
--stack docker flag installs Docker CE and the compose plugin inside the container. Wire your SSH config so ssh insforge works:
2. Clone InsForge inside the box
3. Configure environment
Edit~/insforge/deploy/docker-compose/.env inside the box. At minimum set:
deploy/docker-compose/.env.example for the full list (OpenRouter, OAuth providers, Stripe, Vercel).
Secrets handling: for production, prefer Containarium’s tmpfs secrets (--delivery=file; see Containarium’s secrets ops doc). These are delivered as 0440 files on tmpfs and never appear in/proc/<pid>/environ. Wire them into the compose stack via a compose override usingenv_file:.
4. Start InsForge and enable autostart
You can start it once by hand:4/4 services up: postgres, postgrest, insforge, deno. (The compose file ships healthchecks for postgres, postgrest, and deno; insforge reports Up once the others are healthy and it has started.)
5. Expose on a public hostname
InsForge serves the dashboard and API on port 7130 by default.<your-subdomain> and forward to the InsForge container. The certificate is provisioned automatically via ACME on the first request — no certbot, no nginx config.
Verify:
6. Connect your agent to InsForge MCP
Openhttps://<your-subdomain> in a browser and follow the in-product flow to connect your MCP-compatible agent (Cursor, Claude Code, Windsurf, OpenCode, etc.) to the InsForge MCP server.
Verify the connection by sending this prompt to your agent:
Agent-driven deploy (optional)
Because Containarium exposes its admin surface as an MCP server (mcp-server) and ships a second MCP inside every container (agent-box), an MCP-speaking agent can do the whole deployment end-to-end:
docs/MCP-INTEGRATION.md for the platform MCP tool catalog.
Multi-tenant: many InsForge projects per host
Each project gets its own LXC and its own hostname; the sentinel routes by SNI. No port collisions (each container has its own network namespace), no shared compose project names.Management
View logs
docker compose logs -f insforge / postgres / deno.
Update InsForge
Back up the database
Stop / restart
Troubleshooting
containarium compose enable fails
Verify Docker is working inside the box:
--stack docker at create time, either install it manually inside the box or recreate with the flag.
Public hostname doesn’t resolve
containarium expose-port configures Caddy on the sentinel; the DNS A/CNAME record for your subdomain must point at the sentinel’s public IP. Check:
Hostname resolves but returns 502
Check that InsForge is reachable from inside the box:docs/TUNNEL-REVERSE-PROXY.md.
Out of memory after docker compose up
InsForge’s four services need ~3 GB resident at idle. If you sized the box at 2 GB, resize:
Limitations
- AUTH_PORT (7131) and DENO_PORT (7133) are not exposed externally by the steps above. If your app calls the standalone auth endpoint or direct Deno function URLs from outside the box, add additional
expose-portcalls with separate subdomains. containarium compose enablerequires Containarium v0.18 or later (the compose-autostart feature). On earlier versions, rundocker compose up -dand add a@rebootcron entry by hand.- GPU passthrough: Containarium supports it, but InsForge’s stock edge functions don’t use GPU. Leave it off unless your custom Deno functions need it.
Security notes
- The container’s user is unprivileged on the host (LXC unprivileged mode); container root ≠ host root.
- The sentinel front-door supports source-IP allowlists for admin endpoints — see Containarium’s security runbook.
- For production, opt into Containarium’s KMS envelope encryption (Vault Transit or GCP KMS) for any InsForge secrets stored in Containarium’s secret store.
- Use
containarium token generate --scopes containers:read,containers:write ...to mint least-privilege tokens for agents rather than handing out admin tokens.
Resources
- Containarium: https://github.com/footprintai/containarium
- Containarium docs: https://github.com/footprintai/Containarium/tree/main/docs
- InsForge docs: https://docs.insforge.dev
- InsForge Discord: https://discord.com/invite/MPxwj5xVvW
For other deployment strategies, see the deployment guides.