Public Hub

Run a publicly accessible Demarkus server with TLS, open read access, and optional write tokens. Good for publishing docs, specs, or knowledge bases.

The Hub Pattern

A hub is a demarkus server that acts as a discovery index — it links to other demarkus servers rather than hosting original content. Think of it as a curated directory for the demarkus network.

Hubs organize servers into categories (tools, blogs, projects, other hubs) and publish an agent manifest at /.well-known/agent-manifest.md so LLM agents can discover and navigate the network automatically.

The more hubs link to each other, the richer the network becomes. Anyone can run a hub.

Reference Implementation

The public hub at mark://hub.demarkus.io is a working example. Its content lives in a Git repo and CI publishes to the live server on every push to main. Browse it:

demarkus mark://hub.demarkus.io/index.md

See the repo for structure, contributing guidelines, and how to list your own server: github.com/latebit-io/demarkus-hub

What you’ll have

Prerequisites

Setup

1. Install with Let’s Encrypt

SSH into your VPS and run:

sudo curl -fsSL https://raw.githubusercontent.com/latebit-io/demarkus/main/install.sh | \
  bash -s -- --domain yourdomain.com --root /srv/site

This will:

2. Open firewall

sudo ufw allow 6309/udp
sudo ufw allow 80/tcp    # for Let's Encrypt renewal

3. Add your initial content

demarkus-publish -root /srv/site -path /index.md -body "# Welcome

This is a public Demarkus hub."

4. Verify

From your local machine:

demarkus mark://yourdomain.com/index.md

You should see the document with status: ok.

5. Publish content

Option A: Local publishing (recommended for public servers)

Use demarkus-publish to write directly to the versioned store on disk. No network write access needed — the server can run in read-only mode for maximum security:

demarkus-publish -root /srv/site -path /hello.md -body "# Hello"

Option B: Remote publishing via tokens

Generate a publish token on the server:

sudo demarkus-token generate -paths "/*" -ops publish -tokens /etc/demarkus/tokens.toml

Then reload the server config:

sudo systemctl restart demarkus

Publish from your local machine:

demarkus -X PUBLISH -auth <your-token> mark://yourdomain.com/hello.md -body "# Hello"

Agent Discovery via Published Graphs

Hubs are natural hosts for published graph documents. An agent crawls a set of servers, then publishes its graph to a hub so other agents can discover the topology without recrawling.

How it works

  1. An agent crawls servers using mark_graph to build a local graph store
  2. The agent publishes the graph to the hub using mark_graph_publish (e.g. /graphs/my-network.md)
  3. Another agent fetches the published graph and runs mark_graph on it
  4. The crawler follows all mark:// links in the document, reconstructing the topology instantly

The published graph is plain markdown with mark:// links in a table. No special format — the same link extraction the crawler already uses parses it naturally.

Multi-agent discovery

Multiple agents can publish their graphs to the same hub:

Each published graph is versioned, so you get a history of how the network evolved over time.

MCP tools

Tool Purpose
mark_graph Crawl links from a document, persist to local graph store
mark_graph_export Export the local graph as publishable markdown
mark_graph_publish Export and publish the graph to a server in one step
mark_backlinks Query the local graph for reverse links

Content indexing

Hubs can also host content indexes — hash-based directories that map content hashes to server locations. Use mark_index to crawl a server and publish its content index to a hub, and mark_resolve to look up content by hash.

Certificate renewal

The installer configures this cron job automatically:

0 */12 * * * certbot renew --quiet --deploy-hook "pidof demarkus-server | xargs -r kill -HUP"

The SIGHUP signal triggers a zero-downtime certificate reload — no connection drops.

Monitoring

sudo systemctl status demarkus
journalctl -u demarkus -f

Health check:

demarkus mark://yourdomain.com/health