Build with Anima

Self-host Anima

Run your own Anima instance. The Go chat service keeps no database, no disk, and no logged content, and your notes stay on Walrus under your wallet, so the instance is disposable and the vault is not.

Running your own instance is the strongest form of "not hostage to any app." The Go chat service keeps no database, no disk, and no logged content; the chat and draft paths are stateless. Its one piece of in-memory state is the ephemeral live-share relay, which is per-instance and gone once a room empties. Your notes live on Walrus, sealed under your wallet's keys, not on the server. So a self-hosted instance is a disposable front door to a vault you already own. Kill it or move it and the vault is untouched. The same property is what lets a different client wake the same notes later from the wallet alone.

This guide covers a testnet self-host. Read it end to end before you start, because mainnet has an extra access dependency called out at the bottom.

What you are running

The self-hostable stack is two pieces:

  • The static frontend. A built single-page app you serve from any static host or CDN.
  • The backend. A single stateless Go service (a chi server) that proxies chat and note-distillation to OpenRouter. It is the only thing you run as a long-lived process.

There is no separate chain service to operate. Chain interactions run client-side in the app, signed by the user's wallet, so the writes to Walrus and the reads from chain happen from the browser, not from a server you host. The anima-mcp connector that lets your own agents read and write the vault also runs user-side, alongside the agent, not as part of your instance. See the quickstart for how an agent pairs with a vault.

The Move contract is already deployed on chain. You do not redeploy it. You point your instance at the existing on-chain package, the same one the hosted app uses. Self-hosting changes who serves the app and proxies the LLM calls. It does not fork the protocol.

Because the chat and draft paths are stateless, the backend never sees a note in cleartext at rest and writes nothing to disk. Its one piece of in-memory state is the ephemeral live-share relay, which is per-instance and gone once a room empties. The only secrets it holds are its OpenRouter key and its JWT signing secret, both supplied at runtime. That is the whole custody argument: there is no server-side copy of your vault to lose, leak, or hold hostage.

Before you start

You need:

  • An OpenRouter API key (or any OpenAI-compatible endpoint, see OPENROUTER_BASE_URL).
  • A long, random string for JWT_SECRET. It signs the 24-hour login tokens your instance issues, so treat it like a password and generate it from a secure source.
  • A host that can run a container and expose one HTTP port.
  • The public origin where your frontend will be served (for example https://notes.example.com). You will need it for ALLOWED_ORIGINS.

ALLOWED_ORIGINS is the setting most self-hosts get wrong. The backend rejects browser requests from any origin not on this exact-match, comma-separated list. If it is empty or does not include the origin your frontend is actually served from, the app loads but every call to the backend fails on CORS. Set it to your frontend's real origin before your first login attempt. For local development that origin is typically http://localhost:5173.

Deploy with Coolify

The backend ships a Dockerfile, so Coolify can build and run it directly.

  1. Create the application. In Coolify, add a new resource from your Git repository (or a registry image you have already built) and point it at the backend directory that contains the Dockerfile. Choose the Dockerfile build pack so Coolify builds from it rather than guessing a buildpack.
  2. Set the port. The image listens on 8080. Map your public port to container port 8080. Let Coolify terminate TLS in front of it.
  3. Add the environment. In the application's Environment Variables, set the values from the reference below. At minimum: OPENROUTER_API_KEY, JWT_SECRET, and ALLOWED_ORIGINS (your frontend's public origin).
  4. Mark the secrets as secret. Put OPENROUTER_API_KEY and JWT_SECRET in Coolify's secret store, not in a committed .env. Coolify injects them at runtime so they never land in your repository or the build image.
  5. Deploy. Coolify builds the image and runs the container. The chat and draft paths are stateless, so there are no volumes and no database to provision. The one piece of in-memory state is the ephemeral live-share relay. Because that relay state is per-instance, running two replicas would split a live-share room (the vault itself is unaffected), so run a single instance.

Serve the static frontend separately (Coolify can host a static site, or use any CDN). Build the frontend pointed at your backend's public URL and the testnet package, then make sure your backend's ALLOWED_ORIGINS lists the exact origin the frontend is served from.

Deploy with plain Docker

If you are not using Coolify, the same Dockerfile runs anywhere Docker does.

Build the image from the backend directory:

docker build -t anima-backend .

Run it, injecting secrets and config as runtime environment, not baked into the image:

docker run -p 8080:8080 \
  -e OPENROUTER_API_KEY="$OPENROUTER_API_KEY" \
  -e JWT_SECRET="$JWT_SECRET" \
  -e ALLOWED_ORIGINS="https://notes.example.com" \
  anima-backend

Reading the secret values from your shell environment (the "$VAR" form above) keeps them out of your command history and out of any file. For a longer-lived setup, use Docker secrets or your orchestrator's secret mechanism and pass the values in at run time. Put the container behind a reverse proxy that terminates TLS, the same way Coolify does it for you.

To confirm the service is up, request a nonce:

curl https://notes.example.com/auth/nonce
# {"nonce":"anima:1749600000000:9f2c..."}

A nonce response means the backend is running and reachable. Login itself is done by the app from the user's wallet.

Keep secrets out of the repo

Two values are sensitive: OPENROUTER_API_KEY and JWT_SECRET. Both are supplied at runtime and never need to live in source.

  • Never commit a .env with real secrets. If you keep a .env for local development, keep it git-ignored and fill it with throwaway values.
  • In Coolify, store both in the secret store so they are injected at runtime and excluded from the build image and logs.
  • In plain Docker, prefer Docker secrets or runtime -e injection from your shell or orchestrator over an env file checked into the repo.
  • Rotate JWT_SECRET to log everyone out. Changing it invalidates every outstanding 24-hour token, which is the lever you reach for if a token leaks.

The instance never logs request bodies, query strings, Authorization headers, or message content on any path, including errors. The request log records method, path, status, and latency, and nothing else. That is a deliberate custody invariant, so your self-host does not accumulate a shadow copy of note content in its logs.

Environment reference

VariableRequiredDefaultNotes
OPENROUTER_API_KEYyesnoneKey for OpenRouter (or any OpenAI-compatible endpoint).
JWT_SECRETyesnoneSigns 24-hour login tokens. Use a long random value. Rotate to invalidate all tokens.
ALLOWED_ORIGINSfor browser useempty (no browser origins allowed)Comma-separated, exact-match list of frontend origins. Set to your frontend's public origin.
PORTno8080Port the service listens on.
OPENROUTER_BASE_URLnohttps://openrouter.ai/api/v1Point at any OpenAI-compatible API, including your own inference endpoint.
RATE_LIMIT_PER_MINno30Per-login rate limit for chat and distill.
DEFAULT_MODELnoanthropic/claude-sonnet-4.5A request can override the model per call.

What a self-host gives you today

The app frontend is being rebuilt, so a self-hosted instance today gives you the capability-level UI rather than the finished product surface. The part that is durable now, and the reason to self-host at all, is the path underneath the UI:

  • Your wallet owns the vault.
  • Your notes are sealed to Walrus under your keys.
  • Your own agents read and write that vault through anima-mcp, running on your side, paired to your vault. See the quickstart and the FAQ for the agent path.

That path does not depend on which copy of the app you run, which is the whole reason to self-host. Self-hosting is one more client in front of a vault you already own, not a place your data goes to live.

Mainnet is not turnkey yet

Scope your self-host to testnet for now. The end-to-end seal-to-storage flow on mainnet depends on Seal mainnet access, which is permissioned (for example via Enoki) rather than open. Until that access is in hand, a self-hosted mainnet instance is not a flip-a-switch operation, even though the contract is deployed.

Run your self-host against testnet. Mainnet self-hosting is gated on Seal mainnet access and is not turnkey today. The testnet path above is the supported one.

What's next

  • Quickstart: pair your own agent with a vault over anima-mcp.
  • FAQ: troubleshoot pairing, funding, and access on a self-host.

On this page