The following details how to install Windows Subsystem Linux, Docker, and Github from the ground up on Windows 10/11.
-
Download, run and install: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
-
Next, run Powershell as Administrator
wsl --set-default-version 2 wsl --install -d Ubuntu-20.04
-
Next, run Ubuntu. Complete prompt to set user name and password.
-
Afterwards, install Git for version control.
sudo apt update && sudo apt install git git config --global user.name {USERNAME} git config --global user.email {EMAIL} # add ssh config mkdir ~/.ssh vim ~/.ssh/config Host github.com User {USERNAME} HostName github.com IdentityFile ~/.ssh/github.com # create ssh key ssh-keygen -o -f ~/.ssh/github.com # print key, use to add SSH key cat ~/.ssh/github.com.pub
Add SSH key to https://github.com/settings/keys.
-
Install Docker
sudo apt install docker.io -y sudo visudo ubuntu ALL=(ALL) NOPASSWD: /usr/bin/dockerd
Configure Docker Daemon to come up automatically. This occasionally fails and
sudo dockerd
is required instead.echo '# Start Docker daemon automatically when logging in if not running.' >> ~/.bashrc echo 'RUNNING=`ps aux | grep dockerd | grep -v grep`' >> ~/.bashrc echo 'if [ -z "$RUNNING" ]; then' >> ~/.bashrc echo ' sudo dockerd > /dev/null 2>&1 &' >> ~/.bashrc echo ' disown' >> ~/.bashrc echo 'fi' >> ~/.bashrc
-
Install Docker compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version # add user to docker group sudo usermod -aG docker ubuntu
Notes:
- wsl files are avaliable from root pc:
\\wsl$\Ubuntu-20.04\home\ubuntu
- root pc files are avaliable from wsl
/mnt/c/Users/