Install FrappeFramework in WSL Windows

Muhammad Tri Wibowo
2 min readFeb 17, 2023

--

if you got

Wsl/Service/CreateInstance/ERROR_FILE_NOT_FOUND

you can unregister

wsl --unregister Ubuntu-22.04

Install ubuntu-22.04 through store on win10/11

# Set wsl1 in powershell, be careful not to be wsl2

# check wsl distro versions
wsl -l -v
# change wsl distro using name above to desired version
wsl --set-version Ubuntu 1
sudo apt update

sudo apt upgrade

sudo apt install -y curl git-core gcc make zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libssl-dev

sudo apt install -y git python3-dev python3-setuptools python3-pip virtualenv software-properties-common

sudo apt install -y xvfb libfontconfig wkhtmltopdf

Install mariadb + redis

— --if ubuntu < 20.04

sudo apt-key adv — recv-keys — keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository ‘deb [arch=amd64,i386,ppc64el] http://ftp.ubuntu-tw.org/mirror/mariadb/repo/10.3/ubuntu bionic main’

endif — —

sudo apt update

sudo apt upgrade

sudo apt install -y mariadb-server-10.6

sudo apt install -y libmysqlclient-dev

sudo apt install -y redis-server

install pyenv

sudo apt install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libedit-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git

git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv

git clone https://github.com/yyuu/pyenv-virtualenv.git $HOME/.pyenv/plugins/pyenv-virtualenv

Modify .bashrc

nano $HOME/.bashrc
## pyenv configs

export PYENV_ROOT="$HOME/.pyenv"

export PATH="$PYENV_ROOT/bin:$PATH"

export PATH="$PYENV_ROOT/shims:$PATH"

if command -v pyenv 1>/dev/null 2>&1; then

eval "$(pyenv init -)"

fi
source $HOME/.bashrc

# Modify mariadb related configuration files

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
character-set-client-handshake = FALSE
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
sudo nano /etc/mysql/mariadb.conf.d/50-mysql-clients.cnf
default-character-set = utf8mb4

# Configure mariadb, set root password

sudo /etc/init.d/mariadb start

sudo mysql_secure_installation

sudo /etc/init.d/mariadb restart

sudo /etc/init.d/mariadb status

sudo service mariadb start --skip-grant-tables --skip-networking
sudo mysql -u root
FLUSH PRIVILEGES;

ALTER USER 'root'@'localhost' IDENTIFIED BY 'mysql';

Install Node

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

export NVM_DIR="$HOME/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

nvm install 14

npm install -g yarn

Install Bench CLI

pip3 install frappe-bench
pyenv install 3.10.10

pyenv virtualenv 3.10.10 frappe

pyenv activate frappe

pip install -U pip setuptools

pip install frappe-bench

bench init --frappe-branch version-14 frappe-bench --frappe-path=https://gitee.com/qinyanwan/frappe

if you want delete virtualenv

pyenv virtualenv-delete frappe

# Prepare before starting (open redis, mariadb)

sudo service redis-server start

sudo service mysql start
bench start

--

--

No responses yet