Installing ERPNext on WSL Windows

Alaa Alsalehi
3 min readMar 22, 2024

--

Living in Gaza for the last few months means all our lives have been rocked with rockets and lacking raw materials. This type of instability creates new situations you would not have imagined you facing before. If you follow my article, you know that I am managing a software company helping companies to adopt ERP in their operation So we mainly use ERPNext for this purpose. I was using Windows operation system with the official release of Erpnext on docker to follow up with our team.

Unfortunately, we evacuated our home in a hurry-up mode, and based on that I was not able to bring up my workstation laptop -it cost me near 2000$-. So, to keep working I buy a new one in Rafah city with hamble specifications. So, I think why not trying run Erpmext on WSL directly?

This was my experience in this area.

First Step: install WSL

I will not talk a lot about this step I suggest checking this link from Microsoft site to install wsl.

Do not forget that we need Ubuntu 22.04.x for ERPNext 14.0 version and Ubuntu 20.04 for ERPNext 13.0 version.

Second Step: Allow network access for WSL

To make your WSL Linux able to reach the internet put a file with the name .wslconfig in your home folder -in this path, c:\Users\{your username} — and put this content in it.

[wsl2]

dnsTunneling=true

networkingMode=mirrored

important point if you are on WSL 1.0 I suggest upgrading to 2.0

Third Step: install Frappe and ERPNext

STEP 1 Install git

sudo apt-get install git

STEP 2 install python-dev

sudo apt-get install python3-dev

You may have an error of downloading this command like this “Unable to fetch some archives, maybe run apt-get update or try with — fix-missing?” to solve it run

sudo apt-get update

STEP 3 Install setuptools and pip (Python’s Package Manager).

sudo apt-get install python3-setuptools python3-pip

STEP 4 Install virtualenv

sudo apt-get install virtualenv

STEP 5 Install MariaDB 10.3 stable package

open this link

https://downloads.mariadb.org/mariadb/repositories/#mirror=piconets

For ubuntu 20.04

sudo apt-get install software-properties-common

sudo apt-key adv — fetch-keys ‘https://mariadb.org/mariadb_release_signing_key.asc'

sudo add-apt-repository ‘deb [arch=amd64,arm64,ppc64el] https://ftp.icm.edu.pl/pub/unix/database/mariadb/repo/10.3/ubuntu focal main’

sudo apt update

sudo apt install mariadb-server

sudo mysql_secure_installation

STEP 6 MySQL database development files

sudo apt-get install libmysqlclient-dev

STEP 7 Edit the mariadb configuration ( unicode character encoding )

sudo nano /etc/mysql/my.cnf

add this to the my.cnf file

[mysqld]

character-set-client-handshake = FALSE

character-set-server = utf8mb4

collation-server = utf8mb4_unicode_ci

[mysql]

default-character-set = utf8mb4

Now press (Ctrl-X) to exit

sudo service mysql restart

STEP 8 install Redis

sudo apt-get install redis-server

STEP 9 install Node.js 14.X package

sudo apt-get install curl

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

sudo apt-get install -y nodejs

STEP 10 install Yarn

sudo npm install -g yarn

STEP 11 install wkhtmltopdf

sudo apt-get install xvfb libfontconfig wkhtmltopdf

STEP 12 install frappe-bench

sudo -H pip3 install frappe-bench

IMPORTANT: you may wish to log out and log back into your terminal before next step and You must login.

bench — version

STEP 13 initilise the frappe bench & install frappe latest version

bench init frappe-bench — frappe-branch version-13

cd frappe-bench/

bench start

keep this terminal open and open a new one to run the next commands

STEP 14 creates a site in frappe bench

bench new-site mysite.localhost

STEP 15 install ERPNext latest version in bench & site

bench get-app erpnext — branch version-14

bench --site mysite.localhost install-app erpnext

Congratulations you are running ERPNext on WSL. Based on what I see after installing my environment on WSL it is a better solution than VMware and docker in memory and CPU matters.

If you find this article helpful, please consider helping me to evacuate from the warzone area and move to a safer place by donating to my family campaign on GoFundMe here

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Alaa Alsalehi
Alaa Alsalehi

Written by Alaa Alsalehi

Chief technology officer of NewHR company, one of the leading companies in HR software in Palestine. I have a food recipe content startup

Responses (1)

Write a response