Frappe Bench Setup

Frappe Bench Setup Documentation (ERPNext v15)

✅ Step 1: System Preparation

Update and verify base packages:

sudo apt-get update
python3 -V

Install required system packages:

sudo apt-get install git
sudo apt-get install python3-dev
sudo apt-get install virtualenv
sudo apt-get install apt-transport-https curl

✅ Step 2: Setup MariaDB Repository

Create keyring directory and add MariaDB key:

sudo mkdir -p /etc/apt/keyrings
sudo curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'

Manually edit sources to add MariaDB repo:

sudo vi /etc/apt/sources.list.d/mariadb.sources

Add the official MariaDB 10.6 or above source for your Ubuntu version

Update repositories and install MariaDB:

sudo apt update
sudo apt-get install mariadb-server

Start and secure MariaDB:

sudo systemctl status mariadb
sudo mariadb
mariadb -u root -p
sudo mysql_secure_installation

Install MySQL client libraries:

sudo apt-get install libmysqlclient-dev
sudo nano /etc/mysql/my.cnf
sudo service mysql restart

✅ Step 3: Install Redis

sudo apt-get install redis-server

✅ Step 4: Install Node.js, npm, yarn

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g yarn

✅ Step 5: Install PDF Dependencies

sudo apt-get install xvfb libfontconfig wkhtmltopdf

✅ Step 6: Install bench CLI (Frappe tool)

Option 1: Using pip

sudo -H pip3 install frappe-bench

Option 2: Preferred - Using pipx

sudo apt install pipx
pipx ensurepath
pipx install frappe-bench

Confirm installation:

bench --version
pipx --version
pipx list

Add to shell profile:

nano ~/.zshrc
source ~/.zshrc
which bench
bench --version

✅ Step 7: Download ERPNext App

bench get-app erpnext --branch version-15

✅ Step 8: Initialize Bench

bench init frappe-bench --frappe-branch version-15
cd frappe-bench

✅ Step 9: Install Python Process Manager

Install and link honcho:

pip3 install honcho
pipx inject frappe-bench honcho

Or in virtual environment:

python3 -m venv ~/bench-env
source ~/bench-env/bin/activate
pip install honcho

✅ Step 10: Start Development Server

cd frappe-bench
bench start

✅ Step 11: Create a New Site

bench new-site rohit
bench use rohit
bench start

✅ Step 12: (Optional) Port Conflict Troubleshooting

Check for processes:

sudo lsof -i :13000
sudo lsof -i :11000

Kill the process:

sudo kill -9 <PID>

On this page