Prerequisites

Before proceeding, ensure you have the following installed:

  • Node.js 18.x or higher
  • Git 2.30+
  • Package Manager: npm, yarn, pnpm, or bun
  • Access to a CloudNexus account with API permissions
ℹ️
Note

This guide assumes you're using a Unix-like terminal (macOS, Linux, or WSL on Windows). Windows CMD/PowerShell paths may vary slightly.

Step 1: Install the CloudNexus CLI

The CloudNexus CLI is the primary interface for managing projects, environments, and deployments. Install it globally using your preferred package manager:

Terminal
# Using npm
npm install -g @cloudnexus/cli

# Using yarn
yarn global add @cloudnexus/cli

# Using pnpm
pnpm add -g @cloudnexus/cli

# Using bun
bun install -g @cloudnexus/cli

Verify the installation by checking the version:

Verification
cnx --version
# Output: @cloudnexus/cli v2.4.1

Step 2: Authenticate & Configure

Initialize the CLI and link it to your CloudNexus workspace. This will prompt you to log in via OAuth in your browser.

Authentication
cnx auth login

# After browser authentication completes:
# ✓ Authenticated as developer@company.io
# ✓ Linked to workspace: production-cluster-alpha

Configure your default region and environment preferences:

Configuration
cnx config set region us-east-1
cnx config set env dev
cnx config set provider aws
⚠️
Security Notice

Never commit your ~/.cloudnexus/config.json file to version control. It contains sensitive tokens. Use .cnxignore to exclude it.

Step 3: Create a Project & Environment

Initialize a new CloudNexus project in your working directory. This will scaffold the required configuration files.

Project Initialization
cd /path/to/your/project
cnx init

# Select options:
# ✓ Framework: Next.js / Node.js / Python / Go
# ✓ Region: us-east-1
# ✓ Auto-scaling: Enabled
# ✓ Database: Managed PostgreSQL

This generates the following structure:

Directory Structure
my-project/
├── .cloudnexus/
│   ├── config.json      # Project settings
│   ├── env.dev.json     # Development variables
│   └── env.prod.json    # Production variables
├── cnx.yaml             # Deployment manifest
└── package.json

Managing Environment Variables

CloudNexus uses encrypted environment files. Never store secrets directly in code. Use the CLI to manage them securely:

Environment Variables
# Add a new encrypted variable
cnx env set DATABASE_URL --env dev

# List current variables
cnx env list --env dev

# Sync local .env to CloudNexus
cnx env sync --from .env --env dev

Step 4: Verify Installation

Run a quick connectivity test to ensure your environment is properly configured and can reach the CloudNexus edge network.

Health Check
cnx status

# Output:
# ├─ Auth: ✓ Valid (expires in 24h)
# ├─ Region: ✓ us-east-1 (latency: 12ms)
# ├─ Network: ✓ Anycast routing active
# └─ CLI:   ✓ v2.4.1 (latest)

# ✓ Environment ready for deployment
💡
Pro Tip

Use cnx telemetry disable to opt out of anonymous usage statistics if required by your organization's compliance policies.

Troubleshooting

Authentication Failures

If cnx auth login fails, clear your cached tokens and retry:

Reset Auth
cnx auth logout
cnx auth login --force

Network Timeouts

Corporate firewalls may block edge endpoints. Configure a proxy if needed:

Proxy Configuration
cnx config set proxy http://corp-proxy.company.internal:8080