Software⏱️ 3 min read📅 2026-06-11

How to Fix: How to run docker hello world? An error occurred trying to connect

Docker connection error on Windows 10

Quick Answer: Check Docker Toolbox settings and ensure the service is running.

The 'An error occurred trying to connect' issue when running Docker's 'hello-world' image on Windows 10 is typically caused by a misconfigured Docker daemon. This prevents Docker from establishing a connection with the Docker engine, which is necessary for container creation and management.

This error can be frustrating because it prevents users from using Docker's full capabilities to run containers and manage their applications. However, troubleshooting this issue involves checking the Docker configuration files, ensuring that the Docker service is running, and verifying network connectivity.

💡 Why You Are Getting This Error

  • The primary reason for this error is a misconfigured Docker daemon. This can occur due to incorrect settings in the Docker configuration file (usually located at C:\ProgramData\Docker\config\docker.json). The 'exec-opts' setting, in particular, might be causing issues if it's set to 'native-cgroupdriver'. To resolve this, you'll need to update the 'exec-opts' setting to a compatible value.
  • Another alternative reason for this error is that the Docker service is not running or is not configured correctly. This can happen if the Docker installation process was interrupted or if there are conflicts with other services or applications running on the system.

🛠️ Step-by-Step Verified Fixes

Update Docker Configuration File

  1. Step 1: Open the Docker configuration file (usually located at C:\ProgramData\Docker\config\docker.json) in a text editor. Navigate to the 'exec-opts' section and update its value to a compatible setting, such as 'native-cgroupdriver=container:io.docker.container.v1.4'.
  2. Step 2: Save the changes to the configuration file and restart the Docker service. This will ensure that the updated settings are applied.
  3. Step 3: Verify that the Docker daemon is running by checking the system event log or using the `docker ps` command.

Start Docker Service Manually

  1. Step 1: Open the Command Prompt or PowerShell and navigate to the Docker installation directory (usually C:\Program Files\Docker Toolbox).
  2. Step 2: Type the following command to start the Docker service: `docker service start`. This will ensure that the Docker daemon is running and configured correctly.
  3. Step 3: Verify that the Docker service is running by checking the system event log or using the `docker ps` command.

🎯 Final Words

To resolve the 'An error occurred trying to connect' issue when running Docker's 'hello-world' image, update the Docker configuration file to ensure compatibility with your system. Alternatively, start the Docker service manually if it's not running correctly. By following these steps, you should be able to establish a connection with the Docker engine and run containers successfully.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions