Dokploy Provider
Manage Dokploy resources with Terraform:
- Projects and environments
- Applications from GitHub App, plain git, or Docker image sources
- Compose services:
docker-composeprojects 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
- Getting started - configure the provider and apply a first project, database, application and domain.
- Adopting an existing Dokploy instance - import a running server into state without recreating anything.
- Deploy semantics -
deploy_on_change,deployment_timeout, and how deploys fail. - Secrets and sensitive values - environment variables, database passwords, backup credentials.
Before you start
Three things bite hardest, in order:
- API keys are rate-limited, and an exhausted budget returns
401, not429. A large apply can fail as an authentication error against a key that works fine for single requests. See Getting started. dokploy_applicationanddokploy_composeown 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.- MariaDB’s and MongoDB’s default
docker_imagedoes 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 thex-api-keyheader. Falls back to theDOKPLOY_API_KEYenvironment variable.endpoint(String) Base URL of the Dokploy server, e.g.https://dokploy.example.com. Falls back to theDOKPLOY_ENDPOINTenvironment variable.insecure(Boolean) Skip TLS certificate verification (for self-signed endpoints). Defaults tofalse.