Self-Hosting Overview
Deploy Nexgent on your own infrastructure for complete control over your trading engine.
Why Self-Host?
| Benefit | Description |
|---|---|
| Full Control | Your data, your keys, your infrastructure |
| No Fees | Zero platform fees - only pay for hosting |
| Customization | Modify any part of the codebase |
| Privacy | Trading data never leaves your servers |
| Compliance | Meet regulatory requirements for data residency |
System Requirements
Minimum Requirements
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPUs |
| RAM | 0.5 GB | 1 GB |
| Storage | 0.5 GB SSD | 1 GB SSD |
| Network | 100 Mbps | 100 Mbps |
Software Requirements
| Software | Version | Purpose |
|---|---|---|
| Node.js | 18.0.0+ | Runtime |
| pnpm | 8.0.0+ | Package manager |
| PostgreSQL | 14+ | Database |
| Redis | 7+ | Caching & queues |
Architecture Overview
Nexgent consists of two main services:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your instance β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββ΄ββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββ βββββββββββββββββββββββ
β Frontend β β Backend β
β (Next.js) ββββββββΆβ (Express) β
β β API β β
β - Dashboard UI βββββββββ - REST API β
β - Real-time views β WS β - WebSocket β
β - Auth pages β β - Trading engine β
βββββββββββββββββββββββ ββββββββββββ¬βββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β PostgreSQL β β Redis β β External APIs β
β β β β β β
β - Users β β - Cache β β - Jupiter β
β - Agents β β - Sessions β β - Pyth β
β - Positions β β - Job queues β β - Solana RPC β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββDeployment Options
Choose the deployment method that fits your needs:
Comparison
| Feature | Docker Compose | Vercel + Railway | VPS |
|---|---|---|---|
| Setup Time | 15 minutes | 30 minutes | 1-2 hours |
| Cost | VPS cost only | Free tier available | VPS cost only |
| Scaling | Manual | Automatic | Manual |
| SSL | Manual setup | Automatic | Manual setup |
| Best For | Dev/Testing | Production | Full control |
Required External Services
Regardless of deployment method, you'll need:
1. Jupiter API Key (Required)
- Purpose: Token swaps and price quotes
- Get it: jup.ag/api (opens in a new tab)
- Cost: Free
2. Trading Wallets (Required for Live Trading)
- Purpose: Execute trades on-chain
- Setup: Generate Solana keypairs
- Security: Store private keys securely in environment variables
β οΈ
Security: Never commit private keys to version control. Use environment variables or secrets management.
Pre-Deployment Checklist
Before deploying, ensure you have:
- PostgreSQL database provisioned
- Redis instance provisioned
- Jupiter API key obtained
- Trading wallet keypairs generated (for live trading)
- Domain name configured (for production)
- SSL certificate (for production)
Environment Variables
All deployment methods require environment variables. Key variables include:
Backend
# Database
DATABASE_URL="postgresql://user:pass@host:5432/nexgent"
# Redis
REDIS_HOST=your-redis-host
REDIS_PORT=6379
REDIS_PASSWORD=your-redis-password
# Server
PORT=4000
NODE_ENV=production
CORS_ORIGIN=https://your-frontend-domain.com
# Auth
JWT_SECRET=your-secure-jwt-secret
# External APIs
JUPITER_API_KEY=your-jupiter-api-key
SOLANA_RPC_URL=https://your-rpc-endpointFrontend
# NextAuth.js
NEXTAUTH_URL=https://your-frontend-domain.com
NEXTAUTH_SECRET=your-secure-nextauth-secret
# Backend API
NEXT_PUBLIC_API_URL=https://your-backend-domain.comSee Environment Variables for a complete reference.
Quick Start
For the fastest path to deployment:
- Production (recommended): Use Railway β one-click deploy, no infra setup. See Quickstart (Cloud Hosting) for the full guide.
- Development/Testing: Use Docker Compose
- Production (split stack): Use Vercel + Railway
Railway and Docker Compose can be set up in under 30 minutes.