Self-Hosting
AccessAgent is open source and self-hostable. Your data stays on your infrastructure.
Prerequisites
Section titled “Prerequisites”- Docker and Docker Compose (for the Docker path)
- OR Bun 1.0+ and PostgreSQL 14+ (for the manual path)
- An OpenAI API key
Quick start with Docker Compose
Section titled “Quick start with Docker Compose”This is the recommended path. It spins up the app and a PostgreSQL database in one command.
-
Clone the repo
Terminal window git clone https://github.com/org/accessagent-corecd accessagent-core -
Configure environment
Terminal window cp .env.example .envEdit
.envand set your OpenAI API key:OPENAI_API_KEY=sk-...AUTH_SECRET=any-long-random-stringThe database URL is pre-configured for the Docker Compose PostgreSQL container.
-
Start
Terminal window docker compose upAccessAgent is now running at http://localhost:3000.
Manual installation
Section titled “Manual installation”Use this if you have an existing PostgreSQL database or want more control over the setup.
-
Clone and install
Terminal window git clone https://github.com/org/accessagent-corecd accessagent-corebun install -
Configure environment
Terminal window cp .env.example .envEdit
.env:DATABASE_URL=postgresql://user:password@localhost:5432/panelaiOPENAI_API_KEY=sk-...AUTH_SECRET=any-long-random-stringPORT=3000 -
Run migrations
Terminal window bun run db:migrate -
Start the dev server
Terminal window bun run devOr for production:
Terminal window bun run buildbun run start
Environment variables
Section titled “Environment variables”| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
Yes | — | PostgreSQL connection string |
OPENAI_API_KEY |
Yes | — | OpenAI API key for the agent |
AUTH_SECRET |
Yes | — | Secret for signing session tokens |
PORT |
No | 3000 |
HTTP server port |
NODE_ENV |
No | development |
Set to production in prod |
Updating
Section titled “Updating”docker compose pulldocker compose upMigrations run automatically on startup.
git pullbun installbun run db:migratebun run build && bun run startReverse proxy
Section titled “Reverse proxy”For production, put AccessAgent behind a reverse proxy (nginx, Caddy) that handles TLS.
Caddy (simplest):
panelai.yourdomain.com { reverse_proxy localhost:3000}Caddy provisions a Let’s Encrypt certificate automatically.
nginx:
server { listen 443 ssl; server_name panelai.yourdomain.com;
location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; }}Note: WebSocket support requires the Upgrade and Connection headers for team chat to work.