Dokploy / Dokploy/dokploy

feat: REST API endpoint for container runtime logs

Open
#3,719 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
37.4k
Forks
3k
Avg merge
1d 3h
Merged PRs (30d)
73

Description

Problem

Currently, container runtime logs are only accessible through the WebSocket-based tRPC subscription in the Dokploy UI. There is no REST API endpoint to fetch container logs programmatically.

The existing deployment.allByCompose returns build/deployment log paths, but there's no way to read runtime (stdout/stderr) logs from running containers via the REST API.

Use Case

  • CI/CD pipelines need to check service health after deployment
  • External monitoring/alerting tools need to pull logs
  • CLI tools and automation scripts (e.g., the Dokploy skill for AI assistants) need to fetch logs
  • Headless environments where the UI is not accessible

Proposed Solution

Add a REST API endpoint like:

GET /api/docker.getContainerLogs?containerId=<id>&tail=<lines>&since=<timestamp>

Or for compose services specifically:

GET /api/compose.getServiceLogs?composeId=<id>&serviceName=<name>&tail=<lines>
Parameters
  • containerId or composeId + serviceName — target container
  • tail (optional) — number of lines from the end (default: 100)
  • since (optional) — timestamp or duration (e.g., 10m, 1h)
  • timestamps (optional) — include timestamps in output
Response
{
  "logs": "[timestamp] log line 1\nlog line 2\n..."
}

Current Workaround

The only way to get runtime logs is through:

  1. The Dokploy UI (WebSocket subscription)
  2. SSH into the server and running docker logs <container> directly

Environment

  • Dokploy version: latest stable
  • Docker Compose applications with multiple services

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the existing WebSocket-based tRPC subscription used by the Dokploy UI and the deployment.allByCompose entry point that exposes build/deployment log paths. Decide whether the REST interface targets containers or Compose services, then define the requested parameters and JSON logs response; done means runtime stdout/stderr logs are fetchable through the REST API.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.