Skip to main content

Overview

Dokploy provides flexible deployment workflows that support multiple source types, build methods, and deployment strategies. Deploy from Git repositories, Docker registries, or direct file uploads with automated builds and rollback capabilities.

Deployment Workflow

Every deployment in Dokploy follows a consistent lifecycle:
1

Source Retrieval

Dokploy fetches your application code from:
  • Git repository (GitHub, GitLab, Bitbucket, Gitea, or custom Git)
  • Docker registry (pre-built images)
  • Direct upload (ZIP file drop)
2

Build Phase

Your application is built using one of:
  • Nixpacks - Auto-detect framework and build
  • Dockerfile - Custom Docker build
  • Heroku Buildpacks - Heroku-compatible builds
  • Paketo Buildpacks - Cloud Native Buildpacks
  • Railpack - Optimized for Ruby on Rails
  • Static - Static site generation
3

Image Creation

A Docker image is created and optionally pushed to a registry:
4

Container Deployment

The image is deployed as a Docker Swarm service with:
  • Environment variables
  • Volume mounts
  • Port mappings
  • Resource limits
  • Health checks
5

Health Verification

Dokploy verifies the deployment:
  • Container starts successfully
  • Health checks pass (if configured)
  • Application responds on configured port

Deployment Types

Manual Deployment

Trigger deployments manually from the Dokploy dashboard.
Use cases:
  • Initial deployment
  • Testing before automation
  • Emergency hotfixes
  • Rollback to specific version

Automatic Deployment

Deploy automatically when code changes are pushed to your repository. Trigger types:
  • Push - Deploy on every push to the configured branch
  • Tag - Deploy only when new Git tags are created
  • Pull Request - Create preview deployments for PRs
Automatic deployments require webhook configuration. See Git Integration for setup instructions.

Rebuild Deployment

Rebuild an application without fetching new code from the repository.
Use cases:
  • Environment variable changes
  • Build configuration updates
  • Clear cache and rebuild
  • Apply new base image updates

Drop Deployment

Upload and deploy a ZIP file directly without Git integration.
Use cases:
  • Quick prototypes
  • Closed-source applications
  • Build artifacts from CI/CD
  • Temporary deployments

Deployment States

Applications transition through different states during deployment:

idle

No deployment in progress. Application is stopped or ready to deploy.

running

Deployment in progress. Building or starting the application.

done

Deployment completed successfully. Application is running.

error

Deployment failed. Check logs for error details.

Deployment History

Dokploy maintains a complete history of all deployments:
Each deployment record includes:
string
Unique deployment identifier
string
Deployment title (e.g., commit message)
string
Additional deployment details (e.g., commit hash)
enum
Deployment status: running, done, error, cancelled
string
Path to deployment logs for debugging
string
Deployment timestamp
number
Process ID of the deployment job (for cancellation)

Deployment Logs

All deployment output is streamed to logs in real-time:
Log format:
Logs are preserved even after deployment completion for debugging and auditing.

Queue Management

Dokploy uses a job queue to manage concurrent deployments:
Queue states:
  • waiting - Job is queued but not started
  • active - Job is currently executing
  • completed - Job finished successfully
  • failed - Job failed with errors
  • delayed - Job is scheduled for later

Cancelling Deployments

Cancel a running deployment:
Cancelling a deployment may leave the application in an inconsistent state. Consider redeploying after cancellation.

Rollback Deployments

Dokploy supports rolling back to previous deployments:

Enable Rollback

Perform Rollback

  1. Navigate to Deployments tab
  2. Find the previous successful deployment
  3. Click Rollback button
  4. Confirm rollback action
Rollback images are automatically tagged and stored in the configured rollback registry.

Multi-Server Deployments

Deploy applications across multiple servers:
Benefits:
  • Centralized builds - Build on powerful servers
  • Edge deployment - Deploy close to users
  • Resource isolation - Separate build and runtime
  • Multi-region - Deploy globally
Multi-server deployments are available in Dokploy Cloud. Self-hosted instances support single-server deployments.

Build Caching

Speed up deployments with build caching:

Enable Cache

Clear Cache

Cache benefits:
  • Faster dependency installation
  • Reduced network bandwidth
  • Lower build times
  • Improved consistency
Clear cache if you encounter build issues or need to force fresh installations.

Deployment Notifications

Receive notifications about deployment events:

Build Success

Notify when deployments complete successfully

Build Failure

Alert when deployments fail with error details

Application Down

Warn when applications stop unexpectedly

Health Check Failed

Alert when health checks fail repeatedly
See Notifications for setup instructions.

Best Practices

Build Configuration

Pinning versions ensures consistent builds across deployments.
Exclude unnecessary files to speed up builds and reduce image size.
Smaller images deploy faster and use less disk space.

Deployment Strategy

  1. Test in Staging - Always test deployments in staging before production
  2. Use Health Checks - Configure health checks for automatic recovery
  3. Monitor Resources - Watch CPU and memory usage during deployments
  4. Enable Rollback - Store previous images for quick rollback
  5. Review Logs - Check deployment logs after each deployment

Security

  1. Never Commit Secrets - Use environment variables for sensitive data
  2. Scan Images - Enable vulnerability scanning on registries
  3. Update Dependencies - Keep base images and packages updated
  4. Minimize Permissions - Run containers with minimal privileges
  5. Use Private Registries - Store proprietary images in private registries

Next Steps

Git Integration

Connect Git repositories and configure webhooks

Docker Registry

Configure registries for pulling and pushing images

Build Configuration

Customize build process and optimize builds

Environment Variables

Manage application configuration and secrets

First Deployment

Step-by-step deployment tutorial

Monitoring

Monitor deployments and application health

Troubleshooting

Symptoms: Deployment shows running but never completesSolutions:
  1. Check deployment logs for errors:
  2. Verify sufficient disk space:
  3. Kill stuck deployment process:
Symptoms: Timeouts or connection refused errors during buildSolutions:
  1. Check server internet connectivity
  2. Verify DNS resolution
  3. Configure HTTP proxy if behind firewall:
  4. Increase timeout limits in build configuration
Symptoms: Deployment completes but application status shows errorSolutions:
  1. Check application logs:
  2. Verify start command is correct
  3. Ensure port configuration matches application
  4. Check for missing environment variables
  5. Verify database connectivity