Procedure creation machines virtual (Ubuntu) and docker
compose installation on WSL2 for Windows 11
Removing WSL2 distribution
Stop WSL: Open PowerShell or Command Prompt as administrator and type:
bash
Copy code
wsl – shutdown
Check installed distributions: Enter the command:
bash
Copy code
wsl -l -v
This will show you a list of installed WSL distributions.
Remove Distribution: To remove a specific distribution, type:
bash
Copy code
wsl -- unregister <distribution_name>
Replace <distribution_name> with the name of the distribution you want to remove .
Verify deletion: Re-enter:
bash
Copy code
wsl -l -v
do : apt update and upgrade
To install Docker on WSL2 (Windows Subsystem for Linux), follow these steps:
To install Docker on WSL2 without using Docker Desktop, follow these steps:
1. Install WSL2
If you haven't already, make sure you have WSL2 installed. Open PowerShell as administrator
and run:
wsl - install
IPv4 address for eth0: 172.26.206.121
Log and pass: kor321
Make sure your WSL settings are configured to version 2:
wsl --set- default -version 2
2. Install Linux distribution
If you don't already have a Linux distribution installed, you can do so through the Microsoft
Store (e.g. Ubuntu ).
3. Install Docker in WSL2
1. Open a WSL terminal (e.g. Ubuntu ) and update packages:
sudo apt update
sudo apt Upgrading
2. Install required packages:
sudo apt install apt -transport- https ca- certificates curl software-
properties – common
3. Add Docker GPG key :
curl - fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt
key add –
4. Add Docker repository :
sudo add-apt-repository " deb [ arch =amd64]
https://download.docker.com/linux/ubuntu $( lsb_release - cs ) stable
"
5. Install Docker :
sudo apt update
sudo apt install docker -ce
Docker Setup and Launch
1. Start the Docker service : Docker in WSL2 does not have a systemd service , so start it
manually:
sudo service docker start
2. Add the user to the docker group so you don't have to use sudo for every command:
sudo usermod - aG docker $USER
After executing this command, close the terminal and reopen it for the changes to take
effect.
5. Checking the installation
To check if Docker is installed correctly, type:
docker –version
You can also run a test container:
docker run hello world
6. Install Docker Compose (optional)
If you want to use Docker Compose , install it by executing the following commands in the
WSL terminal:
1. Download Docker Compose :
sudo curl -L
"https://github.com/docker/compose/releases/latest/download/docker-
compose-$(uname -s)-$( uname -m)" -o / usr / local /bin/ docker-
compose
2. Granting executable permissions :
sudo chmod +x / usr / local /bin/ docker-compose
3. Check installation :
docker-compose –version
Installing npm the appropriate version
npm install -g npm@5
and node,js
nano docker-compose.yml
To open this tab: open browser -> type localhost:1880
To open this tab: open browser -> type localhost:8080
To login:
email: cinekadrych@gmail.com
password: 1234
To open this tab: open browser -> type: http://localhost:8087/#/
To login:
admin: guest
password: guest