Skip to content

feat: add automatic Rancher Desktop support for Docker socket detection#2681

Merged
Siumauricio merged 3 commits intoDokploy:canaryfrom
sueffuenfelf:feature/rancher-desktop-support
Mar 24, 2026
Merged

feat: add automatic Rancher Desktop support for Docker socket detection#2681
Siumauricio merged 3 commits intoDokploy:canaryfrom
sueffuenfelf:feature/rancher-desktop-support

Conversation

@sueffuenfelf
Copy link
Copy Markdown
Contributor

@sueffuenfelf sueffuenfelf commented Sep 24, 2025

What is this PR about?

This PR adds automatic Rancher Desktop support to Dokploy, allowing the pnpm run dokploy:setup command to work seamlessly with Rancher Desktop without requiring manual configuration. The enhancement automatically detects Rancher Desktop's Docker socket and uses it instead of the standard /var/run/docker.sock, while maintaining full backward compatibility with Docker Desktop and standard Docker installations.

Checklist

Before submitting this PR, please make sure that:

Issues related (if applicable)

Fixes issues where pnpm run dokploy:setup would fail with "connect ENOENT /var/run/docker.sock" error on Rancher Desktop installations.

Technical Details

  • Enhanced Docker Configuration: Modified packages/server/src/constants/index.ts to automatically detect Docker socket paths
  • Rancher Desktop Detection: Checks for ~/.rd/docker.sock and uses it when available
  • Fallback Support: Falls back to standard Docker socket (/var/run/docker.sock) if Rancher Desktop is not detected
  • Environment Variable Support: Respects DOCKER_HOST environment variable when set
  • Improved Logging: Shows which Docker socket is being used for better debugging

Benefits

  • Zero Configuration: Users with Rancher Desktop can now run setup without manual configuration
  • Backward Compatible: Existing Docker Desktop installations continue to work unchanged
  • Better Developer Experience: Clear logging shows which Docker environment is being used
  • Cross-Platform: Works with Rancher Desktop, Docker Desktop, and standard Docker installations

@sueffuenfelf sueffuenfelf force-pushed the feature/rancher-desktop-support branch from 49af46c to a32c778 Compare September 24, 2025 18:42
@sueffuenfelf sueffuenfelf force-pushed the feature/rancher-desktop-support branch from a32c778 to 71d3a43 Compare September 24, 2025 20:53
@sueffuenfelf
Copy link
Copy Markdown
Contributor Author

@Siumauricio i know you are busy, but this commit is a really small one and would allow more people to contribute

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 24, 2026
@Siumauricio Siumauricio changed the base branch from main to canary March 24, 2026 05:51
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 24, 2026
@Siumauricio Siumauricio merged commit fe8d273 into Dokploy:canary Mar 24, 2026
3 checks passed
@dosubot
Copy link
Copy Markdown

dosubot bot commented Mar 24, 2026

Documentation Updates

2 document(s) were updated by changes in this PR:

CONTRIBUTING
View Changes
@@ -64,13 +64,19 @@
 
 ### Optional Docker Configuration
 
-The following environment variables can be added to your `.env` file if you need custom Docker daemon configuration:
-
-- **DOCKER_API_VERSION**: Specify which Docker API version to use (optional)
-- **DOKPLOY_DOCKER_HOST**: Specify a custom Docker daemon host (optional)
-- **DOKPLOY_DOCKER_PORT**: Specify a custom Docker daemon port (optional)
-
-These variables are typically not needed for standard local development but can be useful if you need to connect to a remote Docker daemon or require a specific Docker API version.
+Docker socket detection is automatic for local development. The system automatically detects and uses Docker sockets in the following order:
+
+- DOCKER_HOST environment variable (if set)
+- Rancher Desktop socket (~/.rd/docker.sock)
+- Standard Docker socket (/var/run/docker.sock)
+
+Contributors using Docker Desktop, Rancher Desktop, Colima, or other Docker alternatives can run `pnpm run dokploy:setup` without any additional configuration.
+
+The following environment variables are only needed for remote Docker host configurations:
+
+- **DOKPLOY_DOCKER_HOST**: Specify a remote Docker daemon host
+- **DOKPLOY_DOCKER_PORT**: Specify a remote Docker daemon port
+- **DOKPLOY_DOCKER_API_VERSION**: Specify which Docker API version to use (optional)
 
 ## Requirements
 
README
View Changes
@@ -34,15 +34,29 @@
 
 ### Docker Configuration
 
-Optional configuration for customizing Docker daemon connections:
+Dokploy automatically detects Docker sockets in the following priority order:
+
+1. **DOCKER_HOST** environment variable (if set)
+2. Rancher Desktop socket (`~/.rd/docker.sock`)
+3. Standard Docker socket (`/var/run/docker.sock`)
+
+This automatic detection means that Docker Desktop, Rancher Desktop, Colima, and other Docker alternatives work out-of-the-box without manual configuration.
+
+**Optional Environment Variables:**
+
+- **DOCKER_HOST** (optional) - Specifies a custom Docker socket path (e.g., `unix:///path/to/docker.sock`). When set, this takes priority over automatic socket detection.
 
 - **DOCKER_API_VERSION** (optional) - Specifies which Docker API version to use when connecting to the Docker daemon. If not set, the Docker client uses the default API version.
 
-- **DOKPLOY_DOCKER_HOST** (optional) - Specifies the Docker daemon host to connect to. If not set, uses the default Docker socket connection.
-
-- **DOKPLOY_DOCKER_PORT** (optional) - Specifies the port for connecting to the Docker daemon. If not set, uses the default port.
-
-These variables allow advanced users to customize how the Dokploy API server connects to Docker, which can be useful for connecting to remote Docker daemons or using specific API versions.
+**Remote Docker Host Configuration:**
+
+For connecting to remote Docker daemons, use the following variables:
+
+- **DOKPLOY_DOCKER_HOST** (optional) - Specifies the remote Docker daemon host to connect to (e.g., `tcp://remote-host`).
+
+- **DOKPLOY_DOCKER_PORT** (optional) - Specifies the port for connecting to the remote Docker daemon.
+
+Note: `DOKPLOY_DOCKER_HOST` and `DOKPLOY_DOCKER_PORT` are intended for remote Docker host configurations. For local Docker installations, the automatic socket detection handles connection setup without requiring these variables.
 
 ## API Endpoints
 

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants