Skip to main content

Overview

Domains in Dokploy allow you to configure custom domains for your applications and compose services with automatic SSL certificate management using Let’s Encrypt or custom certificates.

Create Domain

Add a new domain to an application or compose service.
host
string
required
The domain name (e.g., example.com, app.example.com).
path
string
URL path for routing (e.g., /api, /admin). Leave empty for root path.
port
number
The container port to route traffic to.
https
boolean
default:true
Enable HTTPS for this domain.
certificateType
string
required
SSL certificate type:
  • letsencrypt - Automatic Let’s Encrypt certificate
  • none - No SSL (HTTP only)
  • custom - Use a custom certificate
domainType
string
required
The type of service: application or compose.
applicationId
string
Required if domainType is application.
composeId
string
Required if domainType is compose.
serviceName
string
For compose services, specify which service to route to.
cURL
curl -X POST "https://your-dokploy-instance.com/api/domain.create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "host": "app.example.com",
    "port": 3000,
    "https": true,
    "certificateType": "letsencrypt",
    "domainType": "application",
    "applicationId": "app-123"
  }'

Get Application Domains

Retrieve all domains configured for an application.
applicationId
string
required
The application ID to get domains for.
cURL
curl -X GET "https://your-dokploy-instance.com/api/domain.byApplicationId?applicationId=app-123" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Compose Domains

Retrieve all domains configured for a compose service.
composeId
string
required
The compose application ID.
cURL
curl -X GET "https://your-dokploy-instance.com/api/domain.byComposeId?composeId=compose-123" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Domain Details

Get detailed information about a specific domain.
domainId
string
required
The unique identifier of the domain.
cURL
curl -X GET "https://your-dokploy-instance.com/api/domain.one?domainId=domain-123" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Update Domain

Modify an existing domain configuration.
domainId
string
required
The ID of the domain to update.
host
string
New domain name.
path
string
Updated path.
port
number
New port number.
https
boolean
Enable or disable HTTPS.
certificateType
string
Change certificate type.
cURL
curl -X POST "https://your-dokploy-instance.com/api/domain.update" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domainId": "domain-123",
    "host": "new-domain.example.com",
    "https": true
  }'

Delete Domain

Remove a domain from an application or compose service.
domainId
string
required
The ID of the domain to delete.
cURL
curl -X POST "https://your-dokploy-instance.com/api/domain.delete" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domainId": "domain-123"
  }'

Generate Traefik.me Domain

Generate a wildcard domain using traefik.me for testing purposes.
appName
string
required
The application name to generate domain for.
serverId
string
Server ID if deploying to a specific server.

Response

Returns a generated domain in the format: {appName}-{hash}.{server-ip}.traefik.me
cURL
curl -X POST "https://your-dokploy-instance.com/api/domain.generateDomain" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "appName": "my-app"
  }'

Check Traefik.me Availability

Check if traefik.me domain generation is available for a server.
serverId
string
required
The server ID to check.

Response

Returns the server IP address if traefik.me domains can be generated.
cURL
curl -X GET "https://your-dokploy-instance.com/api/domain.canGenerateTraefikMeDomains?serverId=server-123" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Validate Domain

Verify that a domain’s DNS is correctly configured.
domain
string
required
The domain name to validate.
serverIp
string
Expected server IP address.

Response

Returns validation status and DNS information.
cURL
curl -X POST "https://your-dokploy-instance.com/api/domain.validateDomain" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "app.example.com"
  }'

SSL Certificate Types

Let’s Encrypt

Automatic SSL certificates from Let’s Encrypt:
  • Free and automatic renewal
  • Widely trusted
  • Requires domain to point to your server
  • HTTP-01 challenge for validation
Example
{
  "certificateType": "letsencrypt",
  "https": true
}

Custom Certificate

Use your own SSL certificate:
  • Upload certificate and private key
  • Supports wildcard certificates
  • Manual renewal required
certificate
string
PEM-encoded SSL certificate.
certificateKey
string
PEM-encoded private key.

No SSL

HTTP only (not recommended for production):
Example
{
  "certificateType": "none",
  "https": false
}

Path-Based Routing

Route different paths to different services:
Example: Route /api to backend
curl -X POST "https://your-dokploy-instance.com/api/domain.create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "host": "example.com",
    "path": "/api",
    "port": 8080,
    "https": true,
    "certificateType": "letsencrypt",
    "domainType": "application",
    "applicationId": "backend-app"
  }'

Wildcard Domains

For wildcard domains (e.g., *.example.com):
  1. Use a custom certificate that supports wildcards
  2. Configure DNS with a wildcard A record
  3. Set host to *.example.com

Domain Status

uniqueConfigKey
string
Unique identifier for the domain configuration in Traefik.
certificateType
string
Current SSL certificate type.
https
boolean
Whether HTTPS is enabled.
host
string
The domain name.
port
number
Container port for routing.

Build docs developers (and LLMs) love