How to Install ERPNEXT on Ubuntu
I am using ERPNEXT for all kinds of ERP and Accounts work I need. The Best software open-source by Frappe.
Today I am going to tell you how to install that on Ubuntu. You will find lots of documents that are not correct or not easy to follow, hitting by errors, and more. Let’s started
Step 1: Log in to Your Server by SSH. If you have VNC on your Server, we recommend using VNC Viewer.
ssh root@your_server_ip
After you log in to your OS. Update and Upgrade your OS. as you are login as root no longer need sudo for now.
apt update -y && apt upgrade -y
After updating the os, let’s create a user name erpnext. This is use by frappe bench package.
adduser erpnext
# you can replace the erpnext with anyuser name.
# that will not use normally
usermod -aG sudo erpnext
We added erpnext user to root group. Let’s install some required software need for erpnext
apt install nginx -y #Installing Nginx
apt install mariadb-server mariadb-client -y #Installing MariaDB
apt install zip unzip git -y #Installing ZIP UNZIP and Git
apt install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils #Installing Python Tools required for erpnext
apt install python3.10-venv
apt install software-properties-common
apt install redis-server # Redis server for Caching
apt install xvfb libfontconfig wkhtmltopdf #For PDF Tooling
apt install libmysqlclient-dev # For OS Level Database Library
apt install supervisor # Handle Daemon for ERPNEXT
After installing all the required Software let’s setup the MariaDB server.
mysql_secure_installation
service mariadb enable
service nginx enable
service redis-server enable
service mariadb start
service nginx start
service redis-server start
Edit The MariaDB config
nano /etc/mysql/my.cnf
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
Save the config CTRL + O, Enter, CTRL + X
service mariadb restart
Follow the Step on MariaDB setup. Now Let’s log in to our created user and setup NVM and Node.
su - erpnext
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm ls-remote ## Check all the version of Node
nvm install 22.12.0 ## Install LTS Version Means Long Time Support
node -v
# Node JS 22.12.0
Ok, the Node is installed now. One thing to Note: now Node js will only work under this erpnext user only. For other users, you need to install nvm again and install node for that. If you install nvm in the root level you need to make the node available for all users. (Will show in another blog.) Let’s follow the process for erpnext.
npm install yarn -g
sudo pip3 install frappe-bench
bench init --frappe-branch version-15 frappe-bench
cd frappe-bench
chmod -R o+rx /home/erpnext
bench new-site erp.test.com
## It will Ask you for MariaDB root password Give it.
## You will asked to setup a password for the site. Make sure you remember it.
## It will required after some step.
bench get-app --branch version-15 erpnext
bench get-app hrms ## If you need HRMS for your ERP system
bench --site erp.test.com install-app erpnext
bench --site erp.test.com install-app hrms ## Any App you have in system you can install it by this way
After That done. Let’s active the site. Config in NGINX, Setup Supervisor, Disable maintain mode.
bench --site erp.test.com enable-scheduler
bench --site erp.test.com set-maintenance-mode off
sudo bench setup production erpnext
sudo supervisorctl restart all
Now Let’s try to browse the site. You will get erpnext login page. use Username: Administrator and Password you setup when you init the site.
One more thing left, before you setup anything. Let’s secure the site 1st then set it. I recommend that. because if you setup that without SSL you need to configure the website URL again from the backend for load the site with SSL or you will get a Mixed content issue. So I recommend always setup after SSL setup is complete. Let’s Setup SSL. I will use Let’s Encrypt.
## Exit from User erpnext
exit
apt install python3-certbot-nginx ## As we are using Nginx as proxy serve.
certbot --nginx -d erp.test.com
## Accept and Follow the Guide.
## After Setup complete restart nginx
service nginx restart
sudo supervisorctl restart all
Now visit the site with https://erp.test.com
Login and Setup your ERPNEXT and Start Using It.
That’s it. Now you have erpnext in your hand.
** If you need any help or face any issues, let me know in the comments.