Install Bench CLI & Frappe Version-14
After setup the Ubuntu 22.04 in Windows, we can proceed to install Bench CLI. Bench is a tool used to manage Frappe and ERPNext applications.
Prerequisites
-
Ubuntu 22.04+ installed on WSL (follow the previous guide if not already done).
-
Python 3.6+ installed (Ubuntu 22.04 comes with Python 3.10 by default).
Step 1: Update and Install Dependencies
Open your Ubuntu 22.04 terminal in WSL and update the package list and upgrade installed packages by executing this command:
sudo apt update
Install essential dependencies:
sudo apt install git python-is-python3 python3-dev python3-pip redis-server
Step 2: Install MariaDB
You can install MariaDB by executing this command:
sudo apt install mariadb-server mariadb-client
During this installation you'll be prompted to set the MySQL root password. If you are not prompted, you'll have to initialize the MySQL server setup yourself. You can do that by running the command:
sudo mariadb-secure-installation
Remember: only run the command "sudo mariadb-secure-installation" if you're not prompted the password during setup.
Step 3: Edit MariaDB configuration file
To edit the configuration file for MariaDB, exexcute this command:
nano /etc/mysql/my.cnf
and add this configuration:
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
Step 4: Install Node
We can install the node
by using nvm
:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
After installing the nvm
, you may have to close your terminal and open another one. Now run the following command to install node
.
nvm install 18
Verify the installed version, by running:
node -v
Example Output: v18.20.4
Step 5: Install Yarn
Install yarn
by using npm
:
npm install -g yarn
Step 6: Install wkhtmltopdf
Excute this command to install wkhtmltopdf
sudo apt install xvfb libfontconfig
Step 7: Install Bench CLI
To install the bench CLI. 1st we need to create a python3 virtual enviroment, execute this command to install:
sudo apt install python3-venv -y
After installing the python3 venv
, you can create the virtual environment by running this command:
python3 -m venv myenv
lastly after create the folder venv
named "myenv", activate the venv
by execute this command and you can verify it by using which python
:
source myenv/bin/activate
After creating the venv
, install bench cli via pip
pip install frappe-bench
You can check the version by using this command:
bench --version
Step 8: Create Your First Bench
Create you bench with frappe version-14 by using this command:
bench init --frappe-branch version-14 <project name>
bench init bench --version version-14
Congratulations, you have installed bench onto your local computer. Let us (Sektor Kewangan) know if you need further assistance.
No Comments