Dokploy

AI Assistant

Generate Docker Compose templates and investigate deployment or runtime logs with AI.

Dokploy integrates with AI providers to let you generate Docker Compose templates from natural language. Describe what you want to deploy, and the AI generates the configuration for you.

Dokploy does not include its own AI model. You need to connect an external provider (like OpenAI, Anthropic, or any OpenAI-compatible API) with your own API key.

Setting up an AI provider

  1. Go to Settings.
  2. Navigate to the AI section.
  3. Click Add AI Provider.
  4. Fill in the configuration:
FieldDescription
NameA label for this provider (e.g., "OpenAI", "Claude", "Local LLM")
API URLThe API endpoint (e.g., https://api.openai.com/v1 for OpenAI)
API KeyYour API key for authentication
ModelThe model to use (e.g., gpt-4o, claude-sonnet-4-20250514)
  1. Click Save.

You can configure multiple providers and switch between them.

After you save a provider, its API key is never shown again, not even to admins: the field displays ********. Leave it untouched to keep the current key while you change other settings such as the model. Typing a new value replaces the key. If you change the API URL, enter the API key again: the model list can't be loaded with the stored key for a different URL.

Compatible providers

Any provider that exposes an OpenAI-compatible API works with Dokploy. Some examples:

ProviderAPI URLModels
OpenAIhttps://api.openai.com/v1gpt-4o, gpt-4o-mini, o1, etc.
Anthropichttps://api.anthropic.com/v1claude-sonnet-4-20250514, claude-haiku-4-5-20251001, etc.
Ollama (local)http://localhost:11434/v1llama3, mistral, codellama, etc.
OpenRouterhttps://openrouter.ai/api/v1Multiple providers through one API
Azure OpenAIhttps://{resource}.openai.azure.com/openaigpt-4o, gpt-4, etc.

Generating Docker Compose templates

Once you have a provider configured, you can use AI to generate Docker Compose templates when creating a new Compose service.

How it works

  1. Create a new Docker Compose service.
  2. Click the AI Generate button.
  3. Describe what you want to deploy in natural language.
  4. The AI generates a complete docker-compose.yml with:
    • Service definitions
    • Environment variables with sensible defaults
    • Volumes and networks
    • Any additional config needed
  5. Review and edit the generated configuration as needed.
  6. Deploy.

Example prompts

  • "A WordPress site with MySQL and Redis for caching"
  • "Grafana with Prometheus for monitoring"
  • "A Node.js API with MongoDB and Redis"
  • "Plausible Analytics with PostgreSQL and ClickHouse"
  • "Gitea with a PostgreSQL database"

Always review the generated configuration before deploying. The AI provides a starting point — you may need to adjust environment variables, resource limits, or volumes for your specific use case.

Analyzing deployment and runtime logs

Open a deployment log dialog or a runtime log viewer, click AI, select a provider, and click Analyze latest N lines. Dokploy fetches recent logs directly for that deployment, container, or Swarm service. The analysis does not depend on the viewer's search, filters, or loaded-line count.

Configure each provider separately under Settings → AI → Edit AI:

SettingDefaultBehavior
Log lines sent to AI200Fetch up to this many recent lines for deployment and runtime analysis. Accepts 1–10,000 lines.
Inspect source code when analyzing logsOffAllow the model to list, search, and read relevant source files alongside the logs. Requires a model that supports tool calling.

The result shows the actual number of log lines analyzed, whether source was inspected, and the inspected file paths. Log content is limited to 1 MiB; any truncation is reported. If your model rejects the context size, lower its log-line limit or disable source inspection.

Source inspection

When enabled, the agent reads the application's or Compose service's existing checkout, including checkouts on remote build/deployment servers and preview checkouts. It can follow errors into source files and reference file paths and line numbers in its diagnosis. Access is read-only: the agent cannot edit files, execute commands, or redeploy services.

Relevant code is sent to the selected AI provider. The available checkout may differ from the revision that produced the logs, particularly for older deployments. Dokploy does not fetch historical revisions for analysis.

Source access stays within the selected checkout. Credential files, .env files, Git internals, dependencies, generated output, binary files, and symbolic links are excluded. Secrets embedded in otherwise ordinary source or log text may still be sent; consider what your application records and stores before choosing a provider.

Investigation is bounded to eight tool rounds, twenty file reads, 64 KiB per file, and 256 KiB of source content. The result reports incomplete investigation when a limit is reached. If the checkout is unavailable, the target has no associated source (for example, a standalone Docker image), or the model does not support source tools, Dokploy explains the limitation and analyzes logs alone.

Older log dialogs without a deployment or service target analyze their currently loaded log text, subject to the provider's line limit, without source access.

Managing providers

You can manage your AI providers from Settings → AI:

  • Add multiple providers for different use cases
  • Edit existing provider configurations
  • Delete providers you no longer need
  • View available models for each provider
  • Enable/Disable providers without deleting them

Permissions

  • Owners and admins can manage providers and use every AI feature.
  • Members can't use AI. The AI Assistant in the create service menu and the AI button in log viewers are hidden for them.
  • With an Enterprise license, a custom role can grant the AI Settings permission granularly. Read is required to use AI features; Create, Update and Delete control who can manage provider configurations.

To limit which AI endpoints can be used at all, see Custom AI Providers.

On this page