A powerful Node.js CLI tool that automates the complete deployment setup for Dokploy. Deploy your applications from local development to live, production-ready environments with custom domains, SSL certificates, and environment variables in just one command.
- π Automatic Repository Management - Creates GitHub repositories if needed
- ποΈ Intelligent Project Detection - Supports both single applications and monorepos
- π Custom Domain Setup - Automatic domain creation with Let's Encrypt SSL
- π§ Environment Variable Configuration - Detects and configures
.env,.env.local, and.env.examplefiles - π One-Command Deployment - Complete setup and deployment in a single command
- π¦ Monorepo Support - Detects and deploys multiple applications from monorepo structures
- π Secure by Default - HTTPS enabled with automatic SSL certificate management
- π Comprehensive Logging - Detailed verbose mode for debugging
npm install -g @joshuarileydev/dokploy-deploynpm install --save-dev @joshuarileydev/dokploy-deploynpx @joshuarileydev/dokploy-deploy- Dokploy Instance - A running Dokploy server with API access
- GitHub CLI - Install from cli.github.com
- Git Repository - Initialize your project with git (or let the CLI do it)
- Environment Variables - Set up your Dokploy credentials
Create a .env file in your project root or set these environment variables:
# Your Dokploy instance URL
DOKPLOY_URL=https://your-dokploy-instance.com
# Your Dokploy API key (get this from your Dokploy dashboard)
DOKPLOY_API_KEY=your-dokploy-api-token
# Your wildcard domain for applications (required)
DOKPLOY_DOMAIN=your-custom-domain.comAuthenticate with GitHub CLI:
gh auth loginNavigate to your project directory and run:
dokploy-deploydokploy-deploy --verbosedokploy-deploy --helpFor a standard single application:
my-app/
βββ package.json
βββ .env # Environment variables (optional)
βββ .env.local # Local environment variables (optional)
βββ .env.example # Example environment variables (optional)
βββ src/
βββ ...
Result: Application deployed at https://my-app.your-domain.com (customize with DOKPLOY_DOMAIN)
For monorepo projects, the CLI automatically detects applications in common directories:
my-monorepo/
βββ package.json
βββ .env # Shared environment variables (optional)
βββ apps/
β βββ api/
β β βββ package.json
β β βββ .env # API-specific environment variables
β β βββ src/
β βββ web/
β βββ package.json
β βββ .env.local # Web-specific environment variables
β βββ src/
βββ packages/ # Also supported
βββ libs/ # Also supported
Result:
- API:
https://my-monorepo-api.your-domain.com - Web:
https://my-monorepo-web.your-domain.com
The CLI automatically detects applications in these directories:
packages/apps/projects/modules/libs/services/components/workspaces/sites/
The CLI looks for environment files in this order:
.env- Main environment file.env.local- Local environment overrides.env.example- Example/template file
For monorepos, the CLI:
- First - Looks for environment files in each app's directory (
apps/api/.env) - Fallback - Uses root directory environment files for shared variables
.env
DATABASE_URL=postgresql://user:password@localhost:5432/mydb
API_KEY=your-api-key-here
NODE_ENV=production
PORT=3000
JWT_SECRET=your-jwt-secret-hereapps/web/.env.local
REACT_APP_API_URL=https://my-app-api.your-domain.com
REACT_APP_TITLE=My Amazing App
REACT_APP_VERSION=1.0.0- π Repository Detection - Checks for existing Git repository
- π¦ GitHub Repository Creation - Creates repository if none exists
- π Project Analysis - Detects single app vs monorepo structure
- ποΈ Dokploy Project Creation - Sets up project in Dokploy
- βοΈ Server Configuration - Configures server and GitHub integration
- π Application Creation - Creates applications for each detected app
- π Repository Configuration - Links GitHub repository with build paths
- π Domain Setup - Creates custom domains with SSL certificates
- π§ Environment Configuration - Uploads environment variables
- π Deployment - Initiates application deployments
- Port: 3000
- SSL: Let's Encrypt (automatic)
- Protocol: HTTPS (enforced)
- Path:
/(root) - Custom Domain: Set
DOKPLOY_DOMAIN=your-domain.comto use your own wildcard domain - Required: You must configure
DOKPLOY_DOMAINenvironment variable for your deployments
# In your Next.js project directory
npm install -g @joshuarileydev/dokploy-deploy
dokploy-deploy# Project structure:
# my-project/
# βββ apps/
# β βββ api/ (Node.js/Express API)
# β βββ web/ (React/Next.js frontend)
dokploy-deploy --verbose# Create .env file
echo "DATABASE_URL=postgresql://user:pass@localhost:5432/db" > .env
echo "API_KEY=your-secret-key" >> .env
# Deploy
dokploy-deploy# Set custom domain
export DOKPLOY_DOMAIN=myapps.example.com
# Deploy (apps will be available at myapp.myapps.example.com)
dokploy-deployπ Dokploy Deploy CLI
Working in: /path/to/my-app
Project name: my-app
β Using Dokploy instance: https://dokploy.example.com
β GitHub repository created: https://github.com/user/my-app
β Single application repository detected
β Dokploy project created: my-app
β Application "app" created, configured, and deployed successfully
β
Deployment setup complete!
Application configured with:
- Repository: https://github.com/user/my-app
- Build path: . (root directory)
- Branch: main
- Domain: https://my-app.your-domain.com
- Port: 3000
- SSL: Let's Encrypt
π Your application will be available at: https://my-app.your-domain.com
π Dokploy Deploy CLI
Working in: /path/to/my-monorepo
Project name: my-monorepo
π Detailed monorepo detection:
π Checking directory structures:
Checking: apps/
β Found 2 potential applications:
- api/ (package.json)
- web/ (package.json)
π Applications that will be deployed:
1. api β apps/api/
2. web β apps/web/
β Environment variables configured for api from .env
β Environment variables configured for web from .env.local
β
Deployment setup complete!
Created applications:
- api β apps/api/
π https://my-monorepo-api.your-domain.com
- web β apps/web/
π https://my-monorepo-web.your-domain.com
π Your applications are being deployed and will be available at the URLs above!
β "DOKPLOY_URL environment variable is required"
# Solution: Set your Dokploy instance URL
export DOKPLOY_URL=https://your-dokploy-instance.comβ "GitHub CLI not authenticated"
# Solution: Authenticate with GitHub
gh auth loginβ "No GitHub integration found"
# Solution: Set up GitHub App integration in your Dokploy dashboard
# The CLI will provide instructions for manual configurationβ "Not a git repository"
# Solution: Initialize git repository
git init
# Or let the CLI do it automaticallyUse verbose mode for detailed logging:
dokploy-deploy --verboseThis shows:
- API requests and responses
- File detection results
- Environment variable parsing
- Detailed error messages
Contributions are welcome! Please feel free to submit a Pull Request.
# Clone the repository
git clone https://github.com/JoshuaRileyDev/dokploy-deploy.git
cd dokploy-deploy
# Install dependencies
npm install
# Test locally
npm link
dokploy-deploy --helpThis project is licensed under the MIT License - see the LICENSE file for details.
- Dokploy - The amazing deployment platform
- GitHub CLI - For seamless GitHub integration
- Commander.js - For CLI argument parsing
- Axios - For HTTP requests
- Chalk - For beautiful terminal colors
- Ora - For elegant terminal spinners
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Issues
- π§ Email: joshua@joshuariley.dev
Made with β€οΈ by Joshua Riley