Ahmad Faraz

Senior Frontend Developer

The Complete Guide to Installing ERPNext on macOS

πŸ“‹ Pre-requisites Ensure your system meets the following requirements: πŸ› οΈ Step 1: Install Homebrew Homebrew is a package manager for macOS that simplifies the installation of software. πŸ“Œ Step 2: Install Git Git is a version control system that tracks changes and facilitates collaboration. 🐍 Step 3: Install setuptools and pip setuptools and pip help manage Python…

πŸ“‹ Pre-requisites

Ensure your system meets the following requirements:

Python 3.6+
Homebrew 3.6+
Node.js 14
Redis 5                   (for caching and real-time updates)
MariaDB                   (for database-driven apps)
Yarn 1.12+                (JS dependency manager)
Pip 20+                   (Python dependency manager)

πŸ› οΈ Step 1: Install Homebrew

Homebrew is a package manager for macOS that simplifies the installation of software.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

πŸ“Œ Step 2: Install Git

Git is a version control system that tracks changes and facilitates collaboration.

brew install git

🐍 Step 3: Install setuptools and pip

setuptools and pip help manage Python packages and dependencies.

sudo pip3 install setuptools

πŸ”’ Step 4: Install virtualenv

virtualenv helps create isolated Python environments.

sudo pip3 install virtualenv

πŸ—„οΈ Step 5: Install MariaDB

MariaDB is an open-source relational database.

Follow the installation guide: πŸ‘‰ Install MariaDB on macOS

Run these commands to install and secure MariaDB:

brew install mariadb
mysql_install_db
mariadb-secure-installation
mariadb -u root -p

If pompted, set the MySQL root password. Otherwise, manually initialize it:

sudo mysql_secure_installation

πŸ“Š Step 6: Install MySQL Client

brew install mysql-client

πŸ“ Step 7: Configure MariaDB for Unicode Support

Edit the MariaDB configuration:

sudo nano /opt/homebrew/mariadb/my.cnf

Add the following content:

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]

default-character-set = utf8mb4

Restart MariaDB:

brew services start mariadb

πŸ”΄ Step 8: Install Redis

Redis is used for caching and real-time updates.

brew install redis

πŸ“¦ Step 9: Install Node.js 14

Node.js is required for running ERPNext’s JavaScript dependencies.

brew install node

To manage Node versions, use NVM.

πŸ“Œ Step 10: Install Yarn

Yarn is a fast, reliable JavaScript package manager.

sudo npm install -g yarn

πŸ“„ Step 11: Install wkhtmltopdf

wkhtmltopdf converts HTML pages to PDF documents.

brew install wkhtmltopdf

βš™οΈ Step 12: Install Frappe Bench

frappe-bench is the command-line tool for managing ERPNext installations.

sudo -H pip3 install frappe-bench

Verify the installation:

bench --version

πŸ“‚ Step 13: Initialize the Frappe Bench

bench init frappe-bench --frappe-branch version-13
cd frappe-bench/
bench start

🌐 Step 14: Create a New Site

bench new-site site1.local

If you encounter this error:

Expected value utf8mb4_unicode_ci, found value utf8mb4_general_ci

Fix it by updating the MariaDB configuration:

mariadb -u root -p
SET GLOBAL collation_server = 'utf8mb4_unicode_ci';
brew services restart mariadb

πŸ“Š Step 15: Install ERPNext

Download and install the ERPNext app:

bench get-app erpnext --branch version-13
bench --site site1.local install-app erpnext
bench --site site1.local add-to-hosts
bench start

βœ… Access ERPNext

Visit the following URL in your browser:

http://site1.local:8000/

+

Leave a comment