Introduction
Are you running a small or medium enterprise and looking for a way to integrate your essential business processes? ERPNext, a free and open-source Enterprise Resource Planning (ERP) solution, can streamline your operations by centralizing and automating key functions. This guide will walk you through the step-by-step process of installing ERPNext on your Ubuntu server, unlocking enhanced efficiency and productivity for your team.
What is ERPNext?
ERPNext is a robust, open-source ERP platform designed to simplify and automate business operations. It offers integrated tools for accounting, inventory management, customer relationship management (CRM), human resources, and project management. By centralizing data, providing real-time insights, and enabling seamless collaboration, ERPNext is a flexible and cost-effective solution for businesses of all sizes.
Prerequisites
-
Ubuntu Server: A fresh installation of Ubuntu 22.04.
-
Hardware: Minimum 2 CPU cores, 4GB RAM, and 20GB SSD storage (SSD recommended for best performance).
-
Timezone: Ensure your server’s timezone matches your location. Check with:
date
If needed, update the timezone:
sudo timedatectl set-timezone "TIMEZONE"
Replace TIMEZONE with your region, such as Asia/Kolkata or Europe/Copenhagen.
Step-by-Step Installation
1. Update System Packages
Start by updating all existing packages:
sudo apt-get update && sudo apt-get upgrade -y
2. Create a New User
Replace yourusername with your preferred username:
sudo adduser yourusername sudo usermod -aG sudo yourusername su yourusername cd /home/yourusername/
This helps keep your system secure by avoiding root user exposure.
3. Install Essential Packages
-
Fail2ban: Protects your server from unauthorized access:
sudo apt-get install fail2ban -y sudo systemctl start fail2ban
- Supervisor: Manages long-running processes:
sudo apt update && sudo apt install supervisor -y
- Git: Version control system:
sudo apt-get install git -y git --version
- Python: Required for ERPNext dependencies:
sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils python3.10-venv -y python3 -V
- MariaDB: Preferred database for ERPNext:
sudo apt install mariadb-server mariadb-client -y
- cURL: For transferring files:
sudo apt install curl -y
- Node.js: For JavaScript runtime:
curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh sudo -E bash nodesource_setup.sh sudo apt install nodejs -y sudo npm install -g yarn node --version
- Redis: For caching:
sudo apt-get install redis-server -y sudo systemctl start redis-server.service
- Additional Utilities:
sudo apt-get install software-properties-common -y sudo apt-get install libmysqlclient-dev -y sudo apt-get install xvfb libfontconfig wkhtmltopdf -y
4. Configure MariaDB
- Secure your database installation:
sudo mysql_secure_installation Answer the prompts as needed, except for “Disallow root login remotely?”—select N to allow remote access if required.
- Edit the MySQL configuration file:
sudo nano /etc/mysql/my.cnf Add the following lines at the end: [mysqld] character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci [mysql] default-character-set = utf8mb4
- Save and restart MySQL:
sudo service mysql restart
5. Install Frappe Bench
- Frappe Bench is a command-line tool for managing ERPNext installations:
sudo pip3 install frappe-bench bench --version bench init --frappe-branch version-15 frappe-bench cd /home/yourusername/frappe-bench/ chmod -R o+rx /home/yourusername/
6. Create a New Site
- Replace mysite with your preferred site name:
bench new-site mysite.local
- Set your MySQL root password and an admin password when prompted.
7. Install ERPNext and Modules
- Install the payments app and ERPNext:
bench get-app payments bench get-app --branch version-15 erpnext
- Optionally, add the HR module:
bench get-app hrms
- Check installation status:
bench version --format table
- Install ERPNext and HR modules to your site:
bench --site mysite.local install-app erpnext bench --site mysite.local install-app hrms
- Enable the scheduler:
bench --site mysite.local enable-scheduler bench --site mysite.local set-maintenance-mode off
8. Set Up NGINX and Security
- Configure NGINX:
bench setup nginx sudo supervisorctl restart all
If you encounter deprecated Ansible playbook entries, update /usr/local/lib/python3.10/dist-packages/bench/playbooks/roles/mariadb/tasks/main.yml by replacing – include with – include_tasks.
- Set up production configuration:
sudo bench setup production yourusername
- Configure the firewall:
sudo ufw allow 22,25,143,80,443,3306,3022,8000/tcp sudo ufw enable
Access your ERPNext instance at http://your-server-ip:80 using the admin credentials you set.

9. Add a Domain and SSL Certificate
- DNS Setup: Add an A record for your domain pointing to your server’s IP.
- Enable Multitenancy:
bench config dns_multitenant on
- Add Domain:
bench setup add-domain yourdomain.com --site yoursitename
- Reconfigure NGINX:
bench setup nginx sudo service nginx reload
- Install SSL with Certbot:
sudo apt update && sudo apt install snapd -y sudo snap install core sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot sudo certbot --nginx
Follow the prompts to secure your domain.
Conclusion
By following these instructions, you will have a fully operational ERPNext instance running on your Ubuntu server, ready to streamline your business operations. Take time to explore ERPNext’s features and customize them to fit your organization’s needs.
Leave a Reply