Skip to main content
Deploy your applications from the command line or integrate Nixopus into your CI/CD pipeline using API keys.

When to Use CLI Deployment

  • CI/CD Pipelines - Integrate with GitHub Actions, GitLab CI, Jenkins, etc.
  • Local Development - Deploy directly from your machine
  • Scripted Deployments - Automate deployments with custom scripts
  • No GitHub - Deploy from GitLab, Bitbucket, or local repositories

Getting Your API Key

1

Log in to your dashboard

Sign in to your Nixopus account
2

Go to API Keys

Navigate to Settings > API Keys or the onboarding screen
3

Create a new API key

Click Create API Key and give it a descriptive name
4

Copy your key

Copy the API key immediately and store it securely
Important: Your API key is only shown once. Save it in a secure location like a password manager or your CI/CD secrets. If you lose it, you’ll need to generate a new one.

Installing the CLI

macOS / Linux

curl -fsSL https://nixopus.com/install.sh | sh

Verify Installation

nixopus --version

Basic Usage

Deploy a Project

From your project directory (where your Dockerfile is located):
nixopus deploy --api-key YOUR_API_KEY

With Environment Variables

nixopus deploy \
  --api-key YOUR_API_KEY \
  --env DATABASE_URL=postgres://... \
  --env API_SECRET=your-secret

API Key Management

Viewing Your API Keys

Go to Settings > API Keys to see all your API keys:
ColumnDescription
NameThe name you gave the API key
CreatedWhen the key was created
ExpiresExpiration date (or “Never”)

Regenerating API Keys

If you have an existing API key and need a new one:
  1. Click Regenerate API Key
  2. Copy the new key immediately
  3. Update your CI/CD secrets and scripts
Regenerating an API key invalidates the old one immediately. Make sure to update all places where the old key is used.

Deleting API Keys

To revoke an API key:
  1. Go to Settings > API Keys
  2. Click the delete button next to the key
  3. Confirm deletion

CI/CD Integration

GitHub Actions

name: Deploy to Nixopus

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install Nixopus CLI
        run: curl -fsSL https://nixopus.com/install.sh | sh
      
      - name: Deploy
        run: nixopus deploy --api-key ${{ secrets.NIXOPUS_API_KEY }}

GitLab CI

deploy:
  stage: deploy
  script:
    - curl -fsSL https://nixopus.com/install.sh | sh
    - nixopus deploy --api-key $NIXOPUS_API_KEY
  only:
    - main

Environment Variables in CI/CD

Store your API key as a secret in your CI/CD platform:
PlatformHow to Add Secrets
GitHub ActionsRepository Settings > Secrets > Actions
GitLab CISettings > CI/CD > Variables
JenkinsManage Jenkins > Credentials
CircleCIProject Settings > Environment Variables

Best Practices

Secure Your API Keys

  • Never commit API keys to your repository
  • Use environment variables or CI/CD secrets
  • Rotate keys periodically
  • Use separate keys for different environments

Name Your Keys Descriptively

Use clear names like:
  • production-ci-deployment
  • staging-github-actions
  • local-development
This makes it easy to identify and manage keys later.

Troubleshooting

”Invalid API Key” Error

  1. Verify you copied the entire key
  2. Check that the key hasn’t been deleted or regenerated
  3. Ensure you’re using the correct API key for your organization

”Deployment Failed” Error

  1. Check that your Dockerfile exists and is valid
  2. Verify all required environment variables are set
  3. Review the deployment logs in your dashboard

CLI Not Found

  1. Make sure the installation completed successfully
  2. Check that the CLI is in your PATH
  3. Try reinstalling with the install script