Install ERPNext Version 15 in Ubuntu 24.04

Prerequisites

The below prerequisites are advised in order to get an optimal functionality of ERPNext on your server.

Software Requirements

  • Updated Ubuntu 24.04
  • Python 3.12+
  • A user with sudo privileges
  • pip 20+
  • MariaDB 10.3.x
  • Node.js 18
  • yarn 1.22+

Hardware Requirements

  • 4GB RAM
  • 40GB Hard Disk

Note:

ubuntu 24.04 default python version is python3.12

ubuntu 24.04 default mariadb version is 10.11

Here we go…

Step 1 : Create Frappe user

sudo apt-get update -y && sudo apt-get upgrade -y
sudo adduser frappe
sudo usermod -aG sudo frappe
su frappe
cd /home/frappe

Step 2 : Install Git and Python

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

Step 3 : Install MariaDB

sudo apt-get install software-properties-common
sudo apt install mariadb-server
sudo systemctl status mariadb
sudo mysql_secure_installation

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

sudo nano /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

sudo service mysql restart

Step 4 : Install Redis

sudo apt-get install redis-server

Step 5 : Install Node.js 18.X package

sudo apt install curl 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 18

Step 6 : Install Yarn

sudo apt-get install npm
sudo npm install -g yarn

Step 7 : Install wkhtmltopdf

sudo apt-get install xvfb libfontconfig wkhtmltopdf

Step 8 : Install frappe-bench

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

Step 9 : Initilise the frappe bench & install frappe latest version

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

Step 10 : Create New Site

bench new-site site1.local

Step 11 : Get App ERPNext, Payment and HRMS

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

Step 12 : Install App in site

bench --site site1.local install-app erpnext
bench --site site1.local install-app hrms

Step 13 : Start

bench use site1.local
bench start

Disable maintenance mode and Enable scheduler

bench --site site1.local set-maintenance-mode off
bench --site site1.local enable-scheduler

** Enable Developer Mode**

bench set-config -g developer_mode 1
1 Like

thank you

You’re really kind. I ran into an error at step 9.
…(Some successful steps were omitted)
[5/5] Building fresh packages…
Done in 17.26s.
Found existing apps updating states…
$ supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
WARN: restarting supervisor group frappe: failed. Use bench restart to retry.
$ bench build
Traceback (most recent call last):
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/connection.py”, line 699, in connect
sock = self.retry.call_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/retry.py”, line 51, in call_with_retry
raise error
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/retry.py”, line 46, in call_with_retry
return do()
^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/connection.py”, line 700, in
lambda: self._connect(), lambda error: self.disconnect(error)
^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/connection.py”, line 1002, in _connect
raise err
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/connection.py”, line 990, in _connect
sock.connect(socket_address)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/home/seven/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/home/seven/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/click/core.py”, line 1161, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/click/core.py”, line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/click/core.py”, line 1694, in invoke
super().invoke(ctx)
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/click/core.py”, line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/click/core.py”, line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 44, in app_group
ctx.obj = {“sites”: get_sites(site), “force”: force, “verbose”: verbose, “profile”: profile}
^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 56, in get_sites
elif default_site := frappe.get_conf().default_site:
^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/apps/frappe/frappe/init.py”, line 404, in get_conf
with init_site(site):
File “/home/seven/frappe-bench/apps/frappe/frappe/init.py”, line 414, in enter
init(self.site)
File “/home/seven/frappe-bench/apps/frappe/frappe/init.py”, line 259, in init
setup_module_map(include_all_apps=not (frappe.request or frappe.job or frappe.flags.in_migrate))
File “/home/seven/frappe-bench/apps/frappe/frappe/init.py”, line 1640, in setup_module_map
local.app_modules = cache.get_value(“app_modules”)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 92, in get_value
val = self.get(key)
^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/commands/core.py”, line 1801, in get
return self.execute_command(“GET”, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/client.py”, line 1266, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/connection.py”, line 1457, in get_connection
connection.connect()
File “/home/seven/frappe-bench/env/lib/python3.12/site-packages/redis/connection.py”, line 703, in connect
raise TimeoutError(“Timeout connecting to server”)
redis.exceptions.TimeoutError: Timeout connecting to server
subprocess.CalledProcessError: Command ‘bench build’ returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/lib/python3.12/dist-packages/bench/commands/make.py”, line 75, in init
init(
File “/usr/local/lib/python3.12/dist-packages/bench/utils/render.py”, line 105, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/dist-packages/bench/utils/system.py”, line 112, in init
build_assets(bench_path=path)
File “/usr/local/lib/python3.12/dist-packages/bench/utils/bench.py”, line 381, in build_assets
exec_cmd(command, cwd=bench_path, env=env)
File “/usr/local/lib/python3.12/dist-packages/bench/utils/init.py”, line 181, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: bench build

ERROR: There was a problem while creating frappe-bench