Skip to content

Instantly share code, notes, and snippets.

@MrCordeiro
Last active September 3, 2025 15:17
Show Gist options
  • Select an option

  • Save MrCordeiro/658d5226f297bcad66d32f3c6ddf48c6 to your computer and use it in GitHub Desktop.

Select an option

Save MrCordeiro/658d5226f297bcad66d32f3c6ddf48c6 to your computer and use it in GitHub Desktop.
Windows 11 Setup Guide

New Computer Setup

Configuring a new PC takes time. These are the steps I took to piece together my dev environment.

Windows 11

Local Account

To setup a new Windows PC without using a Microsoft account:

  1. Start the Setup Process.
  2. When prompted to connect to the internet, disconnect your PC from Wi-Fi or Ethernet.
  3. Open cmd by pressing Shift + F10.
  4. Type OOBE\BYPASSNRO. The PC will restart and now the option "I don't have internet" should appear.
  5. Click on the "I don't have internet" option. Microsoft will try to convince you to connect to the internet. Click on "Continue with limited setup".
  6. You are now able to create a local account.

Software

File Explorer

If you don't see file name extensions when you view files in File Explorer:, go to View, in the Show/hide group, select the File name extensions and Hidden items check box.

Chocolatey

Chocolatey is a package manager for Windows. It's similar to Homebrew on macOS, or apt on Linux. These are the packages we install with it:

# Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

# Node, Java, Minikube, Terraform...
choco install nvm kubernetes-cli minikube k9s jre8 terraform devtoys

# NVM Setup
nvm install --lts

# kubectl Setup
kubectl version --client
mkdir .kube
cd .kube
New-Item config -type file
kubectl completion powershell >> $PROFILE

WSL

wsl --install
wsl.exe --update

PowerShell

Windows come with PowerShell 5, but we want the latest version:

winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell --source winget

Git

Set global config, which includes:

  1. Commit aliases
  2. Autocorrect
  3. Credentials helper
git config --global core.autocrlf input
git config --color.ui true
git config --global help.autocorrect 1

# Commit aliases

git config --global alias.st status
git config --global alias.new "!f() { git commit -m \"πŸ“¦ NEW: $@\"; }; f"
git config --global alias.imp "!f() { git commit -m \"πŸ‘Œ IMPROVE: $@\"; }; f"
git config --global alias.fix "!f() { git commit -m \"πŸ› FIX: $@\"; }; f"
git config --global alias.rls "!f() { git commit -m \"πŸš€ RELEASE: $@\"; }; f"
git config --global alias.doc "!f() { git commit -m \"πŸ“– DOC: $@\"; }; f"
git config --global alias.tst "!f() { git commit -m \"βœ… TEST: $@\"; }; f"
git config --global alias.lint "!f() { git commit -m \"πŸ‘• LINT: $@\"; }; f"decorate --date=relative --format='%C(red)%h%C(red) β€”β€” %C(bold blue)%an%C(red): %C(white)%s%C(red) %C(dim white) %C(bold green)(%ar)%C(red) %C(bold yellow)%d%C(red)' --all"
git config --global alias.lg "!f() { git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(red)%h%C(red) β€”β€” %C(bold blue)%an%C(red): %C(white)%s%C(red) %C(dim white) %C(bold green)(%ar)%C(red) %C(bold yellow)%d%C(red)' --all; }; f"

# Credentials helper (replace <YOUR-EMAIL> with your actual email address)

git config --global alias.set-ssh "!git config gpg.format ssh && git config user.signingkey '~/.ssh/id_ed25519' && git config commit.gpgsign true && git config --global tag.gpgsign true"
git config --global alias.set-email-<ORG|personal> "!git config user.email '<YOUR-EMAIL>' && git config user.name '<YOUR-NAME>' && git set-ssh"

SSH

ssh-keygen -t ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub >> ~/.ssh/allowed_signers
git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers"
git config --global -e

Python

python -m pip install pip
pip install pylint bandit isort
poetry config virtualenvs.in-project true

WSL (Ubuntu)

First things first:

sudo apt update && sudo apt upgrade
sudo apt-get install apt-transport-https ca-certificates gnupg silversearcher-ag
sudo sysctl -w net.ipv6.conf.all.autoconf=0

ZSH

Z shell works almost identically to the standard BASH shell found on default Linux installs. What makes it different is its support for plugins and themes, along with some extra features like spelling correction and recursive path expansion.

sudo apt install zsh
sudo apt install curl
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

At this point forward, we'll be using the Zsh:

# Oh My Zsh plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# Terraform
sudo apt install gpg
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform

# NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install --lts

# Python
sudo apt upgrade python3
sudo apt install python3-pip
sudo apt install python3-venv
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
echo "alias python=/usr/bin/python3" >> ~/.zshrc

# Poetry
curl -sSL https://install.python-poetry.org | python3 -
mkdir $ZSH_CUSTOM/plugins/poetry
poetry completions zsh > $ZSH_CUSTOM/plugins/poetry/_poetry
poetry config virtualenvs.in-project true

# Pyenv
curl https://pyenv.run | bash
export PYENV_ROOT="$HOME/.pyenv" \
    command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" \
    eval "$(pyenv init -)" \
    exec $SHELL
pyenv install 3.13
pyenv install 3.12

# Java
sudo apt-get install -y default-jdk
JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
echo -e "\n# Java" >> ~/.bashrc
echo "export JAVA_HOME=$JAVA_HOME" | sed 's/\(JAVA_HOME=\).*/\1<'"$(echo $JAVA_HOME | sed 's/\//\\\//g')"'/' >> ~/.bashrc
echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> ~/.bashrc
echo $JAVA_HOME

setup_git_credential_manager() {
    git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager.exe"
    git config --global credential.https://dev.azure.com.useHttpPath true
}

# Clojure
install_clojure() {
    sudo apt-get install rlwrap
    curl -O https://download.clojure.org/install/linux-install-1.11.1.1347.sh
	chmod +x linux-install-1.11.1.1347.sh
	sudo ./linux-install-1.11.1.1347.sh
    rm linux-install-1.11.1.1347.sh
    echo "Clojure installation completed!"
}


# Golang
install_golang() {
    local GO_URL="https://go.dev/"
    local GO_TAR_FILE="go.tar.gz"
    local GO_INSTALL_DIR="/usr/local"

    echo "Fetching the latest version of Go..."
    local download_url=$(wget -qO- "$GO_URL/dl" | grep -oP 'href="\K(.*?linux-amd64.tar.gz)' | head -1)
    if [ -z "$download_url" ]; then
        echo "Failed to fetch the download URL: $download_url. Exiting."
        return 1
    fi

    echo "Downloading Go from $download_url"
    wget -q --show-progress "${GO_URL}${download_url}" -O $GO_TAR_FILE
	echo "${GO_URL}${download_url}"
    if [ $? -ne 0 ]; then
        echo "Download failed. Exiting."
        return 1
    fi

    echo "Extracting Go tarball..."
    sudo tar -C $GO_INSTALL_DIR -xzf $GO_TAR_FILE
    if [ $? -ne 0 ]; then
        echo "Extraction failed. Exiting."
        return 1
    fi

    local go_bin_path="${GO_INSTALL_DIR}/go/bin"
    if ! grep -q "$go_bin_path" <<< $PATH; then
        echo "Adding Go to the PATH..."
        echo "export PATH=$PATH:$go_bin_path" >> $HOME/.profile
        source $HOME/.profile
    else
        echo "Go is already in the PATH."
    fi

    echo "Go installation completed."
    go version
}

setup_git_credential_manager
install_clojure
install_golang


source ~/.bashrc

After that, edit your ~/.zshrc file to include the following plugins:

plugins=(
    git
    poetry
    zsh-autosuggestions
    zsh-syntax-highlighting
)

Git (WSL)

Ubuntu's default package repository often doesn't package a new version of Git for users. At time of writing, the newest version that needs to be installed is 2.30+, but the most up-to-date version in Ubuntu's repository may be an older version.

To fix this, you'll need to add a PPA (Personal Package Archive), maintained by the Git team for Ubuntu users. Begin by adding the PPA:

sudo add-apt-repository ppa:git-core/ppa

Once you've added the git-core PPA, you can update your repository cache, and install Git from the new source:

sudo apt update 
sudo apt install git git-flow git-lfs

Once you've installed your new version, confirm that git --version returns a newer version of Git.

After that, you can set your global config, which includes:

  1. The same config as the Windows config

  2. git config --global core.editor "code --wait"

  3. Create a SSH key and add it to GitHub

    ssh-keygen -t ed25519
    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_ed25519
    touch ~/.ssh/allowed_signers
    cat ~/.ssh/id_ed25519.pub >> ~/.ssh/allowed_signers
    git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers"
    git config --global -e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment