wihan/dev

docs /dokploy

markdown
browse the dokploy docs

Dokploy Provider

Manage Dokploy resources with Terraform:

  • Projects and environments
  • Applications from GitHub App, plain git, or Docker image sources
  • Compose services: docker-compose projects and Docker Swarm stacks, from GitHub App, plain git, or an inline compose file
  • Databases: PostgreSQL, MySQL, MariaDB, MongoDB, Redis and LibSQL
  • Routing: domains, published ports, Traefik redirects, HTTP basic auth
  • Storage: bind, volume and file mounts on any service
  • Backups: S3-compatible destinations, scheduled database dumps and Docker volume archives
  • Scheduling: cron jobs against a service, a remote server, or the Dokploy host

with deploy-on-change semantics and full import support throughout.

Works with Terraform >= 1.5 and OpenTofu. Developed and tested against Dokploy v0.30.2; newer releases are exercised by the acceptance suite as they ship, older ones are untested.

Guides

Before you start

Three things bite hardest, in order:

  1. API keys are rate-limited, and an exhausted budget returns 401, not 429. A large apply can fail as an authentication error against a key that works fine for single requests. See Getting started.
  2. dokploy_application and dokploy_compose own their whole service. Applying either replaces anything changed in the Dokploy UI. Manage a service in Terraform or in the UI, not both. See Adopting an existing Dokploy instance.
  3. MariaDB’s and MongoDB’s default docker_image does not exist on Docker Hub. Set an explicit tag or every deploy fails. See Deploy semantics.

This provider is pre-1.0: breaking changes land in minor releases until v1.0.0. Pin an exact version if you need stability.

Example Usage

provider "dokploy" {
  endpoint = "https://dokploy.example.com"
  # api_key sourced from the DOKPLOY_API_KEY environment variable
}

Schema

Optional

  • api_key (String, Sensitive) Dokploy API key, sent as the x-api-key header. Falls back to the DOKPLOY_API_KEY environment variable.
  • endpoint (String) Base URL of the Dokploy server, e.g. https://dokploy.example.com. Falls back to the DOKPLOY_ENDPOINT environment variable.
  • insecure (Boolean) Skip TLS certificate verification (for self-signed endpoints). Defaults to false.