Skip to content

Commit bf7bb73

Browse files
committed
self host vestauth
1 parent cb1e813 commit bf7bb73

1 file changed

Lines changed: 237 additions & 3 deletions

File tree

blog/_posts/2026-02-25-self-host-vestauth.md

Lines changed: 237 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,243 @@ title: "self-host vestauth"
55
categories:
66
- blog
77
image: "https://github.com/user-attachments/assets/b05ba917-c37a-4a53-9ec7-c5c8d78ad1c7"
8-
excerpt: "Run your own Vestauth server in a single command."
8+
excerpt: "Run your own Vestauth server step by step and keep agent identity infrastructure under your control."
99
---
1010

11-
Run your own Vestauth server in a single command.
11+
Vestauth does not require a central auth provider.
1212

13-
Blog post coming soon.
13+
At its core, Vestauth is just HTTP plus public key cryptography:
14+
15+
* agents generate keys locally
16+
* agents sign requests
17+
* tools verify signatures
18+
* public keys are published via `.well-known`
19+
20+
That means you can run your own Vestauth infrastructure when you want tighter control over discovery, storage, hosting, and operations.
21+
22+
This guide walks through self-hosting the built-in Vestauth server step by step.
23+
24+
## Why self-host Vestauth?
25+
26+
Vestauth works great with the default hosted infrastructure, but there are good reasons to run your own:
27+
28+
* **Control your infrastructure**: keep registration, discovery, and key serving under your domain.
29+
* **Compliance / data residency**: run on your own cloud, region, or network boundaries.
30+
* **Custom operations**: use your own Postgres, observability, backups, and deployment pipeline.
31+
* **Private environments**: support internal agents and internal tools.
32+
* **Future flexibility**: customize trust rules, federation, and deployment topology as your agent ecosystem grows.
33+
34+
Like I wrote in the "run your own vestauth infrastructure" post: Vestauth is just HTTP. You're running an agent identity service that registers agents, stores public keys, and serves them for verification.
35+
36+
## What you are setting up
37+
38+
When you self-host the Vestauth server, you are running the infrastructure that:
39+
40+
* registers agent identities
41+
* stores agent public keys
42+
* serves `/.well-known/http-message-signatures-directory`
43+
* supports tool-side verification workflows
44+
45+
In other words, you control the agent identity authority for your environment.
46+
47+
## Prerequisites
48+
49+
Before starting, make sure you have:
50+
51+
* `curl`
52+
* `postgres` (local or managed)
53+
* a server/VM/container to run the Vestauth service (for production)
54+
* DNS control of the hostname you plan to use (for production)
55+
56+
## Step 1: Install Vestauth CLI
57+
58+
Install the CLI (same binary includes server commands).
59+
60+
```sh
61+
$ curl -sSf https://vestauth.sh | sh
62+
```
63+
64+
You can also install via npm or GitHub releases, but [`vestauth.sh`](https://vestauth.sh) is the fastest path for a fresh machine.
65+
66+
## Step 2: Initialize the server
67+
68+
Initialize a Vestauth server project.
69+
70+
```sh
71+
$ vestauth server init
72+
```
73+
74+
This creates the local server files and an `.env` configuration you can edit.
75+
76+
## Step 3: Create the database
77+
78+
Create the Postgres database used by the server.
79+
80+
```sh
81+
$ vestauth server db:create
82+
Created database 'vestauth_production'
83+
```
84+
85+
By default this targets `vestauth_production` on your local Postgres unless you set `DATABASE_URL`.
86+
87+
## Step 4: Run migrations
88+
89+
Run the database migrations.
90+
91+
```sh
92+
$ vestauth server db:migrate
93+
```
94+
95+
This creates the tables Vestauth needs for agents and public keys.
96+
97+
## Step 5: Configure the server (`.env`)
98+
99+
Edit `.env` and set your runtime config.
100+
101+
```ini
102+
PORT="3000"
103+
HOSTNAME="http://localhost:3000"
104+
DATABASE_URL="postgres://localhost/vestauth_production"
105+
```
106+
107+
### Local development config
108+
109+
For local development, this is usually enough:
110+
111+
* `HOSTNAME="http://localhost:3000"`
112+
* `DATABASE_URL` pointing to your local Postgres
113+
114+
### Production config
115+
116+
For production, update:
117+
118+
* `HOSTNAME` to your public hostname (for example `https://vestauth.yoursite.com`)
119+
* `DATABASE_URL` to your managed Postgres connection string
120+
121+
Example:
122+
123+
```ini
124+
PORT="3000"
125+
HOSTNAME="https://vestauth.yoursite.com"
126+
DATABASE_URL="postgresql://USER:PASS@aws-1-us-east-1.pooler.supabase.com:5432/postgres"
127+
```
128+
129+
## Step 6: Start the server
130+
131+
Start your self-hosted Vestauth server.
132+
133+
```sh
134+
$ vestauth server start
135+
vestauth server listening on http://localhost:3000
136+
```
137+
138+
You can also override values at runtime:
139+
140+
```sh
141+
$ vestauth server start --port 4567
142+
$ vestauth server start --hostname vestauth.yoursite.com
143+
$ vestauth server start --database-url postgresql://...
144+
```
145+
146+
## Step 7: Create an agent against your server
147+
148+
Now create an agent and point it at your self-hosted hostname.
149+
150+
```sh
151+
$ mkdir your-agent
152+
$ cd your-agent
153+
```
154+
155+
```sh
156+
$ vestauth agent init --hostname http://localhost:3000
157+
✔ agent created (.env/AGENT_UID=agent-4b94ccd425e939fac5016b6b)
158+
```
159+
160+
This does a few important things:
161+
162+
* generates an Ed25519 keypair locally
163+
* stores `AGENT_PRIVATE_JWK` and `AGENT_PUBLIC_JWK` in `.env`
164+
* registers the agent with your Vestauth server
165+
* returns an `AGENT_UID` used to build the agent discovery FQDN
166+
167+
## Step 8: Verify it works
168+
169+
Use your new agent to sign a request against your self-hosted server and confirm the identity path works end to end.
170+
171+
```sh
172+
$ vestauth agent curl http://localhost:3000/whoami --pp
173+
```
174+
175+
Or hit one of your own tools that calls `vestauth.tool.verify(...)`.
176+
177+
The key point is this: the request is signed locally by the agent, and tools verify it using public keys discovered from your self-hosted infrastructure.
178+
179+
## What changes when you self-host?
180+
181+
The cryptography and standards stay the same.
182+
183+
What changes is the infrastructure under the hood:
184+
185+
* **discovery domain** is yours
186+
* **database** is yours
187+
* **deployment + uptime** are yours
188+
* **network boundaries** are yours
189+
* **operational controls** are yours
190+
191+
You still get the same Vestauth developer experience:
192+
193+
* `vestauth agent init`
194+
* `vestauth agent curl`
195+
* `vestauth tool.verify(...)`
196+
197+
But the trust and hosting boundary is now under your control.
198+
199+
## Production notes (important)
200+
201+
### 1) Configure wildcard DNS
202+
203+
You must configure a wildcard DNS record for `*.${HOSTNAME}`.
204+
205+
Example:
206+
207+
* If `HOSTNAME=vestauth.yourapp.com`
208+
* Add wildcard DNS for `*.vestauth.yourapp.com`
209+
210+
This is required for `.well-known` discovery in the web-bot-auth architecture because agents resolve to subdomains under your host.
211+
212+
### 2) Use HTTPS in production
213+
214+
Use HTTPS for your public Vestauth hostname in production. Local `http://localhost` is fine for development.
215+
216+
### 3) Run managed Postgres (recommended)
217+
218+
Use a managed Postgres provider (Supabase, RDS, etc.) for backups, failover, and operations unless you explicitly want to operate Postgres yourself.
219+
220+
### 4) Add normal service hardening
221+
222+
Treat the Vestauth server like any production HTTP service:
223+
224+
* logging and metrics
225+
* backups
226+
* timeouts
227+
* health checks
228+
* deploy rollbacks
229+
230+
## Who should self-host?
231+
232+
Self-hosting is a strong fit if you are:
233+
234+
* building an internal agent platform
235+
* shipping a product that needs your own trust domain
236+
* operating in regulated or enterprise environments
237+
* standardizing agent identity across multiple services
238+
239+
If you are just exploring Vestauth, start with the hosted defaults first. You can migrate to self-hosting later without changing the underlying HTTP Message Signatures model.
240+
241+
## Closing
242+
243+
Vestauth is designed so you can start simple and grow into your own infrastructure.
244+
245+
If you self-host, you are not opting out of the standard. You are adopting it more fully by running the identity, key discovery, and trust boundary yourself.
246+
247+
That gives you a cryptographic agent auth layer you can run, audit, and operate on your own terms.

0 commit comments

Comments
 (0)