Docker Installation on WSL

User
wsl installed on window 11
Now install docker
Assistant
To install Docker on Windows 11 with WSL (Windows Subsystem for Linux), follow these steps:

### Step 1: Install WSL (if not already installed)
1. **Open PowerShell as Administrator** and run the following command:

wsl --install

2. **Restart your computer** if prompted.

### Step 2: Install Docker Desktop
1. **Download Docker Desktop** from the [official Docker website](https://www.docker.com/products/docker-desktop).
2. **Run the installer** and follow the installation instructions. Ensure that the "Use WSL 2 instead of Hyper-V" option is checked during installation.

### Step 3: Configure Docker to use WSL
1. Once Docker Desktop is installed, **launch Docker Desktop**.
2. Go to **Settings** (the gear icon).
3. Under the **General** tab, make sure "Use the WSL 2 based engine" is checked.
4. Under the **Resources** tab, you can configure CPU, memory, and disk size according to your needs.
5. Under the **WSL Integration** tab, enable Docker integration with your WSL distributions (e.g., Ubuntu).

### Step 4: Verify Docker Installation
1. Open your **WSL terminal** (like Ubuntu).
2. Run the following command to verify that Docker is installed and working:

docker --version

3. You can also run a test container:

docker run hello-world

### Step 5: (Optional) Set up Docker Compose
Docker Desktop includes Docker Compose by default. You can check if it’s installed by running:

docker-compose --version

### Notes
– If you encounter any issues, ensure that your Windows is updated to the latest version and that virtualization is enabled in your BIOS.
– You may need to restart your WSL terminal or your computer after installation for all changes to take effect.

That's it! You should now have Docker installed and running in your WSL environment on Windows 11. Let me know if you need help with anything else!

Leave a Comment

Your email address will not be published. Required fields are marked *