So Raspberry Pi 5 is out, and being 2-3 times faster than the Pi 4B it should now be possible to reliably Run Erpnext. So here is a tutorial on how to set up Erpnext 14 on a Raspberry Pi 5 8GB running Ubuntu 23.10.
This tutorial Has essentially been copied, word for word, from Here with a few tweaks. So thank you very much to @ hashank_shirke.
Hi guys!
Installing Frappe & ERPNext can be a daunting task, especially when you try to install it manually but donât worry! Just follow this simple step-by-step guide and youâll sail through the installation process.
This guide might look intimidating at first but trust me it is lengthy because it is detailed and explains each step one by one.
Letâs start!
Table of Contents:
- Step 1: Server Setup
- Step 2: Install Required Packages
- Step 3: Configure MySQL Server
- Step 4: Install CURL, Node, NPM, Yarn
- Step 5: Install Frappe Bench
- Step 6: Install ERPNext and other Apps
- Step 7: Setup Production Server
PRE-REQUISITES:
- Operating System: Ubuntu 23.10 for Raspberry Pi with Desktop
- Recommended Hardware: Raspberry Pi 5 (4GB or 8GB RAM)
- A Fresh Installation
SERVER SETUP
1.1 After First power on go through the usual setup i.e. Language, Keyboard, Username and Password etc etc
1.2 After you reach the desktop you can open terminal and start setting up ERPNEXT (ctrl+alt+t is a shortcut)
1.3 Update & upgrade server packages
sudo apt-get update -y
sudo apt-get upgrade -y
1.4 Create a new user
We create this user as a security measure to prevent root user access.
This user will be assigned admin permissions and will be used as the main Frappe Bench user
(first command below creates the user, second one adds the user to the sudo group, the third one logs you in as the newly created user and the fourth switches you to that userâs home directory)
sudo adduser [frappe-user]
sudo usermod -aG sudo [frappe-user]
su [frappe-user]
cd /home/[frappe-user]/
Note: Replace [frappe-user] with your username. Eg. sudo adduser myname
INSTALL REQUIRED PACKAGES
Frappe Bench and ERPNext requires many packages to run smoothly. In this step we will install all the required packages for the system to work correctly.
Note: During the installation of these packages the server might prompt you to confirm if you want to continue installing the package [Y/n]. Just hit âyâ on your keyboard to continue.
2.1 Install GIT
sudo apt-get install git
Check if GIT is correctly installed by running git --version
2.2 Install Python & 2.3 Install Python Virtual Environment
sudo apt-get install -y python3 python3-venv python3-pip
Check if Python is correctly installed by running python3 -V
2.4 Install Software Properties Common (for repository management)
sudo apt-get install software-properties-common
2.5 Install MariaDB (MySQL server)
sudo apt install mariadb-server mariadb-client
Check if MariaDB is correctly installed by running mariadb --version
2.6 Install Redis Server
sudo apt-get install redis-server
2.7 Install other necessary packages (for fonts, PDFs, etc)
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev
CONFIGURE MYSQL SERVER
3.1 Setup the server
sudo mysql_secure_installation
During the setup process, the server will prompt you with a few questions as given below. Follow the instructions to continue the setup;
- Enter current password for root: (Enter your SSH root user password)
- Switch to unix_socket authentication [Y/n]: Y
- Change the root password? [Y/n]: Y
It will ask you to set new MySQL root password at this step. This can be different from the SSH root user password. - Remove anonymous users? [Y/n] Y
- Disallow root login remotely? [Y/n]: N
This is set as N because we might want to access the database from a remote server for using business analytics software like Metabase / PowerBI / Tableau, etc. - Remove test database and access to it? [Y/n]: Y
- Reload privilege tables now? [Y/n]: Y
3.2 Edit the MySQL default config file
sudo vi /etc/mysql/my.cnf
Add the below code block at the bottom of the file;
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
If you donât know how to use VI:
- Once the file is open, scroll to the last letter of the last word on the last sentence, hit âaâ and then start editing the file.
- After youâre done editing the file hit âEsc + :wq + Enterâ to save the file
3.3 Restart the MySQL server (for the config to take effect)
sudo service mysql restart
Instal CURL, Node, NPM and Yarn
4.1 Install CURL
sudo apt install curl
4.2 Install Node
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 16.15.0
4.3 Install NPM
sudo apt-get install npm
4.4 Install Yarn
sudo npm install -g yarn
Check if Node is correctly installed by running node --version
INSTALL FRAPPE BENCH
5.1 Install Frappe Bench
I encountered the following error when trying to install frappe-bench using pip3.
error: externally-managed-environment
Ă This environment is externally managed
â°â> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
...
I was able to resolve it by running the following command and then going ahead with the installation
sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old
Install frappe-bench pip3
sudo pip3 install frappe-bench
Check if Frappe Bench is correctly installed by running bench --version
5.2 Initialize Frappe Bench
bench init --frappe-branch version-14 frappe-bench
5.3 Go to Frappe Bench directory
This will be the main directory from where we will be running all the commands.
The full path of this directory will be: /home/[frappe-user]/frappe-bench/
cd frappe-bench/
5.4 Change user directory permissions
This will allow execution permission to the home directory of the frappe user we created in step 1.4
chmod -R o+rx /home/[frappe-user]/
5.5 Create a New Site
We will use this as the default site where ERPNext and other apps will be installed.
bench new-site site1.local
Install ERPNext and other Apps
Finally, weâre at the last stage of the installation process!
6.1 Download the necessary apps to our server
Download the payments apps . This app is required during ERPNext installation
bench get-app payments
Download the main ERPNext app
bench get-app --branch version-14 erpnext
Download the HR & Payroll app (optional)
bench get-app hrms
Download the ecommerce integrations apps (optional)
bench get-app ecommerce_integrations --branch main
Check if all the apps are correctly downloaded by running bench version --format table
6.2 Install all the Apps
Install the main ERPNext app
bench --site site1.local install-app erpnext
Install the HR & Payroll app (optional)
When installing this app I encountered the following error,
Installation for Frappe HR app failed due to an error. Please try re-installing the app or report the issue on https://github.com/frappe/hrms/issues/new if not resolved.
An error occurred while installing hrms: Error 111 connecting to localhost:13000. Connection refused.
So I edited the file /home/erpnext/frappe-bench/sites/common_site_config.json and changed the redis port (labelled âredis_socketioâ) from 13000 to 6379 or to whatever port number your redis server is running. Save file and proceed to install hrms.
bench --site site1.local install-app hrms
Install the ecommerce integrations apps (optional)
bench --site site1.local install-app ecommerce_integrations
SETUP PRODUCTION SERVER
7.1 Enable scheduler service
bench --site site1.local enable-scheduler
7.2 Disable maintenance mode
bench --site site1.local set-maintenance-mode off
7.3 Setup production config
sudo bench setup production [frappe-user]
7.4 Setup NGINX web server
bench setup nginx
7.5 Final server setup
sudo supervisorctl restart all
sudo bench setup production [frappe-user]
When prompted to save new/existing config files, hit âYâ
Ready to Go!
You can now go to your server [IP-address]:80 and you will have a fresh new installation of ERPNext ready to be configured!
For initial login use the username âadministratorâ and the password you setup for [frappe-user]