DEV Community

Warner Bell
Warner Bell

Posted on

Setting Up a Basic Dev Environment on a Windows/Linux Machine

๐Ÿš€ Set Up Your Dev Environment

Welcome to your step-by-step guide for setting up a powerful development environment using Windows Subsystem for Linux (WSL), Visual Studio Code (VSCode), and essential tools like Git and Node Version Manager (NVM).


๐Ÿ“‘ Table of Contents

  1. ๐Ÿ’ป IDE - Install Visual Studio Code (VSCode)
  2. ๐Ÿ”ง Configure VSCode for Development
  3. ๐Ÿง WSL - Setting Up Ubuntu and Updating Linux Kernel
  4. ๐Ÿ› ๏ธ Essential Dev Tools
  5. ๐Ÿ Python and pip
  6. โšก Git - Installation and Configuration
  7. ๐Ÿ”‘ Git Credential Manager (GCM)
  8. ๐Ÿ”’ Configure Security Settings
  9. ๐ŸŽ‰ Final Congratulations

๐Ÿ’ป IDE - Install Visual Studio Code (VSCode)

VSCode is a crucial tool for development. Let's get it installed and ready!

๐Ÿ”ฝ Steps to Install VSCode:

  1. Download VSCode: Visit Visual Studio Code and download the Windows installer.
  2. Run the Installer: Double-click the downloaded file and follow the instructions. Check the options to:
    • Add VSCode to the PATH.
    • Create a desktop icon for quick access.

๐Ÿš€ Install VSCode Using PowerShell CLI:

$InstallerUrl = "https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user"
$InstallerPath = "$env:TEMP\VSCodeInstaller.exe"
Invoke-WebRequest -Uri $InstallerUrl -OutFile $InstallerPath
Start-Process -FilePath $InstallerPath -ArgumentList "/verysilent" -NoNewWindow -Wait
Remove-Item $InstallerPath
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ Install VSCode Using Linux CLI:

sudo apt install curl gpg
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/ms.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/ms.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
sudo apt update
sudo apt install code
Enter fullscreen mode Exit fullscreen mode

After installing, launch VSCode by typing code in your terminal.


๐Ÿ”ง Configure VSCode for Development

๐Ÿ› ๏ธ Steps to Configure VSCode:

  1. Open VSCode: Launch VSCode from your Start Menu or Desktop Icon.
  2. Install Extensions: Go to the Extensions Marketplace by pressing Ctrl+Shift+X. Recommended extensions:
    • ๐Ÿ”— Remote Development โ€“ for remote development within WSL.
    • ๐Ÿ Python โ€“ for Python development.
    • ๐Ÿงฉ GitLens โ€“ enhances Git capabilities.
    • ๐Ÿณ Docker โ€“ for containerization.
    • โœจ ESLint โ€“ for JavaScript development.
    • ๐Ÿ“œ YAML โ€“ for YAML language support.
    • ๐Ÿ’ป Live Share โ€“ for collaborative coding.
    • ๐Ÿ” Remote - SSH โ€“ to connect via SSH to remote servers.

๐Ÿง WSL - Setting Up Ubuntu and Updating Linux Kernel

Build a robust foundation by setting up WSL and Ubuntu on your Windows machine.

๐Ÿ› ๏ธ Steps to Install WSL & Ubuntu:

  1. Install WSL Ubuntu:

    • In VSCode Open a PowerShell terminal and enter:
     wsl --install -d Ubuntu
    
  • Click Yes if prompted to allow program to make changes, view install progress in terminal.
  • Wait for the installation to complete,
  • Reboot your machine. (a terminal window will open upon reboot)
  • In the terminal window type a username when prompted (all lowercase), enter a password wait for the process to complete then close the window.
  1. Update Linux Packages:

    • Now that WSL is up and running, we need to ensure our Linux packages are up-to-date.
    • Open VSCode open your Ubuntu(WSL) terminal and run:
     sudo apt update && sudo apt upgrade -y
    

๐Ÿ› ๏ธ Essential Dev Tools

To build high-quality software, install these essential tools:

sudo apt-get install wget ca-certificates curl
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ Node Version Manager (NVM):

Manage your Node.js versions efficiently with NVM:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ AWS CLI v2:

The AWS Command Line Interface (CLI) v2 is essential for interacting with AWS services directly from the command line. Install it with the following steps:

Installation:

For Linux:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Enter fullscreen mode Exit fullscreen mode

For Windows (via PowerShell):

msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

aws --version
Enter fullscreen mode Exit fullscreen mode

This should return the installed version of AWS CLI v2.


๐Ÿ Python and pip

Python is an essential tool for cloud development. Install Python and pip with:

sudo apt install python3-pip -y
Enter fullscreen mode Exit fullscreen mode

โœ… CFN-Lint (CloudFormation Linter):

Ensure quality in your CloudFormation templates:

pip3 install cfn-lint
Enter fullscreen mode Exit fullscreen mode

Don't forget to install the CloudFormation Linter extension in VSCode!

๐Ÿ”ง jq (Command-line JSON processor):

jq is a lightweight command-line JSON processor, essential for parsing and manipulating JSON data:

sudo apt-get install jq
Enter fullscreen mode Exit fullscreen mode

๐Ÿ’ฝ Install Database Tools (if needed)

If your development requires a database, install the appropriate database. For example, for MySQL:

  1. Download MySQL: Go to the MySQL Downloads page and select the Windows version.
  2. Install MySQL: Follow the setup wizard, set up your root password, and configure the server.

โšก Git - Installation and Configuration

Git is essential for version control. Install and configure Git with the following:

๐Ÿ› ๏ธ Install Git:

sudo apt-get install git
Enter fullscreen mode Exit fullscreen mode

๐Ÿง‘โ€๐Ÿ’ป Configure Git Identity:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Enter fullscreen mode Exit fullscreen mode

๐Ÿ” View Git Configuration:

git config --list
Enter fullscreen mode Exit fullscreen mode

Install Git CLI:

sudo apt install gh
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”‘ Git Credential Manager (GCM)

Git Credential Manager (GCM) simplifies authentication for Git services like GitHub and Azure DevOps.

๐Ÿ’ก Setting Up GCM in WSL:

Set up GCM within WSL:

git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”’ Configure Security Settings

๐Ÿ”ง Steps to Secure Your System: ### (Optional)

  1. Windows Security: Ensure Windows Defender or your preferred antivirus is active and updated.
  2. Firewall Settings: Configure your Windows Firewall to allow development tools while blocking unauthorized access.
  3. Secure Browsers: Install security extensions like HTTPS Everywhere and ensure your browsers are up to date.
  4. Regular Updates: Keep Windows OS, VSCode, and all installed packages/extensions updated.

๐ŸŽ‰ Final Congratulations

You now have a fully configured, secure development environment on your Windows machine using WSL, VSCode, Git, and other standard development tools. You're ready for cloud development and ensuring your CloudFormation templates are linted before merging into the main branch.

Happy Coding! ๐Ÿ’ป๐ŸŒ

Top comments (0)