Nexus can be installed using several methods depending on your environment and requirements. Choose the installation method that best suits your needs.
The fastest way to get started with Nexus is using our installation script:
curl -fsSL https://nexusrouter.com/install | bashThis script will:
- Detect your operating system and architecture
- Download the appropriate binary
- Install it to
~/.nexus/bin - Make it executable
- Linux (x86_64, aarch64)
- macOS (Intel, Apple Silicon)
- Windows (via WSL)
Nexus is available as a Docker image for containerized deployments.
docker pull ghcr.io/grafbase/nexus:stabledocker pull ghcr.io/grafbase/nexus:0.2.0docker pull ghcr.io/grafbase/nexus:latestNote: The stable tag points to the latest released version, while latest follows the main branch and may include unreleased features.
Basic usage:
docker run -p 8000:8000 \
-v $(pwd)/nexus.toml:/etc/nexus.toml \
ghcr.io/grafbase/nexus:stableWith environment variables:
docker run -p 8000:8000 \
-v $(pwd)/nexus.toml:/etc/nexus.toml \
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
-e OPENAI_API_KEY=${OPENAI_API_KEY} \
ghcr.io/grafbase/nexus:stableCreate a compose.yaml file:
services:
nexus:
image: ghcr.io/grafbase/nexus:stable
ports:
- "8000:8000"
volumes:
- ./nexus.toml:/etc/nexus.toml
# Mount additional directories if using STDIO servers
- /path/to/mcp-servers:/opt/mcp-servers
environment:
- GITHUB_TOKEN=${GITHUB_TOKEN}
- OPENAI_API_KEY=${OPENAI_API_KEY}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stoppedThen run:
docker compose up -dThe Nexus Helm chart simplifies deployment with Kubernetes. The GitHub Container Registry hosts the chart with Open Container Initiative (OCI) compliance and is available here:
https://ghcr.io/grafbase/helm-charts/nexusThe chart includes default installation configuration for quick setup with minimal configuration. While functional and easy to start with, tune this setup to accommodate real use cases.
Follow these steps to install the default configuration and customize settings for:
- Number of replicas
- Auto-scaling
- Compute resources
- External configuration
Complete these prerequisites before deploying:
- Kubernetes Cluster: Get access to a Kubernetes cluster. Set up a local cluster like kind if needed.
- helm: Install Helm. Get started here.
- kubectl: Install kubectl and point it to your cluster. Get started here.
Install the Nexus chart:
helm install test oci://ghcr.io/grafbase/helm-charts/nexus --version <version>Verify Nexus operation:
kubectl get podsLook for a running pod named test-nexus.
Use a Helm values file to customize your deployment:
# 1. number of desired replicas running
replicaCount: 2
# 2. auto-scaling behaviour
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 70
# 3. compute resources
resources:
limits:
cpu: 2
memory: 2Gi
requests:
cpu: 1
memory: 1Gi
# 4. external configuration from cluster configmaps
nexus:
externalConfig: true
args:
- --config
- /etc/nexus/config/config.toml
volumes:
- name: configuration
configMap:
name: nexus-configuration
volumeMounts:
- name: configuration
mountPath: /etc/nexus/configThis configuration:
- Maintains 2 gateway replicas
- Sets auto-scaling between 2 and 10 instances, scaling up at 70% CPU or memory usage
- Allocates 1-2 CPU and 1-2GB memory per replica
- Uses cluster configmaps for configuration and mounting them in the specified paths
View all customizable values with:
helm show values oci://ghcr.io/grafbase/helm-charts/nexus --version <version>To apply customizations:
- Save your settings to a file
- Run:
helm upgrade test oci://ghcr.io/grafbase/helm-charts/nexus --version <version> -f custom-values.yaml
Verify the deployment:
helm list
kubectl get podsFor advanced users who want to build Nexus from source:
- Latest stable Rust
- Git
- Clone the repository:
git clone https://github.com/grafbase/nexus
cd nexus- Build the release binary:
cargo build --release -p nexus-
The binary will be available at
target/release/nexus -
(Optional) Install to system path:
mkdir -p ~/.nexus/bin
sudo cp target/release/nexus ~/.nexus/bin
sudo chmod +x ~/.nexus/bin/nexusAfter installation, verify Nexus is working:
nexus --versionYou should see output like:
nexus 0.2.0
Start Nexus with default settings:
nexusThis will:
- Look for
nexus.tomlin the current directory - Start the server on
http://127.0.0.1:8000 - Enable the health endpoint at
/health
Usage: nexus [OPTIONS]
Options:
-l, --listen-address <LISTEN_ADDRESS>
IP address on which the server will listen for incomming connections. Default: 127.0.0.1:6000
[env: NEXUS_LISTEN_ADDRESS=]
-c, --config <CONFIG>
Path to the TOML configuration file
[env: NEXUS_CONFIG_PATH=]
[default: ./nexus.toml]
--log <LOG_LEVEL>
Set the logging level, this applies to all spans, logs and trace events
[env: NEXUS_LOG=]
[default: info]
Possible values:
- off: Disable logging
- error: Only log errors
- warn: Log errors, and warnings
- info: Log errors, warnings, and info messages
- debug: Log errors, warnings, info, and debug messages
- trace: Log errors, warnings, info, debug, and trace messages
--log-style <LOG_STYLE>
Set the style of log output
[env: NEXUS_LOG_STYLE=]
[default: color]
Possible values:
- color: Colorized text, used as the default with TTY output
- text: Standard text, used as the default with non-TTY output
- json: JSON objects
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionNexus supports the following environment variables:
NEXUS_LISTEN_ADDRESS: Set the address and port to listen on (default:127.0.0.1:8000)NEXUS_CONFIG_PATH: Alternative way to specify config file pathNEXUS_LOG: Set logging level (debug, info, warn, error)NEXUS_LOG_STYLE: Set the style of log output (color, text, json)
Nexus requires a configuration file (default: nexus.toml). Create a basic configuration:
# Add your first MCP server
[mcp.servers.example]
cmd = ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"]See the Server Configuration and MCP Configuration sections for detailed configuration options.
If Docker containers can't reach Nexus:
- Use
host.docker.internalinstead oflocalhoston macOS/Windows - Use the container name in Docker Compose networks
- Ensure proper port mapping with
-p 8000:8000