# Install and Setup Docker Desktop

If Docker Desktop is not installed, refer to [Docker Installation and Setup Tutorial (Windows version)](/emc-testnet/emc-airdrop-guidelines/testnet-tutorial-guide/windows-tutorial/docker-installation-and-setup-tutorial-window-version.md) for setup instructions.

## 1. Docker Desktop Settings

**1.1 Start Docker Desktop Service**

In Windows Powershell (run as Administrator), enter <mark style="color:red;">`net start com.docker.service`</mark> to start the Docker Desktop Service.

<figure><img src="/files/FmeDCFSBZY1WHDxiXEaH" alt=""><figcaption></figcaption></figure>

**2.2 Start docker daemon**

In Windows Powershell (run as Administrator), enter <mark style="color:red;">`cd "C:\Program Files\Docker\Docker"`</mark> to navigate to the Docker Desktop installation path. Run the command <mark style="color:red;">`.\DockerCli.exe -SwitchDaemon`</mark> to start the Docker daemon.

**2.3 Launch Docker Desktop**

Right-click on Dockers Desktop to run as administrator.If an error occurs, follow the prompts. In Windows Powershell (run as Administrator), enter <mark style="color:red;">`Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All`</mark>.Enter <mark style="color:red;">`Y`</mark> to confirm and restart the computer to apply the changes. After the restart, run Docker Desktop again as Administrator.

<figure><img src="/files/vQmRd8eiEi10c22sSDsQ" alt=""><figcaption></figcaption></figure>

As shown in the image, the "Engine running" status indicates that Docker starts normally.

**2.4 Launch Docker Desktop**

<figure><img src="/files/pyuIrObzxpSHzFHVFwUU" alt=""><figcaption></figcaption></figure>

As shown in the image, set up WSL integration with the installed Ubuntu subsystem. Click **"Apply & Restart"** to implement the changes.

**2.5 Edit daemon.json to change the image source**

To avoid the "Failed to pull image" error, modify the Docker images in <mark style="color:red;">`daemon.json`</mark>.Please add the image repository source available for Docker that you are familiar with.

<figure><img src="/files/OJfchaLruFvY7QCAbxug" alt=""><figcaption></figcaption></figure>

As shown in the image, add the ACR image acceleration address to the `daemon.json` file. Apply the changes and restart to enable them.

## 2. Docker Desktop Settings

In some cases, Docker may not access the image links replaced in `daemon.json` when pulling images. You can resolve issues with pulling images by setting up a Docker proxy.

### 2.1 Precondition

You need a static IP address or server address that can access the extranet.<br>

### 2.2 Update systemd environment configuration

The pulling and management of images are handled by the Docker daemon, so it needs to be aware of the proxy server's existence. Since the Docker daemon is managed by systemd, we need to configure systemd.<br>

#### **1st Method: Update the http-proxy.conf of systemd**

Create the directory using the following command; the configurations in this directory override the default settings of <mark style="color:red;">`dockerd`</mark>.

```powershell
sudo mkdir -p /etc/systemd/system/docker.service.d
```

Create a new configuration file http-proxy.conf

```powershell
sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
```

<figure><img src="/files/xkK00GhMOwZQlfNgQMUk" alt=""><figcaption></figcaption></figure>

Configure environment variables in the file. If you have created a private image repository and need <mark style="color:red;">`dockerd`</mark> to bypass the proxy server for direct connections, set the <mark style="color:red;">`NO_PROXY`</mark> variable:

```powershell
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80" # your IP (external or server): Port
Environment="HTTPS_PROXY=https://proxy.example.com:443"  # your IP (external or server): Port
Environment="NO_PROXY=your-registry.com,127.0.0.1,*.example.com"
```

Multiple <mark style="color:red;">`NO_PROXY`</mark> variable values are separated by commas and can include wildcards (\*).

<figure><img src="/files/FRg6LU6dVsqoY1vngi0x" alt=""><figcaption></figcaption></figure>

Reload the configuration file and restart dockerd.

```powershell
sudo systemctl daemon-reload
sudo systemctl restart docker
```

**Note:** If you encounter the error <mark style="color:red;">"Failed to restart docker.service: Unit docker.service not found"</mark> when restarting Docker, you can use the <mark style="color:red;">`apt`</mark> command to install Docker for repair.\
Check to confirm that the environment variables are correctly configured:

```powershell
sudo systemctl show --property=Environment docker
```

<figure><img src="/files/8dAqXBS0GM5vrl4BA2Wn" alt=""><figcaption></figcaption></figure>

**2nd Method: Update the&#x20;**<mark style="color:red;">**`docker.service`**</mark>**&#x20;in systemd.**&#x20;

The location of the <mark style="color:red;">`docker.service`</mark> configuration file may vary depending on the operating system. Use the following command to find the file directory:

```powershell
sudo find / -name docker.service
```

<figure><img src="/files/ruF85OTk9tdgw2tPAOd3" alt=""><figcaption></figcaption></figure>

Next, use the command to modify the <mark style="color:red;">`docker.service`</mark> file:

```powershell
sudo vi /usr/lib/systemd/system/docker.service
```

Add the following environment variables to the opened file:

```powershell
Environment="HTTP_PROXY=http://proxy.example.com:80" #Your IP (external or server): Port
Environment="HTTPS_PROXY=https://proxy.example.com:443" #Your IP (external or server): Port
Environment="NO_PROXY=your-registry.com,127.0.0.1,*.example.com"
```

<figure><img src="/files/CTyqw5lNJIQqfoUItb8t" alt=""><figcaption></figcaption></figure>

Press <mark style="color:red;">`ESC`</mark> and enter <mark style="color:red;">`:wq`</mark> to save the file content. Use the following command to load and restart:

```powershell
sudo systemctl daemon-reload
sudo systemctl restart docker
```

### 2.3 Verify if the proxy is successfully set up

<figure><img src="/files/U2cSAyYKIjOnASjuUVfq" alt=""><figcaption></figcaption></figure>

As shown in the image, this indicates that you can pull external images through the proxy


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emc.network/emc-testnet/emc-airdrop-guidelines/testnet-tutorial-guide/windows-cli-tutorial/install-and-setup-docker-desktop.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
