---
title: "Deploy nexgent-trading-engine"
description: "Nexgent AI's open-source trading platform for Solana"
category: "Other"
url: https://railway.com/deploy/nexgent-trading-engine
---

# Deploy nexgent-trading-engine

Nexgent AI's open-source trading platform for Solana

**[Deploy nexgent-trading-engine on Railway](https://railway.com/template/nexgent-trading-engine)**

- **Creator:** Nexgent's Projects
- **Category:** Other
- **Total deploys:** 160

## Template content

### @nexgent/backend

- **Source:** nexgent-ai-org/nexgent-open-source-trading-engine
- **Start command:** `pnpm --filter @nexgent/backend start`
- **Health check:** /api/v1/health
- **Public domain:** Yes

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### @nexgent/frontend

- **Source:** nexgent-ai-org/nexgent-open-source-trading-engine
- **Start command:** `pnpm --filter @nexgent/frontend start`
- **Health check:** /api/health
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

## Documentation

# Deploy and Host nexgent-trading-engine on Railway

Nexgent AI is an open-source Solana trading automation engine. It lets you deploy AI-powered trading agents with custom strategies, real-time position tracking, stop-loss mechanisms (fixed, exponential, zones), DCA support, and a live dashboard — all backed by Jupiter Aggregator for on-chain swaps and Pyth Network for price feeds.

## About Hosting nexgent-trading-engine

Deploying Nexgent requires running an Express.js backend server alongside PostgreSQL and Redis. PostgreSQL (via Prisma ORM) stores agents, positions, trades, and user data. Redis powers BullMQ job queues, price caching, and distributed locks. On first boot the backend auto-runs database migrations and seeds an admin account from environment variables. A WebSocket server provides real-time position and price updates to the Next.js frontend dashboard, which can be deployed separately. The backend exposes a health check at `/api/v1/health` and supports graceful shutdown for zero-downtime deploys.

## Common Use Cases

- **Automated Solana trading** — Deploy AI agents that execute token swaps on Jupiter Aggregator with configurable stop-loss and DCA strategies
- **Portfolio monitoring dashboard** — Track positions, balances, and P&amp;L in real time via the WebSocket-powered Next.js frontend
- **Strategy simulation** — Test trading strategies in simulation mode without connecting a wallet or API key before going live

## Dependencies for nexgent-trading-engine Hosting

- **PostgreSQL 14+** — Primary database for agents, positions, trades, and user accounts
- **Redis 6.0+** — Caching layer, BullMQ job queue, and distributed locking

### Deployment Dependencies

- [Prisma ORM](https://www.prisma.io/) — Database migrations and type-safe queries
- [Jupiter Aggregator API](https://station.jup.ag/docs/apis/swap-api) — On-chain Solana token swaps (required for live trading, optional for simulation)
- [Pyth Network](https://pyth.network/) — Real-time SOL price feeds via SSE
- [DexScreener](https://dexscreener.com/) — Token price data for non-SOL pairs
- [pnpm](https://pnpm.io/) — Package manager (monorepo workspace protocol)

### Implementation Details

**Build &amp; start commands:**

```bash
# Install dependencies and build the backend
pnpm install &amp;&amp; pnpm --filter backend build

# Run database migrations
pnpm --filter backend db:migrate:deploy

# Start the server
pnpm --filter backend start
```

**Required environment variables:**

```bash
DATABASE_URL=postgresql://user:password@host:port/database?schema=public
JWT_SECRET=minimum-32-characters-secret-key
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=YourSecurePassword1!
REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=
```

**Optional environment variables for live trading:**

```bash
JUPITER_API_KEY=your-jupiter-api-key
WALLET_1=base58-private-key
SOLANA_RPC_URL=https://your-rpc-endpoint.com
CORS_ORIGIN=https://your-frontend-domain.com
```

## Why Deploy nexgent-trading-engine on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying nexgent-trading-engine on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/nexgent-trading-engine
