# Install Docker on Windows without Docker Desktop
### System requirements
* Windows 10 version 2004 and higher (Build 19041 and higher)
* Windows11
* [WSL2](https://docs.microsoft.com/zh-tw/windows/wsl/install)
### Install Linux OS
go to Windows store choose you prefeare linux os , this tutorial use Ubuntu18.04

### Install Docker on WSl Linux
*(this guide use Ubuntu 18.04)*
The installation guide like to any linux docker installation guide.
**Installation guide **:
```shell=
sudo apt-get update -y
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
```
**If you docker not start**
```shell=
sudo /etc/init.d/docker start
```
**Create and Write daemon.json**
```shell=
sudo vim /etc/docker/daemon.json
```
**Wirite this**
```json=
{
"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"],
"iptables": false
}
```
**Restart docker **
```shell=
sudo /etc/init.d/docker restart
```
### Configure VSCode to access to WSL2 docker
**Install docker extension**

**Click on the icon (?),select "Edit settings"**

**Search for "Docker:Host" and overwrite to tcp://${WSL_IP}:2375 and Refresh docker extension**
NOTE [WSL2 Docker Auto start at boot](http://viml.nchc.org.tw/blog/paper_info.php?CLASS_ID=1&SUB_ID=1&PAPER_ID=771)
### Installing Docker.exe on Windows (Not so recommended)
#### Downald [docker.exe](https://github.com/StefanScherer/docker-cli-builder/releases) save to C:\bin
Add this directory in the path for executables : System Properties\Environement Variables\System Variables\Path

**Check docker is working **
```shell=
docker version
```
#### Set docker context
Get wsl ip (at wsl console)
```shell=
ifconfig eth0
```
create context
```shell=
docker context create remote --docker "host=tcp://${WSL_ip}:2375"
```
user context
```shell=
docker context use remote
```
try the dokcer command you can see wsl docker information
```shell=
docker images
```
#### Daily exec cmd
at cmd
```shell=
docker context update remote --docker "host=tcp://${WSL_ip}:2375"
```
###### tags: `Docker`