OS Trading Engine
Self-Hosting
Overview

Self-Hosting Overview

Deploy Nexgent on your own infrastructure for complete control over your trading engine.


Why Self-Host?

BenefitDescription
Full ControlYour data, your keys, your infrastructure
No FeesZero platform fees - only pay for hosting
CustomizationModify any part of the codebase
PrivacyTrading data never leaves your servers
ComplianceMeet regulatory requirements for data residency

System Requirements

Minimum Requirements

ResourceMinimumRecommended
CPU1 vCPU2 vCPUs
RAM0.5 GB1 GB
Storage0.5 GB SSD1 GB SSD
Network100 Mbps100 Mbps

Software Requirements

SoftwareVersionPurpose
Node.js18.0.0+Runtime
pnpm8.0.0+Package manager
PostgreSQL14+Database
Redis7+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

FeatureDocker ComposeVercel + RailwayVPS
Setup Time15 minutes30 minutes1-2 hours
CostVPS cost onlyFree tier availableVPS cost only
ScalingManualAutomaticManual
SSLManual setupAutomaticManual setup
Best ForDev/TestingProductionFull control

Required External Services

Regardless of deployment method, you'll need:

1. Jupiter API Key (Required)

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-endpoint

Frontend

# 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.com

See Environment Variables for a complete reference.


Quick Start

For the fastest path to deployment:

  1. Production (recommended): Use Railway β€” one-click deploy, no infra setup. See Quickstart (Cloud Hosting) for the full guide.
  2. Development/Testing: Use Docker Compose
  3. Production (split stack): Use Vercel + Railway

Railway and Docker Compose can be set up in under 30 minutes.