Skip to main content

Installation

First, install Vestauth globally using npm or the installation script:

Setup Steps

1

Initialize Server Configuration

Run vestauth server init to create your server’s .env file with default configuration:
Output:
This creates a .env file with:
You can customize these values during initialization using flags:
2

Create Database

Create the vestauth_production PostgreSQL database:
Output:
If the database already exists, you’ll see:
3

Run Database Migrations

Run migrations to create the required database schema:
Output:
This creates two tables:
  • agents - Stores agent identities
  • public_jwks - Stores agent public keys
4

Start the Server

Start your Vestauth server:
Output:
The server is now running and ready to accept agent registrations!

Verify Installation

Test your server is running:
Expected response:

Create Your First Agent

Now that your server is running, create an agent that uses your self-hosted server:
Output:
Test the agent authentication:
Expected response:

Production Deployment

Important for production deployments:
  1. Use HTTPS: Change HOSTNAME to use https:// instead of http://
  2. Configure wildcard DNS: Set up *.vestauth.yoursite.com to point to your server
  3. Use managed PostgreSQL: Update DATABASE_URL to a production database like Supabase, AWS RDS, or similar
  4. Set proper PORT: Configure your reverse proxy (nginx, Caddy) to forward to your server port
Example production .env:

Command Reference

Server Commands

Server Start
Database Commands

Troubleshooting

Database Connection Issues

If you see database connection errors:
  1. Verify PostgreSQL is running: pg_isready
  2. Check DATABASE_URL format: postgres://localhost/vestauth_production
  3. Ensure database exists: psql -l | grep vestauth_production

Port Already in Use

If port 3000 is already in use:
Or update .env:

Agent Discovery Not Working

If .well-known endpoints return 404:
  1. Ensure wildcard DNS is configured correctly
  2. Verify subdomain routing: curl http://agent-test.localhost:3000/
  3. Check server logs for routing issues