ERPNext Version 15 Installation on Ubuntu 24.04 – Step-by-Step Guide


Introduction

ERPNext is a comprehensive open-source ERP system designed to streamline business operations. This guide will walk you through the process of installing ERPNext v15 on Ubuntu 24.04.


Prerequisites

Software Requirements

  • Ubuntu 24.04 (updated)

  • A user with sudo privileges

  • Python 3.11+

  • pip 20+

  • MariaDB 10.3.x

  • Node.js 18

  • yarn 1.12+

Hardware Requirements

  • 4GB RAM

  • 40GB Hard Disk


Installation Steps

1. Update Packages

sudo apt-get update -y && sudo apt-get upgrade -y

2. Create Frappe Bench User

sudo adduser frappe
sudo usermod -aG sudo frappe
su - frappe
cd /home/frappe

3. Install Required Packages

sudo apt-get install git python3-dev python3-setuptools python3-pip python3.12-venv -y

4. Install MariaDB

sudo apt-get install software-properties-common mariadb-server -y
sudo mysql_secure_installation

Follow the prompts:

  • Switch to unix_socket authentication: Y

  • Change root password: Y

  • Remove anonymous users: Y

  • Disallow root login remotely: N

  • Remove test database: Y

  • Reload privileges: Y

5. Configure MySQL

sudo nano /etc/mysql/my.cnf

Add:

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

[mysql]
default-character-set = utf8mb4

Restart:

sudo service mysql restart

6. Install Redis

sudo apt-get install redis-server -y

7. Install Node.js, npm, yarn

sudo apt install curl -y
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 18
sudo apt-get install npm -y
sudo npm install -g yarn -y

8. Install wkhtmltopdf

sudo apt-get install xvfb libfontconfig wkhtmltopdf -y

9. Install Frappe Bench CLI

sudo -H pip3 install frappe-bench --break-system-packages
sudo -H pip3 install ansible --break-system-packages

10. Initialize Bench

bench init frappe-bench --frappe-branch version-15
cd frappe-bench
chmod -R o+rx /home/frappe

11. Create a Site

bench new-site [site-name]

12. Install Apps

bench get-app payments
bench get-app --branch version-15 erpnext
bench get-app hrms  # Optional

bench --site [site-name] install-app erpnext
bench --site [site-name] install-app hrms  # Optional

13. Start Server

bench start

Visit: http://[YOUR_SERVER_IP]:8000


Setup for Production

1. Enable Scheduler & Disable Maintenance Mode

bench --site [site-name] enable-scheduler
bench --site [site-name] set-maintenance-mode off

2. Setup Production

sudo bench setup production frappe
bench setup nginx
sudo supervisorctl restart all

Now your ERPNext instance is running in production mode.


Ansible main.yaml Configuration

---
- include_tasks: centos.yml
  when: ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 6

- include_tasks: ubuntu-trusty.yml
  when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'

- include_tasks: ubuntu-xenial_bionic.yml
  when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int >= 16

- name: Add configuration
  template:
    src: '{{ mysql_conf_tpl }}'
    dest: '{{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }}'
    owner: root
    group: root
    mode: 0644
  when: mysql_conf_tpl != 'change_me' and ansible_distribution != 'Debian'
  notify: restart mariadb

- include_tasks: debian.yml
  when: ansible_distribution == 'Debian'

- name: Add configuration
  template:
    src: '{{ mysql_conf_tpl }}'
    dest: '{{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }}'
    owner: root
    group: root
    mode: 0644
  when: mysql_conf_tpl != 'change_me' and ansible_distribution == 'Debian'
  notify: restart mariadb

- name: Add additional conf for MariaDB 10.2 in mariadb.conf.d
  blockinfile:
    path: /etc/mysql/conf.d/settings.cnf
    block: |
      !includedir /etc/mysql/mariadb.conf.d/
  become: yes
  become_user: root
  when: ansible_distribution in ['Ubuntu', 'Debian']

- name: Add ERPNext-specific MariaDB config
  blockinfile:
    path: /etc/mysql/mariadb.conf.d/erpnext.cnf
    block: |
      [mysqld]
      pid-file = /var/run/mysqld/mysqld.pid
      socket = /var/run/mysqld/mysqld.sock
      collation-server = utf8mb4_unicode_ci
    create: yes
  become: yes
  become_user: root
  when: ansible_distribution in ['Ubuntu', 'Debian']

- name: Start and enable MariaDB
  service:
    name: mariadb
    state: started
    enabled: yes

- debug:
    msg: "{{ mysql_root_password }}"

- include_tasks: mysql_secure_installation.yml
  when: mysql_root_password is defined

- debug:
    var: mysql_secure_installation
  when: mysql_secure_installation and mysql_root_password is defined


Conclusion

You have successfully installed and configured ERPNext v15 on Ubuntu 24.04 and optionally set it up in production mode. You can now begin managing your business processes with one of the most powerful open-source ERP systems available.

All the best! 🙂
Refrence Video-https://youtu.be/blbRs0emj0E?si=C_VgO92mu9m7i4b5


On this page