Prerequisites
Before you begin, ensure you have the following installed on your local machine:
- Node.js 18.x or higher
- npm or yarn package manager
- A CloudNexus account (sign up free at console.cloudnexus.io)
- Basic familiarity with terminal commands
1. Install CLI & Authenticate
The CloudNexus CLI is the primary interface for managing your infrastructure. Install it globally using npm:
# Install the official CLI npm install -g @cloudnexus/cli # Log in with your account credentials cloudnexus auth login
~/.cloudnexus/config.json.2. Initialize Project
Generate a pre-configured project template with best practices for routing, environment variables, and edge runtime optimization:
# Create new directory and initialize mkdir my-edge-app && cd my-edge-app cloudnexus init --template node-express # Install dependencies npm install
This creates a structured project with a src/ directory, cloudnexus.yaml config file, and sample route handlers.
3. Configure Infrastructure
Open cloudnexus.yaml in your preferred editor. This file defines your compute resources, scaling rules, and region targeting:
version: "2.1" project: "my-edge-app" runtime: "nodejs18" compute: instance_type: "nano" min_replicas: 2 max_replicas: 50 scale_strategy: "concurrency" network: edge_regions: "auto" cache_ttl: 300 force_ssl: true environment: DATABASE_URL: "env(DATABASE_URL)" API_SECRET: "env(API_SECRET)"
env(VAR_NAME) syntax to reference secrets stored in the CloudNexus Vault.4. Deploy to Edge
Push your code to the global network. The CLI automatically builds, optimizes, and distributes your app across 50+ regions:
# Deploy to production with zero-downtime cloudnexus deploy --prod ✓ Build complete (4.2s) ✓ Optimizing bundle... (1.8s) ✓ Distributing to 48 edge nodes... ✓ Health checks passed ✓ Live: https://my-edge-app.cloudnexus.dev
Your application is now live! DNS propagation typically takes < 60 seconds. Use the provided URL or point a custom domain in the Dashboard.
5. Monitor & Scale
Track real-time metrics and configure auto-scaling policies from the CLI or web console:
# Stream live logs cloudnexus logs --follow --prod # View real-time metrics cloudnexus metrics --interval 5s
The dashboard provides CPU, memory, request latency, and error rate tracking. Alerts can be routed to Slack, PagerDuty, or email.
Troubleshooting
Common Issues
- "Permission denied" → Ensure you ran
cloudnexus auth loginand your token hasn't expired. - "Build failed: Node version mismatch" → Update the
runtimefield incloudnexus.yamlto match your local version. - "502 Bad Gateway" → Check that your app binds to
process.env.PORTand starts within 30 seconds of boot.
cloudnexus doctor to automatically diagnose configuration, network, and authentication issues.