Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zacharyseo/ba7626ad30f139bfea8e32254186acbd to your computer and use it in GitHub Desktop.
Save zacharyseo/ba7626ad30f139bfea8e32254186acbd to your computer and use it in GitHub Desktop.
Install Devin in Windows 11 (WSL2)

Installing OpenDevin in Windows 10 / 11 using WSL 2

Setup WSL2 Ubuntu for Running Devin

Install WSL2 Ubuntu

wsl --install -d Ubuntu

# (manually) launch a terminal
# wsl ~ -d Ubuntu

You will need to setup your username and password

Update packages

sudo apt update -y && sudo apt upgrade -y

Install SQLite3 Make, and Pipx

# Note: We also update SQLite3 to latest available for future
# ISSUE: https://github.com/OpenDevin/OpenDevin/issues/571
sudo apt install -y sqlite3 make pipx

Install NVM and NodeJS Latest

# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
# resouce
source ~/.bashrc
# Install Current LTS version of NodeJS
nvm install --lts
# Use Latest Node Version
nvm use default
# Update npm
# npm update -g
npm install npm@latest -g

Install MiniConda

# https://docs.anaconda.com/free/miniconda/index.html#quick-command-line-install
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh

# Init Miniconda
~/miniconda3/bin/conda init bash

# Resource Bash
source ~/.bashrc

Create a conda environment for OpenDevin with poetry and python 3.11

# python requirement is taken from README (check readme for update)
# requests and urllib3 are for fixing poetry 'HTTPResponse' object has no attribute 'strict' error
# ISSUE: python-poetry/poetry/issues/7936
conda create -y --quiet -n od python=3.11 poetry requests==2.28.2 urllib3==1.26.15

Install Docker

# Read Release
. /etc/os-release
# Get PGP Keys
curl -fsSL https://download.docker.com/linux/${ID}/gpg | sudo tee /etc/apt/trusted.gpg.d/docker.asc
# Add Repository
echo "deb [arch=amd64] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/docker.list
# Update Package Cache
sudo apt update
# Install Docker
sudo apt install docker-ce docker-ce-cli containerd.io

Adding a Docker user for safety

# Create a Docker group
sudo groupadd docker
# Add a Docker User
sudo usermod -aG docker $USER
# Logout and Login again so your permissions are evaluated again (or type)
newgrp docker

Docker Config (optional)

# Find a unused group id (keep repeating until you find one)
getent group | grep 36257 || echo "This ID is not in use."
# Use that group id
sudo sed -i -e 's/^\(docker:x\):[^:]\+/\1:36257/' /etc/group
# Exit WSL and shutdown
exit
wsl --shutdown
# Follow the rest of the steps if you want docker to auto start with your WSL2 Distro
# https://dataedo.com/docs/installing-docker-on-windows-via-wsl

Pull ghcr.io/opendevin/sandbox image for cache

docker pull ghcr.io/opendevin/sandbox

Installing Devin

Clone OpenDevin

git clone https://github.com/OpenDevin/OpenDevin.git ~/OpenDevin
cd ~/OpenDevin

Make

cd ~/OpenDevin
make

To configure your API run this

make setup-config

# this makes a config.toml file that looks like this
LLM_MODEL="gpt-3.5-turbo-1106"
LLM_API_KEY="sk-..."
LLM_EMBEDDING_MODEL="openai"
WORKSPACE_DIR="./workspace"

Run Devin API

# make start-backend
# make start-frontend
uvicorn opendevin.server.listen:app --port 3000

Notes

If you ever get stuck and get errors. clean your git clone by running this and follow the steps again

Clean the Git Clone

cd ~/OpenDevin
git fetch origin master
git checkout --force -B master origin/master
git reset --hard
git clean -fdx

Remove the WSL Ubuntu installation (rinse everything)

wsl --shutdown
wsl --unregister Ubuntu
# Then install Ubuntu again and follow the steps from beginning
wsl --install -d Ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment