Web Dev Suite Setup on Debian VM for Windows
Tags: docker, vscode, debian, vmware
Published: 2023-01-28 06:07:07

MacOS, Windows and Linux are the 3 players which come across in a developer's daily life. Virtual machine is always the solution. In this article I will go through the steps on how to quickly setup an Debian Linux VM with all required gears (VSCode, Chrome, Docker) for front-end devs, on a Windows laptop.

1. Download and install **VMWare Workstation Player**. 

2. Download the **ISO image of Debian installation** (even you are on intel CPU)
https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ 

3. In VMWare, create a new machine from ISO installer. This will take about 20 min.

4. Once Debian is installed, log in and use terminal to install **gdebi**

```
sudo apt install gdebi
```
5. Now download **Chrome installer** on Linux (.deb) and use **gdebi** to load the package

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97becabvwok4kq2hdrde.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xv1ao4vdyjrcn10oklvg.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1sp58b2vmy8n9lgn5l4.png)

Alternatively, you can install using wget via terminal:

```
wget --no-check-certificate https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb
```

6. Download **VS Code** (https://code.visualstudio.com/) and install from deb installer.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4mm3i89njj86hjrbdi3r.png)

7. Install Node

```
sudo apt update
sudo apt upgrade
sudo apt install nodejs npm -y
```
8. If you switch node versions often, install NVM as well

```
sudo apt install curl 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 
source ~/.profile   
nvm install 12.18.3  
```

9. Install **docker desktop** on Debian

```
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Then run sudo apt-get install ./docker-desktop-<version>-<arch>.deb
```


Ref:
https://docs.docker.com/engine/install/debian/
https://docs.docker.com/compose/install/linux/

Note:
Update: snyk that comes with Docker Engine is not for arm64: you will get this error:
exec /user/local/bin/snyk exec format error
You will have to install the binary manually:

```
curl https://static.snyk.io/cli/latest/snyk-linux-arm64 -o snyk
chmod +x ./snyk
mv ./snyk /usr/local/bin/
```

~~If you are on arm64 Linux, your default installation will not contain Docker Scan plugin, and apt-get install docker-scan-plugin will not work. You will have to install manually:~~
(https://github.com/docker/scan-cli-plugin#on-linux)

```
mkdir -p ~/.docker/cli-plugins && \
curl https://github.com/docker/scan-cli-plugin/releases/latest/download/docker-scan_linux_arm64 -L -s -S -o ~/.docker/cli-plugins/docker-scan &&\
chmod +x ~/.docker/cli-plugins/docker-scan
```