ERPNext is a great ERP for system for all the small range to enterprise level companies in any country. With the years of ODOO experience, we like to say, this is better for your accounting needs specially. ERPNext got a robust system for all the sub modules such as accouting, hr and others. Specially need to mention about the user friendliness. More friendly than Odoo Community edition.
By the way, this tutorial is about how to install erpnext on you ubuntu instance easily. Use this link if you don’t have a VPS server yet. You will get 100$ free credits for the start.
Software Requirements
Make sure, you got the following specs on your server.Updated Ubuntu 22.04
A user with sudo privileges
Python 3.10+
Node.js 16
Hardware Requirements
1GB RAM (Enough for a Few Users with Sites)
20GB Hard Disk
First run the command below to update and upgrade the system.
sudo apt-get update -y sudo apt-get upgrade -y
Then run the following commands one by one to create a new user and assign privileges and login as the user to the server.
sudo adduser [frappe-user] usermod -aG sudo [frappe-user] su [frappe-user] cd /home/[frappe-user]
Make sure, you have replaced the word [frappe-user].
Now run the following commands one by one to install the required packages and python environment.
sudo apt-get install git\ sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils sudo apt-get install python3.10-venv sudo apt-get install software-properties-common sudo apt install mariadb-server mariadb-client sudo apt-get install redis-server
The following commands will install other necessary packages.
sudo apt-get install xvfb libfontconfig wkhtmltopdf sudo apt-get install libmysqlclient-dev
Now, let’s configure the mysql server.
sudo mysql_secure_installation
Make sure you select the followings.
- 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
After giving all the commands abour for the setup, you have to edit the following file.
sudo nano /etc/mysql/my.cnf
Make sure you add the following lines to the above mentioned file.
[mysqld] character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci [mysql] default-character-set = utf8mb4
After saving it by using Ctrl+Z and by pressing yes. Just restarted the mysql server.
sudo service mysql restart
Now lt’s install Curl, Yarn, Node and NPM. (Just run the followings line by line).
sudo apt install curl curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash source ~/.profile nvm install 16.15.0 sudo apt-get install npm sudo npm install -g yarn
Now it’s time to install frappe bench and initialize it.
sudo pip3 install frappe-bench bench init --frappe-branch version-14 frappe-bench cd frappe-bench
Now give permissions to the logged user.
chmod -R o+rx /home/[frappe-user]
Then create a new site.
bench new-site [site-name]
Now you have to download and install the necessary app from frappe site. (Just install the HRM if you need it, else ignore it.)
bench get-app payments\ bench get-app --branch version-14 erpnext bench get-app hrms bench --site [site-name] install-app erpnext bench --site [site-name] install-app hrms
Finally you can test the ERPNxt by running the following command. But it will be stopped automatically when you restart the server. So we got something to do. (To check the website, you can use you ip with 8000 port like http://172.182.22.12:8000)
bench start
However let’s enable schedulers and make sure the system runs always.
bench --site [site-name] enable-scheduler bench --site [site-name] set-maintenance-mode off sudo bench setup production [frappe-user] bench setup nginx sudo supervisorctl restart all sudo bench setup production [frappe-user]
Now all the things are done. You just have to install ssl using letsencrypt plugin. Let me know if you need that as a tutorial.