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
Log in to your dashboard
Sign in to your Nixopus account
Go to API Keys
Navigate to Settings > API Keys or the onboarding screen
Create a new API key
Click Create API Key and give it a descriptive name
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
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:
| Column | Description |
|---|
| Name | The name you gave the API key |
| Created | When the key was created |
| Expires | Expiration date (or “Never”) |
Regenerating API Keys
If you have an existing API key and need a new one:
- Click Regenerate API Key
- Copy the new key immediately
- 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:
- Go to Settings > API Keys
- Click the delete button next to the key
- 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:
| Platform | How to Add Secrets |
|---|
| GitHub Actions | Repository Settings > Secrets > Actions |
| GitLab CI | Settings > CI/CD > Variables |
| Jenkins | Manage Jenkins > Credentials |
| CircleCI | Project 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
- Verify you copied the entire key
- Check that the key hasn’t been deleted or regenerated
- Ensure you’re using the correct API key for your organization
”Deployment Failed” Error
- Check that your Dockerfile exists and is valid
- Verify all required environment variables are set
- Review the deployment logs in your dashboard
CLI Not Found
- Make sure the installation completed successfully
- Check that the CLI is in your PATH
- Try reinstalling with the install script