Skip to main content

Deployments & App Management

DollarDeploy CLI

Deploy apps to your own servers from the command line. Zero DevOps, full control.

1. Purpose

The ddc CLI (DollarDeploy Command Line) is a powerful tool for deploying applications to your own servers directly from your terminal. It automates the entire deployment pipeline: provisioning servers, configuring infrastructure, building applications, and deploying them with HTTPS enabled—all without manual SSH or complex DevOps setup.

What ddc does

  • Creates and provisions virtual machines on Hetzner, DigitalOcean, or DataCrunch
  • Configures servers with Docker, PostgreSQL, Redis, and other services
  • Deploys applications from GitHub repositories or pre-built templates
  • Sets up HTTPS with Let's Encrypt automatically
  • Monitors deployment progress with real-time status updates
  • Cleans up resources when you're done testing

Perfect for CI/CD pipelines, automated testing, quick demos, or deploying production apps without touching AWS consoles.

2. Getting Started

Installation

Install the CLI globally using npm:

npm install -g @dollardeploy/cli

Or run directly with npx:

npx @dollardeploy/cli --help

Generate an API Key

Before using the CLI, you need to generate an API key from your DollarDeploy dashboard. The API key authenticates all requests to the DollarDeploy API.

  • Sign in to DollarDeploy. Go to dollardeploy.com and sign in or create an account.
  • Navigate to Settings. Click on your profile icon and select SettingsAPI Keys.
  • Create a new API Key. Click Create API Key, give it a descriptive name (e.g., "CI Pipeline" or "Local Dev"), and copy the generated key immediately—it won't be shown again.
  • Configure the CLI. Set the API key as an environment variable:
# Add to your shell profile (.bashrc, .zshrc, etc.)
export DOLLARDEPLOY_API_KEY="your-api-key-here"

⚠️ Keep your API key secure

Never commit API keys to the version control (git). Use environment variables or a secrets manager.

3. Configuration

Environment Variables

The CLI supports the following environment variables for configuration:

Variable Description
DOLLARDEPLOY_API_KEY Your API key for authentication (required)
DOLLARDEPLOY_BASE_URL (default https://dollardeploy.com)

Command-Line Arguments

Override settings using command-line flags:

Flag Description
--apiKey API key (overrides env variable)
--provider Cloud provider: hetzner, do, datacrunch
--providerType Instance type (e.g., cpx31 for Hetzner)
--providerRegion Region (e.g., fsn1, fra1)
--providerImage Provider specific OS image (default: ubuntu-24.04)
--hostId Use existing host instead of creating new one
--templateId Deploy from a DollarDeploy template
--url GitHub repository URL to deploy
--services Comma-separated services to install (e.g., docker,postgres)
--timeout Deployment timeout in milliseconds
--remove Cleanup after deployment (true, app, or host)

Provider Defaults

Each provider has sensible defaults:

// Hetzner (default) - 3 CPU, 8GB RAM, 20GB SSD
{
  type: "cpx31",      
  region: "fsn1",
  image: "ubuntu-24.04"
}

// DigitalOcean - 2 CPU 4 GB RAM
{
  type: "s-2vcpu-4gb",
  region: "fra1",
  image: "ubuntu-24-04"
}

// DataCrunch - 4 CPU 16 GB RAM
{
  type: "CPU.4V.16G",
  region: "FIN-01",
  image: "ubuntu-24.04"
}

4. Deploying Apps

Deploy from a Template

The fastest way to deploy is using pre-configured templates:

ddc --templateId nextjs-boilerplate

This creates a new server, provisions it, and deploys the template with a single command.

Deploy from GitHub

Deploy any public or private GitHub repository:

ddc --url https://github.com/your-org/your-app

The CLI will automatically detect your framework and configure the build accordingly.

Deploy to Existing Host

Skip provisioning and deploy to an existing server:

ddc --hostId host_abc123 --url https://github.com/your-org/your-app

Full Example: End-to-End Deployment

# Deploy a Next.js app on Hetzner with PostgreSQL
ddc \
  --url https://github.com/dollardeploy/nextjs-boilerplate \
  --provider hetzner \
  --providerType cpx31 \
  --providerRegion fsn1 \
  --services docker,postgres \
  --app:name my-nextjs-app \
  --app:preStartCmd "npm run db:migrate"

Testing Deployments

For CI/CD or testing, use the --remove flag to automatically clean up:

# Deploy, verify, then tear down
ddc --templateId uptime-kuma --remove true

Options for --remove:

  • true — Remove app and deprovision host
  • app — Remove only the app, keep the host
  • host — Deprovision host (app must be removed first)

Deployment Workflow

Here's what happens when you run ddc:

  1. Create Host Record — Registers a new host in DollarDeploy
  2. Configure Provisioning — Sets up provider, region, and instance type
  3. Provision VM — Creates the virtual machine with your cloud provider
  4. Test Connection — Verifies SSH access to the new server
  5. Install Services — Sets up Docker, databases, etc.
  6. Prepare Host — Configures Nginx, SSL certificates, and monitoring
  7. Deploy App — Clones repo, builds, and starts your application
  8. Health Check — Verifies the app is accessible via HTTPS

5. Programmatic API

The CLI can also be used as a Node.js library for programmatic access:

const { createApiClient, waitForTask } = require('@dollardeploy/cli');

const api = createApiClient(
  'https://dollardeploy.com',
  process.env.DOLLARDEPLOY_API_KEY
);

// List all apps
const apps = await api.listApps();

// Create and deploy a new app
const app = await api.createApp({
  repositoryUrl: 'https://github.com/org/repo',
  hostId: 'host_abc123',
  name: 'my-app'
});

// Build and deploy
const task = await api.buildApp(app.id, { deploy: true });
await waitForTask(api, task.id);

For full API documentation, visit dollardeploy.com/apidocs.