Docker Installation
Run NexaDB in an isolated container on any platform. Universal solution for macOS, Linux, and Windows.
Quick Start
Get NexaDB running in seconds with a single Docker command:
--name nexadb \
-p 6969:6969 \
-p 6970:6970 \
-p 9999:9999 \
-v nexadb-data:/app/nexadb_data \
--restart unless-stopped \
krishcdbry/nexadb:latest
Prerequisites
Docker Engine
- • Docker Engine 20.10+
- • Docker Compose 2.0+ (optional)
- • 2GB free disk space
- • 4GB RAM (8GB+ recommended)
Platform Downloads
Installation Methods
Method 1: Docker Run (Recommended)
Step 1: Pull the Image
Downloads the latest NexaDB Docker image (~200MB compressed).
Step 2: Run the Container
--name nexadb \
-p 6969:6969 -p 6970:6970 -p 9999:9999 \
-v nexadb-data:/app/nexadb_data \
--restart unless-stopped \
krishcdbry/nexadb:latest
Command breakdown:
- -d - Run in detached mode (background)
- --name nexadb - Container name
- -p 6969:6969 - JSON REST API port
- -p 6970:6970 - Binary protocol port
- -p 9999:9999 - Admin UI port
- -v nexadb-data:/app/nexadb_data - Persistent data volume
- --restart unless-stopped - Auto-restart on reboot
Step 3: Verify It's Running
You should see the nexadb container with status "Up".
Method 2: Docker Compose (Production)
Step 1: Create docker-compose.yml
version: '3.8'
services:
nexadb:
image: krishcdbry/nexadb:latest
container_name: nexadb
ports:
- "6969:6969" # JSON REST API
- "6970:6970" # Binary Protocol
- "9999:9999" # Admin Web UI
volumes:
- nexadb-data:/app/nexadb_data
restart: unless-stopped
environment:
- NEXADB_HOST=0.0.0.0
- NEXADB_PORT=6969
- BINARY_PORT=6970
- ADMIN_PORT=9999
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6969/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
nexadb-data:
driver: localStep 2: Start the Stack
Starts NexaDB in the background with health checks and auto-restart.
Step 3: Check Status
Multi-Architecture Support
NexaDB Docker images support both x86_64 and ARM64 architectures. Docker automatically selects the right image for your system.
x86_64 (Intel/AMD)
- ✓ Intel Core processors
- ✓ AMD Ryzen processors
- ✓ Most cloud servers
- ✓ Traditional desktops/laptops
ARM64 (aarch64)
- ✓ Apple Silicon (M1/M2/M3)
- ✓ Raspberry Pi 4/5
- ✓ AWS Graviton
- ✓ Oracle Cloud ARM
Using nexa CLI with Docker
Access the interactive terminal inside your Docker container:
$ docker exec -it nexadb nexa -u root -p
Password: ********
Connected to NexaDB v2.2.0 (Binary Protocol: localhost:6970)
nexa> collections
✓ Found 2 collection(s):
[1] movies
[2] users
nexa> use movies
✓ Switched to collection 'movies'
nexa> count
✓ Collection 'movies' has 1,234 document(s)Container Management
Common Commands
Data Management
Access the Admin Panel
Once the container is running, open your browser and visit:
Default Credentials
⚠️ Change the default password after first login!
Environment Variables
Customize NexaDB behavior with environment variables:
| Variable | Default | Description |
|---|---|---|
| NEXADB_HOST | 0.0.0.0 | Host to bind JSON API |
| NEXADB_PORT | 6969 | JSON REST API port |
| BINARY_PORT | 6970 | Binary protocol port |
| ADMIN_PORT | 9999 | Admin web UI port |
Example with custom ports:
-e NEXADB_PORT=8080 \
-e BINARY_PORT=8081 \
-e ADMIN_PORT=8082 \
-p 8080:8080 -p 8081:8081 -p 8082:8082 \
krishcdbry/nexadb:latest
Troubleshooting
Container Won't Start
Check the logs for errors:
Common issues: port conflicts, insufficient permissions, missing dependencies.
Port Already in Use
Find what's using the port:
Either stop the conflicting service or change NexaDB ports using environment variables.
Data Not Persisting
Ensure you're using a named volume:
Without -v flag, data is lost when container is removed.
Can't Access from Host
Verify port mappings are correct (-p flag) and firewall isn't blocking connections.
Production Best Practices
Security
- ✓ Change default admin password immediately
- ✓ Use Docker secrets for sensitive data
- ✓ Run behind a reverse proxy (nginx/traefik)
- ✓ Enable TLS/SSL for production
- ✓ Limit port exposure with firewall rules
Performance
- ✓ Use named volumes for better I/O
- ✓ Set resource limits (--memory, --cpus)
- ✓ Enable health checks for monitoring
- ✓ Use Docker Compose for multi-service setups
- ✓ Regular backups of data volumes
Next Steps
Now that NexaDB is running in Docker, explore these resources: