Deploy Your First Application to CloudNexus

Learn how to scaffold, configure, and deploy a production-ready Node.js application to our global edge network in under 10 minutes.

⏱️ 10 min read
📅 Updated Nov 12, 2025
🏷️ CLI, Deploy, Node.js

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:

Terminal
# Install the official CLI
npm install -g @cloudnexus/cli

# Log in with your account credentials
cloudnexus auth login
💡
Authentication: This command opens your default browser to the OAuth consent screen. After authorizing, the CLI securely stores your token in ~/.cloudnexus/config.json.

2. Initialize Project

Generate a pre-configured project template with best practices for routing, environment variables, and edge runtime optimization:

Terminal
# 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:

cloudnexus.yaml
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)"
⚠️
Secrets Management: Never hardcode credentials. Use 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:

Terminal
# 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:

Terminal
# 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 login and your token hasn't expired.
  • "Build failed: Node version mismatch" → Update the runtime field in cloudnexus.yaml to match your local version.
  • "502 Bad Gateway" → Check that your app binds to process.env.PORT and starts within 30 seconds of boot.
Still stuck? Run cloudnexus doctor to automatically diagnose configuration, network, and authentication issues.

Next Steps