@dollardeploy/cli
v0.1.12
Published
DollarDeploy CLI tool for deploying apps and managing hosts
Maintainers
Readme
@dollardeploy/cli
Deploy apps to your own servers from the command line. Zero DevOps, full control.
The DollarDeploy CLI (ddc) automates the entire deployment pipeline—from provisioning servers to deploying applications with HTTPS—all from your terminal. Perfect for CI/CD, automated testing, or shipping production apps without touching AWS consoles or writing infrastructure code.
What it does
- Provisions VMs on Hetzner, DigitalOcean, or DataCrunch
- Configures servers with Docker, PostgreSQL, Redis, and more
- Deploys apps from GitHub repos or pre-built templates
- Sets up HTTPS with Let's Encrypt automatically
- Monitors progress with real-time status updates
- Cleans up resources when you're done testing
Installation
npm install -g @dollardeploy/cliOr use npx directly:
npx @dollardeploy/cli --helpQuick Start
1. Get an API Key
- Sign in at dollardeploy.com
- Go to Settings → API Keys
- Click Create API Key and copy it
2. Set Your API Key
You can also run ddc with --apiKey <API-KEY> argument instead of setting the environment variable.
export DOLLARDEPLOY_API_KEY="your-api-key-here"3. Deploy
# Deploy from a template
ddc --templateId nextjs-boilerplate
# Deploy from GitHub
ddc --url https://github.com/your-org/your-appConfiguration
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| DOLLARDEPLOY_API_KEY | Your API key | — |
| DOLLARDEPLOY_BASE_URL | API base URL | https://dollardeploy.com |
Command-Line Options
| Option | Description |
|--------|-------------|
| --apiKey | API key (generate it in Settings) |
| --provider | Cloud provider: hetzner, do, datacrunch |
| --providerType | Instance type (e.g., cpx31) |
| --providerRegion <region> | Region (e.g., fsn1, fra1) |
| --providerImage <image> | Provider specific OS image (default: ubuntu-24.04) |
| --hostId <id> | Deploy to an existing host |
| --templateId <id> | Deploy from a template, see all templates here |
| --url | GitHub repository URL |
| --services | Services to install (comma-separated) |
| --timeout | Timeout in milliseconds (default: 600000) |
| --remove | Cleanup after deploy: true, app, or host |
| --app:<property> <value> | Custom app property |
Provider Defaults
// Hetzner (default)
{ type: "cpx31", region: "fsn1", image: "ubuntu-24.04" }
// DigitalOcean
{ type: "s-2vcpu-4gb", region: "fra1", image: "ubuntu-24-04" }
// DataCrunch
{ type: "CPU.4V.16G", region: "FIN-01", image: "ubuntu-24.04" }Usage Examples
Deploy a Template
Deploy Twenty CRM, a popular open-source CRM system to a newly created host on Hetzner. You need to connect DollarDeploy to Hetzner first.
ddc --templateId twenty-crmDeploy your own app from GitHub
This will create new app and deploy it to an existing host. Fork the NextJS boilerplate template to your own account before deploying it.
ddc \
--url https://github.com/dollardeploy/nextjs-boilerplate \
--hostId <my-host-id> \
--services docker,postgres \
--app:name my-new-appTest Deployment (auto-cleanup)
# Deploy, verify, then tear down everything
ddc --templateId nextjs-boilerplate --remove trueProgrammatic Usage
Use the CLI as a Node.js library:
const { createApiClient, waitForTask, checkUrl } = require('@dollardeploy/cli');
const api = createApiClient(
'https://dollardeploy.com',
process.env.DOLLARDEPLOY_API_KEY
);
// List all hosts
const hosts = await api.listHosts();
// Create a new host
const host = await api.createHost('my-server');
// Configure provisioning
await api.saveProvision(host.id, {
provider: 'hetzner',
providerType: 'cpx31',
providerRegion: 'fsn1',
image: 'ubuntu-24.04'
});
// Start provisioning
const task = await api.startProvision(host.id);
await waitForTask(api, task.id);
// Deploy an app
const app = await api.createApp({
repositoryUrl: 'https://github.com/org/repo',
hostId: host.id,
name: 'my-app'
});
// Build and deploy
const buildTask = await api.buildApp(app.id, { deploy: true });
await waitForTask(api, buildTask.id);
// Verify deployment
await checkUrl(`https://${app.hostname}`);API Client Methods
Hosts
| Method | Description |
|--------|-------------|
| createHost(name?) | Create a new host |
| getHost(id) | Get host details |
| listHosts(status?) | List all hosts |
| updateHost(id, data) | Update host configuration |
| deleteHost(id) | Delete a host |
| testConnection(hostId) | Test SSH connection |
| prepareHost(hostId) | Prepare host for deployments |
Provisioning
| Method | Description |
|--------|-------------|
| getProvision(hostId) | Get provision config |
| saveProvision(hostId, data) | Save provision config |
| provisionHost(hostId) | Start provisioning |
| startProvision(hostId) | Alias for provisionHost |
| deprovisionHost(hostId) | Deprovision and delete |
Services
| Method | Description |
|--------|-------------|
| listServices(hostId) | List installed services |
| createService(hostId, type) | Install a service |
Apps
| Method | Description |
|--------|-------------|
| createApp(config) | Create a new app |
| getApp(id) | Get app details |
| listApps() | List all apps |
| updateApp(id, data) | Update app configuration |
| suggestApp(app) | Get AI configuration suggestions |
| buildApp(id, options?) | Build app (optionally deploy) |
| deployApp(id) | Deploy built app |
| deleteApp(id) | Delete an app |
| removeApp(id, options?) | Remove app from host |
Templates
| Method | Description |
|--------|-------------|
| getTemplates() | List all templates |
| getTemplate(id) | Get template details |
| launchTemplate(config) | Launch from template |
Tasks
| Method | Description |
|--------|-------------|
| getTask(id) | Get task status |
| getTaskJournal(id) | Get task logs |
Exported Functions
const { createApiClient, waitForTask, checkUrl } = require('@dollardeploy/cli');
// Create API client
const api = createApiClient(baseUrl, apiKey);
// Wait for async task to complete
await waitForTask(api, taskId, timeout?);
// Check if URL is accessible
await checkUrl(url, retries?, interval?);Deployment Workflow
When you run ddc, here's what happens:
- Create Host Record — Registers a new host in DollarDeploy
- Configure Provisioning — Sets up provider, region, and instance type
- Provision VM — Creates the virtual machine
- Test Connection — Verifies SSH access
- Install Services — Sets up Docker, databases, etc.
- Prepare Host — Configures Nginx, SSL, and monitoring
- Deploy App — Clones repo, builds, and starts application
- Health Check — Verifies app is accessible via HTTPS
CI/CD Integration
GitHub Actions
name: Deploy to DollarDeploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Deploy
env:
DOLLARDEPLOY_API_KEY: ${{ secrets.DOLLARDEPLOY_API_KEY }}
run: |
npx @dollardeploy/cli \
--url ${{ github.server_url }}/${{ github.repository }} \
--hostId ${{ vars.HOST_ID }}Links
- Website: dollardeploy.com
- Documentation: docs.dollardeploy.com
- API Reference: dollardeploy.com/apidocs
- GitHub: github.com/dollardeploy
- Discord: Join our community
License
MIT © DollarDeploy
