Skip to main content
Domains in Dokploy control how your applications and compose services are accessed over HTTP/HTTPS. You can configure custom domains, SSL certificates, path-based routing, and advanced Traefik settings.

Create Domain

curl -X POST https://your-dokploy-instance.com/api/trpc/domain.create \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "host": "example.com",
    "path": "/",
    "port": 3000,
    "https": true,
    "certificateType": "letsencrypt",
    "applicationId": "app_abc123",
    "domainType": "application"
  }'

Request Body

host
string
required
The hostname or domain name (e.g., example.com, api.example.com). Cannot have leading or trailing spaces.
path
string
default:"/"
URL path for routing (e.g., /api, /v1). Defaults to /.
port
number
default:3000
Port number where your application listens. Must be between 1 and 65535.
https
boolean
default:false
Enable HTTPS for this domain. When true, you must specify a certificateType.
certificateType
enum
SSL certificate type. Required when https is true.
customCertResolver
string
Name of the custom Traefik certificate resolver. Required when certificateType is custom.
applicationId
string
ID of the application this domain belongs to. Required for application domains.
composeId
string
ID of the compose service this domain belongs to. Required for compose domains.
serviceName
string
Name of the service within a compose file. Required for compose domains.
domainType
enum
default:"application"
Type of domain being created.
previewDeploymentId
string
ID of the preview deployment. Required when domainType is preview.
internalPath
string
default:"/"
Internal path to rewrite requests to. Must start with / if specified. Useful for path-based routing.
stripPath
boolean
default:false
Strip the path prefix before forwarding to the service. Can only be enabled when a path other than / is specified.

Update Domain

curl -X POST https://your-dokploy-instance.com/api/trpc/domain.update \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domainId": "domain_xyz789",
    "host": "app.example.com",
    "https": true,
    "certificateType": "letsencrypt",
    "port": 8080
  }'

Request Body

domainId
string
required
ID of the domain to update.
host
string
required
The hostname or domain name.
path
string
URL path for routing.
port
number
Port number (1-65535).
https
boolean
Enable HTTPS.
certificateType
enum
SSL certificate type: letsencrypt, none, or custom.
customCertResolver
string
Custom certificate resolver name.
serviceName
string
Service name (for compose domains).
domainType
enum
Domain type: application, compose, or preview.
internalPath
string
Internal path for rewrites.
stripPath
boolean
Strip path prefix before forwarding.

Get Domain

curl -X GET "https://your-dokploy-instance.com/api/trpc/domain.one?domainId=domain_xyz789" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Query Parameters

domainId
string
required
ID of the domain to retrieve.

Response

domainId
string
Unique identifier for the domain.
host
string
The hostname or domain name.
path
string
URL path for routing.
port
number
Port number.
https
boolean
Whether HTTPS is enabled.
certificateType
string
SSL certificate type.
uniqueConfigKey
number
Unique configuration key for Traefik.
applicationId
string
Associated application ID.
composeId
string
Associated compose service ID.
createdAt
string
ISO 8601 timestamp when the domain was created.

Get Domains by Application

curl -X GET "https://your-dokploy-instance.com/api/trpc/domain.byApplicationId?applicationId=app_abc123" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Query Parameters

applicationId
string
required
ID of the application.

Response

Returns an array of domain objects associated with the application.

Get Domains by Compose

curl -X GET "https://your-dokploy-instance.com/api/trpc/domain.byComposeId?composeId=compose_def456" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Query Parameters

composeId
string
required
ID of the compose service.

Delete Domain

curl -X POST https://your-dokploy-instance.com/api/trpc/domain.delete \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domainId": "domain_xyz789"
  }'

Request Body

domainId
string
required
ID of the domain to delete.

Generate Traefik.me Domain

Automatically generate a *.traefik.me domain for testing without DNS configuration.
curl -X POST https://your-dokploy-instance.com/api/trpc/domain.generateDomain \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "appName": "my-app",
    "serverId": "server_123"
  }'

Request Body

appName
string
required
Name of the application.
serverId
string
Optional server ID. If not provided, uses the default server.

Response

Returns a generated *.traefik.me domain that resolves to your server’s IP address.

Validate Domain

Check if a domain’s DNS is properly configured to point to your Dokploy instance.
curl -X POST https://your-dokploy-instance.com/api/trpc/domain.validateDomain \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "serverIp": "192.0.2.1"
  }'

Request Body

domain
string
required
Domain name to validate.
serverIp
string
Expected IP address. If not provided, uses the server’s configured IP.

Response

Returns validation results indicating whether the domain’s DNS records are correctly configured.

Build docs developers (and LLMs) love