Skip to content

Self-Hosting

AccessAgent is open source and self-hostable. Your data stays on your infrastructure.

  • Docker and Docker Compose (for the Docker path)
  • OR Bun 1.0+ and PostgreSQL 14+ (for the manual path)
  • An OpenAI API key

This is the recommended path. It spins up the app and a PostgreSQL database in one command.

  1. Clone the repo

    Terminal window
    git clone https://github.com/org/accessagent-core
    cd accessagent-core
  2. Configure environment

    Terminal window
    cp .env.example .env

    Edit .env and set your OpenAI API key:

    OPENAI_API_KEY=sk-...
    AUTH_SECRET=any-long-random-string

    The database URL is pre-configured for the Docker Compose PostgreSQL container.

  3. Start

    Terminal window
    docker compose up

    AccessAgent is now running at http://localhost:3000.

Use this if you have an existing PostgreSQL database or want more control over the setup.

  1. Clone and install

    Terminal window
    git clone https://github.com/org/accessagent-core
    cd accessagent-core
    bun install
  2. Configure environment

    Terminal window
    cp .env.example .env

    Edit .env:

    DATABASE_URL=postgresql://user:password@localhost:5432/panelai
    OPENAI_API_KEY=sk-...
    AUTH_SECRET=any-long-random-string
    PORT=3000
  3. Run migrations

    Terminal window
    bun run db:migrate
  4. Start the dev server

    Terminal window
    bun run dev

    Or for production:

    Terminal window
    bun run build
    bun run start
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
Terminal window
docker compose pull
docker compose up

Migrations run automatically on startup.

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.