Skip to content

Installation ​

Get Nexus up and running in your environment. You can choose between using our hosted service or self-hosting the platform.

Choose Your Installation Method ​

The fastest way to get started is with our hosted service at https://api.nexus.dev.

Pros:

  • No setup required
  • Automatic updates
  • Built-in monitoring
  • 99.9% uptime SLA
  • Free tier available

Getting Started:

  1. Sign up for a free account
  2. Create your first organization
  3. Get your API key
  4. Start sending notifications

🏠 Self-Hosted ​

Run Nexus on your own infrastructure for complete control.

Pros:

  • Full control over data
  • Custom configurations
  • Private network deployment
  • No external dependencies

Requirements:

  • Node.js 20+ or Bun 1.1+
  • PostgreSQL 14+
  • Redis 6+
  • 2GB+ RAM recommended

Self-Hosted Installation ​

Prerequisites ​

Make sure you have the following installed:

bash
# Node.js 20+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

# Or install Bun (recommended)
curl -fsSL https://bun.sh/install | bash

# PostgreSQL
sudo apt update
sudo apt install postgresql postgresql-contrib

# Redis
sudo apt install redis-server

# Git
sudo apt install git
bash
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install dependencies
brew install node  # or use 'brew install oven-sh/bun/bun' for Bun
brew install postgresql@14
brew install redis
brew install git

# Start services
brew services start postgresql@14
brew services start redis
bash
# Node.js 20+
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
sudo yum install -y nodejs

# Or install Bun
curl -fsSL https://bun.sh/install | bash

# PostgreSQL
sudo yum install -y postgresql-server postgresql-contrib
sudo postgresql-setup initdb
sudo systemctl enable postgresql
sudo systemctl start postgresql

# Redis
sudo yum install -y redis
sudo systemctl enable redis
sudo systemctl start redis

# Git
sudo yum install -y git
dockerfile
# Use the official Docker Compose setup (see below)

Method 1: Quick Start with Docker Compose ​

The fastest way to run Nexus locally:

bash
# Clone the repository
git clone <repository-url> nexus
cd nexus

# Copy environment template
cp .env.example .env

# Edit .env with your settings (see configuration below)
nano .env

# Start all services
docker-compose up -d

# Run database migrations
docker-compose exec api bun run db:push

# Check status
docker-compose ps

Default URLs:

Method 2: Manual Installation ​

For development or custom setups:

bash
# Clone the repository
git clone <repository-url> nexus
cd nexus

# Install dependencies
bun install  # or npm install

# Copy environment template
cp .env.example .env

Database Setup ​

sql
-- Connect to PostgreSQL as superuser
sudo -u postgres psql

-- Create database and user
CREATE DATABASE nexus;
CREATE USER nexus_user WITH PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE nexus TO nexus_user;

-- Exit PostgreSQL
\q
bash
# Add to your .env file
DATABASE_URL="postgresql://nexus_user:your_secure_password@localhost:5432/nexus"

Environment Configuration ​

Edit your .env file with the following settings:

bash
# Database
DATABASE_URL="postgresql://nexus_user:password@localhost:5432/nexus"

# Redis
REDIS_URL="redis://localhost:6379"

# API Configuration
API_PORT=3001
WEB_PORT=4000
NODE_ENV=development

# Security
JWT_SECRET="your-super-secret-jwt-key-change-this-in-production"
ENCRYPTION_KEY="your-32-character-encryption-key-here"

# Delivery providers (SendGrid, Resend, Postmark, Mailgun, SMTP, Slack) are not configured
# here: add them as integrations in the dashboard. See /notifications/channels/email
# Optional: messages each environment may send per minute (default 300)
DELIVERY_RATE_LIMIT_PER_MINUTE=300

# Optional: Webhook endpoint for testing
WEBHOOK_URL="https://your-domain.com/webhooks/nexus"

Start the Services ​

bash
# Run database migrations
bun run db:generate
bun run db:push

# Start development servers
bun run dev

# This starts:
# - API server on http://localhost:3001
# - Web dashboard on http://localhost:4000
bash
# Build the applications
bun run build

# Run database migrations
bun run db:push

# Start production servers
bun run start

Method 3: Kubernetes Deployment ​

For production Kubernetes deployments:

bash
# Clone the repository
git clone <repository-url> nexus
cd nexus/k8s

# Edit configurations
cp secrets.example.yaml secrets.yaml
# Edit secrets.yaml with your values

# Deploy to Kubernetes
kubectl apply -f namespace.yaml
kubectl apply -f secrets.yaml
kubectl apply -f postgres.yaml
kubectl apply -f redis.yaml
kubectl apply -f api.yaml
kubectl apply -f web.yaml
kubectl apply -f ingress.yaml

# Check deployment status
kubectl get pods -n nexus

Verification ​

Once installation is complete, verify everything is working:

1. Health Check ​

bash
# Check API health
curl http://localhost:3001/health

# Expected response:
{
  "status": "ok",
  "timestamp": "2024-01-15T10:30:00Z",
  "version": "1.0.0",
  "services": {
    "database": "healthy",
    "redis": "healthy"
  }
}
bash
# Open the dashboard
open http://localhost:4000

# You should see the Nexus login/signup page

2. Create Test Organization ​

bash
# Using the API directly
curl -X POST http://localhost:3001/v1/organizations \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Test Organization",
    "email": "[email protected]"
  }'

# Expected response includes API key:
{
  "data": {
    "id": "org_123",
    "name": "Test Organization",
    "apiKey": "sk_test_abc123...",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

3. Send Test Notification ​

bash
curl -X POST http://localhost:3001/v1/events/trigger \
  -H "Authorization: Bearer sk_test_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "test-notification",
    "to": {
      "email": "[email protected]"
    },
    "payload": {
      "message": "Hello from Nexus!"
    }
  }'
javascript
const response = await fetch('http://localhost:3001/v1/events/trigger', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_test_abc123...',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'test-notification',
    to: { email: '[email protected]' },
    payload: { message: 'Hello from Nexus!' }
  })
})

const result = await response.json()
console.log(result)

Configuration Options ​

Environment Variables ​

VariableDescriptionDefaultRequired
DATABASE_URLPostgreSQL connection string-✅
REDIS_URLRedis connection stringredis://localhost:6379✅
API_PORTAPI server port3001-
WEB_PORTWeb dashboard port4000-
JWT_SECRETJWT signing secret-✅
ENCRYPTION_KEYData encryption key-✅
DELIVERY_RATE_LIMIT_PER_MINUTEMessages each environment may send per minute300-

Provider Configuration ​

Providers are not configured with environment variables. Add them in the dashboard under Integrations: each integration holds one provider's credentials for one environment, stored encrypted. Email (SendGrid, Resend, Postmark, Mailgun, custom SMTP) and Slack deliver today; SMS, push, Amazon SES, Discord and Teams are coming. See Delivery providers for the fields each one needs.

Troubleshooting ​

Common Issues ​

Database Connection Failed ​

bash
# Check if PostgreSQL is running
sudo systemctl status postgresql

# Check connection
psql -h localhost -U nexus_user -d nexus

# Verify DATABASE_URL format
echo $DATABASE_URL

Redis Connection Failed ​

bash
# Check if Redis is running
sudo systemctl status redis

# Test connection
redis-cli ping

# Should return: PONG

Port Already in Use ​

bash
# Find what's using the port
lsof -i :3001
lsof -i :4000

# Kill the process
kill -9 <PID>

Permission Denied ​

bash
# Fix file permissions
sudo chown -R $USER:$USER .
chmod +x scripts/*.sh

Performance Tuning ​

Database Optimization ​

sql
-- Add indexes for better performance
CREATE INDEX CONCURRENTLY idx_messages_subscriber_id ON messages(subscriber_id);
CREATE INDEX CONCURRENTLY idx_messages_created_at ON messages(created_at);
CREATE INDEX CONCURRENTLY idx_events_workflow_id ON events(workflow_id);

Redis Configuration ​

bash
# Edit redis.conf
sudo nano /etc/redis/redis.conf

# Recommended settings:
maxmemory 1gb
maxmemory-policy allkeys-lru
save 900 1
save 300 10
save 60 10000

Security Considerations ​

Production Checklist ​

  • [ ] Change all default passwords
  • [ ] Use strong JWT secrets (32+ characters)
  • [ ] Enable HTTPS/TLS encryption
  • [ ] Configure firewall rules
  • [ ] Set up database backups
  • [ ] Enable audit logging
  • [ ] Configure rate limiting
  • [ ] Use secure environment variable storage

SSL/TLS Setup ​

nginx
server {
    listen 443 ssl http2;
    server_name api.yourdomain.com;
    
    ssl_certificate /path/to/certificate.crt;
    ssl_certificate_key /path/to/private.key;
    
    location / {
        proxy_pass http://localhost:3001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
bash
# Install Certbot
sudo apt install certbot python3-certbot-nginx

# Get certificate
sudo certbot --nginx -d api.yourdomain.com

# Auto-renewal
sudo crontab -e
# Add: 0 12 * * * /usr/bin/certbot renew --quiet

Next Steps ​

Now that Nexus is installed:

  1. Create your first organization
  2. Send your first notification
  3. Set up the notification widget
  4. Configure notification providers

Getting Help ​