Skip to main content
This guide covers everything you need to install and configure Autonome, from prerequisites to production deployment.

System Requirements

Hardware

  • CPU: 2+ cores recommended
  • RAM: 4GB minimum, 8GB recommended
  • Storage: 10GB+ for database and logs

Software

  • Operating System: Linux, macOS, or WSL2 on Windows
  • Bun: >= 1.1 (required)
  • Node.js: >= 18 (for compatibility)
  • PostgreSQL: >= 15
  • Git: For cloning the repository
Autonome is designed to run on Bun exclusively. Using npm or pnpm is not supported and may cause unexpected behavior.

Step 1: Install Prerequisites

1

Install Bun

Bun is required as both the package manager and JavaScript runtime.
After installation, add Bun to your PATH:
Add this line to your ~/.bashrc, ~/.zshrc, or shell config file to make it permanent.
If you encounter permission errors, ensure your user has write access to ~/.bun/bin.
2

Install PostgreSQL

PostgreSQL is used for persistent storage of trades, positions, and analytics.

Create Database

Create a dedicated database for Autonome:
Replace your_secure_password with a strong password. You’ll use this in your DATABASE_URL configuration.
3

Install Node.js (Optional)

While Bun is the primary runtime, Node.js may be needed for some tooling compatibility.
Verify installation:

Step 2: Clone and Install Autonome

1

Clone Repository

2

Install Dependencies

Use Bun to install all project dependencies:
This will:
  • Install all npm packages defined in package.json
  • Set up TypeScript, Vite, and build tooling
  • Install AI SDK providers and trading integrations
  • Configure Drizzle ORM and database drivers
Do not use npm install or pnpm install. Autonome’s scripts and runtime expect Bun exclusively.
3

Verify Installation

Check that core dependencies are installed:

Step 3: Environment Configuration

Autonome uses T3 Env for type-safe environment configuration. All variables are validated at runtime.
1

Copy Environment Template

2

Configure Core Settings

Open .env and configure these required settings:

Database Configuration

.env
Format: postgres://username:password@host:port/database

Server Configuration

.env

Trading Mode

.env
Start with TRADING_MODE=simulated to test strategies without risk. Switch to live only after thorough testing.
3

Configure AI Providers

Autonome supports multiple AI providers. Configure at least one:
.env

OpenRouter

.env

AIHubMix

.env

Mistral AI

.env
The platform automatically cycles through available API keys to distribute requests and avoid rate limits. Configure multiple keys per provider for better throughput.
4

Configure Simulator (Optional)

Customize simulator behavior for strategy testing:
.env
5

Configure Lighter API (Live Trading Only)

Required only for live trading mode:
.env
Live trading requires valid Lighter API credentials. Ensure you understand the risks before enabling live mode.
6

Optional: Technical Analysis

For supplementary technical indicators:
.env

Step 4: Database Setup

1

Generate Migrations

After schema changes (or initial setup), generate migration files:
This reads src/db/schema.ts and creates SQL migration files in ./drizzle/.
2

Apply Migrations

Apply migrations to your database:
This executes all pending migrations and sets up your database schema:
  • "Models" - AI model configurations
  • "Orders" - Trade orders and positions
  • "PortfolioSnapshots" - Historical portfolio values
  • Other analytics and tracking tables
3

Seed Initial Data

Populate the database with default AI model variants:
This creates four default trading strategies:
You can re-run the seed script anytime to reset your database to default state. This will clear all existing data.
4

Verify Database Setup

Launch Drizzle Studio to inspect your database:
This opens a web interface at https://local.drizzle.studio where you can:
  • Browse tables and relationships
  • View seeded data
  • Execute SQL queries
  • Monitor database schema

Step 5: Start the Application

1

Development Mode

For local development, start both the API server and frontend:
The application will be available at:
2

Production Build

For production deployment:
The frontend (src/) deploys to Vercel as a TanStack Start SPA. The API server (api/src/index.ts) runs on a VPS or container platform.

Deployment Architecture

Autonome is designed as a split deployment:

Frontend (Vercel)

  • Location: src/ directory
  • Framework: TanStack Start (React 19)
  • Build Command: bun run build
  • Output: Static SPA with SSR capabilities
  • Environment: Configure VITE_* prefixed variables

Backend (VPS/Container)

  • Location: api/src/index.ts
  • Framework: Hono API server
  • Build Command: bun run build:api
  • Start Command: bun run start:api
  • Port: 8081 (configurable via PORT env var)

Communication

  • Frontend calls backend via oRPC over HTTP
  • Development: Vite proxies /api/* to API server
  • Production: Frontend uses VITE_API_URL to reach API

Environment Variables Reference

Complete reference of all environment variables:

Required Variables

Server Configuration

Simulator Configuration

AI Provider Keys

Lighter API (Live Trading)

Optional Integrations

Client-Side Variables

Variables prefixed with VITE_ are exposed to the browser:

Verification

After installation, verify everything is working:
1

Check Services

2

Run Tests

3

Monitor Logs

Watch application logs for errors:

Common Issues

Symptoms: ECONNREFUSED or Connection refused errorsSolutions:
  1. Verify PostgreSQL is running:
  2. Check PostgreSQL is listening on correct port:
  3. Verify connection string format:
  4. Test connection manually:
Symptoms: bun: command not foundSolutions:
  1. Reinstall Bun:
  2. Add to PATH:
  3. Reload shell:
Symptoms: EADDRINUSE: address already in useSolutions:
  1. Change port in .env:
  2. Kill process using port:
  3. Use different port range:
Symptoms: Drizzle migration failuresSolutions:
  1. Ensure database exists:
  2. Check database permissions:
  3. Reset migrations (development only):
Symptoms: Invalid environment variables or validation errorsSolutions:
  1. Check .env file exists:
  2. Validate required variables are set:
  3. Ensure no trailing spaces or quotes:
  4. Restart server after changing .env

Next Steps

Quickstart Guide

Get your first trading bot running in minutes

Configuration

Customize AI models, risk parameters, and strategies

Architecture

Understand the system design and data flow

API Reference

Explore oRPC procedures and integrations

Additional Resources

  • Database Schema: See src/db/schema.ts for complete data model
  • Environment Validation: Check src/env.ts for all validated variables
  • Commands Reference: Run bun run to list all available scripts
  • Drizzle Kit: Use bunx drizzle-kit --help for database utilities