Skip to main content

Introduction

Dokploy provides a powerful command-line interface (CLI) and comprehensive REST API that allows you to manage your applications, databases, and infrastructure programmatically. This enables automation, CI/CD integration, and advanced deployment workflows.

Key Capabilities

Application Management

Deploy, update, and manage applications through code

Database Operations

Create and configure databases programmatically

Deployment Automation

Automate deployments with CI/CD pipelines

Infrastructure Control

Manage servers, containers, and resources via API

API Access

The Dokploy API is a RESTful API that provides complete control over your Dokploy instance. All operations available in the web interface can be performed through the API.

API Endpoint

Your API is available at:
https://your-dokploy-instance.com/api

Authentication

All API requests require authentication using an API token. You can generate API tokens from the Dokploy dashboard:
  1. Navigate to Settings > API Tokens
  2. Click Generate New Token
  3. Copy and securely store your token
API tokens provide full access to your Dokploy instance. Keep them secure and never commit them to version control.

Making API Requests

Include your API token in the Authorization header:
curl -X POST https://your-dokploy-instance.com/api/endpoint \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'

Use Cases

CI/CD Integration

Integrate Dokploy with your CI/CD pipeline to automatically deploy applications when code changes:
GitHub Actions Example
name: Deploy to Dokploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Deployment
        run: |
          curl -X POST https://dokploy.example.com/api/deploy \
            -H "Authorization: Bearer ${{ secrets.DOKPLOY_TOKEN }}" \
            -H "Content-Type: application/json" \
            -d '{"applicationId": "app-123"}'

Infrastructure as Code

Define your entire infrastructure in code and deploy it programmatically:
const response = await fetch('https://dokploy.example.com/api/application.create', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'my-app',
    projectId: 'project-123',
    repository: 'https://github.com/user/repo',
    branch: 'main'
  })
});

Automated Backups

Schedule and automate database backups:
#!/bin/bash
curl -X POST https://dokploy.example.com/api/backup.create \
  -H "Authorization: Bearer $DOKPLOY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "databaseId": "db-123",
    "schedule": "0 2 * * *"
  }'

API Documentation

For complete API reference documentation, including all available endpoints, request/response formats, and examples, see:

API Reference

Complete REST API documentation with interactive examples

Getting Started

1

Generate API Token

Create an API token from your Dokploy dashboard under Settings > API Tokens
2

Test Connection

Make a test API call to verify your token works correctly
3

Explore Commands

Review available CLI commands and API endpoints for your use case
4

Build Automation

Create scripts or integrate with your CI/CD pipeline

Next Steps

CLI Commands

Learn about available CLI commands and usage

Automation Guide

Build automated deployment workflows

API Reference

Explore the complete API documentation

Authentication

Learn about API authentication methods
Need help? Join our Discord community for support and examples.

Build docs developers (and LLMs) love