[Guide] How to install ERPNext v15 on Linux Ubuntu (step-by-step instructions)

Hi guys! :raised_hand_with_fingers_splayed:

The long awaited Frappe & ERPNext v15 is now released! Let’s jump in and try out the latest applications from Frappeverse!

v15 Full Changelog: https://github.com/frappe/frappe/issues/22834
v15 Release Announcement: Frappe and ERPNext v15 release

Note: If you’re looking for v14 Installation Guide: [Guide] How to install ERPNext v14 on Linux Ubuntu (step-by-step instructions)

Let’s start!

:page_facing_up: Table of Contents:

  • Step 1: Server Setup
  • Step 2: Install Required Packages
  • Step 3: Configure MySQL Server
  • Step 4: Install CURL, Node, NPM, Yarn
  • Step 5: Install Frappe Bench
  • Step 6: Install ERPNext and other Apps
  • Step 7: Setup Production Server
  • Step 8: Custom Domain & SSL Setup

PRE-REQUISITES:

  • Operating System: Linux Ubuntu 22.04 LTS
  • Minimum Recommended Hardware: 2 CPU | 4 GB RAM | 20 GB Disk
  • Root shell access to the server (via SSH)

:one: SERVER SETUP


1.1 Login to the server as root user

1.2 Setup correct date and timezone (important step as it impacts ERPNext usage)

Check the server’s current timezone

date

Set correct timezone as per your region

timedatectl set-timezone "Asia/Kolkata"

1.3 Update & upgrade server packages

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

1.4 Create a new user
We create this user as a security measure to prevent root user access.
This user will be assigned admin permissions and will be used as the main Frappe Bench user

sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
su [frappe-user] 
cd /home/[frappe-user]/

Note: Replace [frappe-user] with your username. Eg. sudo adduser myname

For some cloud providers like AWS & Azure, you wont’t have root password access so you can simply run sudo -i when you login to the server using the default user (eg. ubuntu in AWS)

:two: INSTALL REQUIRED PACKAGES


Frappe Bench and ERPNext requires many packages to run smoothly. In this step we will install all the required packages for the system to work correctly.

Note: During the installation of these packages the server might prompt you to confirm if you want to continue installing the package [Y/n]. Just hit “y” on your keyboard to continue.

2.1 Install GIT

sudo apt-get install git

Check if GIT is correctly installed by running git --version

2.2 Install Python

sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils

2.3 Install Python Virtual Environment

sudo apt-get install python3.10-venv

Check if Python is correctly installed by running python3 -V

2.4 Install Software Properties Common (for repository management)

sudo apt-get install software-properties-common

2.5 Install MariaDB (MySQL server)

sudo apt install mariadb-server mariadb-client

Check if MariaDB is correctly installed by running mariadb --version

2.6 Install Redis Server

sudo apt-get install redis-server

2.7 Install other necessary packages (for fonts, PDFs, etc)

sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev

:three: CONFIGURE MYSQL SERVER


3.1 Setup the server

sudo mysql_secure_installation

During the setup process, the server will prompt you with a few questions as given below. Follow the instructions to continue the setup;

  • 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

3.2 Edit the MySQL default config file

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

If you don’t know how to use VIM:

  • Once the file is open, hit “i” key to start editing the file.
  • After you’re done editing the file hit “Esc + :wq” to save the file

3.3 Restart the MySQL server (for the config to take effect)

sudo service mysql restart

:four: Instal CURL, Node, NPM and Yarn


4.1 Install CURL

sudo apt install curl

4.2 Install Node

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

source ~/.profile

nvm install 18

4.3 Install NPM

sudo apt-get install npm

4.4 Install Yarn

sudo npm install -g yarn

Check if Node is correctly installed by running node --version

:five: INSTALL FRAPPE BENCH


5.1 Install Frappe Bench

sudo pip3 install frappe-bench

Check if Frappe Bench is correctly installed by running bench --version

5.2 Initialize Frappe Bench

bench init --frappe-branch version-15 frappe-bench

5.3 Go to Frappe Bench directory
This will be the main directory from where we will be running all the commands.
The full path of this directory will be: /home/[frappe-user]/frappe-bench/

cd frappe-bench/

5.4 Change user directory permissions
This will allow execution permission to the home directory of the frappe user we created in step 1.4

chmod -R o+rx /home/[frappe-user]/

5.5 Create a New Site
We will use this as the default site where ERPNext and other apps will be installed.

bench new-site site1.local

:six: Install ERPNext and other Apps


Finally, we’re at the last stage of the installation process!

6.1 Download the necessary apps to our server
Download the payments apps . This app is required during ERPNext installation

bench get-app payments

Download the main ERPNext app

bench get-app --branch version-15 erpnext

Download the HR & Payroll app (optional)

bench get-app hrms

Check if all the apps are correctly downloaded by running bench version --format table

6.2 Install all the Apps

Install the main ERPNext app

bench --site site1.local install-app erpnext

Install the HR & Payroll app (optional)

bench --site site1.local install-app hrms

Note: You might get some warnings / error messages while trying to install apps on the default site. These messages can be ignored and you can proceed further.

:seven: SETUP PRODUCTION SERVER


7.1 Enable scheduler service

bench --site site1.local enable-scheduler

7.2 Disable maintenance mode

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

7.3 Setup production config

sudo bench setup production [frappe-user]

7.4 Setup NGINX web server

bench setup nginx

7.5 Final server setup

sudo supervisorctl restart all
sudo bench setup production [frappe-user]

When prompted to save new/existing config files, hit “Y”

:tada: Ready to Go!

You can now go to your server [IP-address]:80 and you will have a fresh new installation of ERPNext ready to be configured!

If you are facing any issues with the ports, make sure to enable all the necessary ports on your firewall using the below commands;

sudo ufw allow 22,25,143,80,443,3306,3022,8000/tcp
sudo ufw enable

:eight: : Custom Domain & SSL Setup

For SSL configuration, you can run the following commands;

Before you begin, add an A record on your domain DNS and point it to the ERPN server IP address.

cd /home/[frappe-user]/frappe-bench/

bench config dns_multitenant on

bench setup add-domain [subdomain.yourdomain.com] --site [site-name]

bench setup nginx 
sudo service nginx reload

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

On terminal prompt, follow the instructions and select the correct site number and trying access your site on https:// from the custom domain you just added.

You now have a fully production ready setup of Frappe & ERPNext on your server!

Thanks,
Shashank

31 Likes

@shashank_shirke. There is nothing change in command.

You just copied and pasted it here on the New Thread.

change is here 5.2 Initialize Frappe Bench

bench init --frappe-branch version-14 frappe-bench. ## change to 15

No any Official Release for the below app.

User will face incompatibility issue.

Thanks.

The v14 thread is too long now with 200+ replies and so it is better to have any issues related to the latest v15 in a separate thread instead of continuing in the old v14 thread.

As of now, the HRMS app currently does not have a version-15 branch (only version-15-beta is there) and so it installs the develop branch by default. I have tested this and it seems to work

There is also a change of version numbers for Node (4.2) and for get-app erpnext (6.1)

Also, I tried installing the Python 3.11 release but v15 still requires python3.10-venv so continued with 3.10 for now. Let’s see if others encounter any issues with v15 and we can continue to update the guide accordingly.

You can try this unnattended install script to install version 15.

in addition, you can select the specific version you wish to install. currently supports installation of Versions 13 to 15.

5 Likes

Here comes the Video Tutorial for same…
Installation of ERPNext-15 on Ubuntu Server 22.04 LTS

1 Like

Hi @shashank_shirke ,
Thank you for your details installation.
Kindly, I have a question.
Can I use this documentation to implement ERPnext for my customer? I mean is this stable and doesn’t have any interruption?
Am saying this because I try some documentation for installing ERPnext14, but after some weeks, the server down, and need from me to setup again, or tell me Internal server error

[Tutorial][Docker] Installing ERPNext-15 on Docker: A Step-by-Step Guide [Production]

NewProject

1 Like

hI,

I followed and installed completely but site shows like this below.

2 Likes

Hi @Omar_Mohammed
Yes, version 15 is a stable release and you can definitely implement it for your customers. The documentation has almost all aspects covered in detail but I agree that there can still be issues that are difficult to troubleshoot and are not explicitly mentioned in the documentation. For such issues you can always refer to this community forum and ask for help.

Also, if you’re finding it difficult to implement and maintain the self-hosted version of ERPNext then I would highly recommend you to check the cloud version here: https://frappecloud.com/

Using the cloud version is a good starting point as you won’t have to worry about the installation and maintenance of the package. You can directly jump to the implementation and customization steps.

Hi @stepsibg

It looks like your browser did not load the resources like CSS and JS files correctly. Did you complete the step no. 5.4 mentioned in the guide above?

Trying running this command chmod -R o+rx /home/[frappe-user]/ and then bench restart

I think I missed this command.

i tried it but getting this error “Operation not permitted”

Try running the command as superuser sudo chmod -R o+rx /home/[frappe-user]

1 Like

I tried with Sudo chmod -R o+rx /home/[frappe-user]/

and no error.

site is working now

Thanks a lot

yes

worked and site is running now

Hi,

I successfully installed the ERPNext version 15 and restored my ERPNext Version 14 data.

I am using VirtualBox on windows.

I am getting below error

image

and here the code if i clock on “Show Traceback”

Traceback (most recent call last):
File “apps/frappe/frappe/www/app.py”, line 27, in get_context
boot = frappe.sessions.get()
File “apps/frappe/frappe/sessions.py”, line 143, in get
bootinfo = get_bootinfo()
File “apps/frappe/frappe/boot.py”, line 86, in get_bootinfo
frappe.get_attr(method)(bootinfo)
File “apps/erpnext/erpnext/startup/boot.py”, line 64, in boot_session
bootinfo.sysdefaults.demo_company = frappe.db.get_single_value(“Global Defaults”, “demo_company”)
File “apps/frappe/frappe/database/database.py”, line 782, in get_single_value
frappe.throw(
File “apps/frappe/frappe/init.py”, line 570, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 542, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 496, in _raise_exception
raise exc
frappe.exceptions.ValidationError: Field demo_company does not exist on Global Defaults

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

Traceback (most recent call last):
File “apps/frappe/frappe/website/serve.py”, line 18, in get_response
response = renderer_instance.render()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 84, in render
html = self.get_html()
File “apps/frappe/frappe/website/utils.py”, line 522, in cache_html_decorator
html = func(*args, **kwargs)
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 95, in get_html
self.update_context()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 162, in update_context
data = self.run_pymodule_method(“get_context”)
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 224, in run_pymodule_method
return method(self.context)
File “apps/frappe/frappe/www/app.py”, line 29, in get_context
raise frappe.SessionBootFailed from e
frappe.exceptions.SessionBootFailed

Python 3.10 venv r
equirement ???

Can’t confirm that part…
Tested without any issue on Ubuntu 23.04 and Debian 12

I am getting error on supervisor setup there is actually nothing in this guide to solve that ,

on bench restart i get error as

 sudo supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
ERROR: sudo supervisorctl restart frappe:
subprocess.CalledProcessError: Command 'sudo supervisorctl restart frappe:' returned non-zero exit status 2.

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

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/dist-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.10/dist-packages/bench/commands/utils.py", line 41, in restart
    Bench(".").reload(web, supervisor, systemd)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 152, in reload
    restart_supervisor_processes(bench_path=self.name, web_workers=web, _raise=_raise)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py", line 321, in restart_supervisor_processes
    failure = bench.run(f"{sudo}supervisorctl restart {group}", _raise=_raise)
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/__init__.py", line 158, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: sudo supervisorctl restart frappe:

i installed supervisor
sudo apt-get install supervisor

and then did bench setup supervisor
still nothing
i thing i need to set proper supervisor config file ,

any help would be appreciated.

1 Like

this feels insecure, isn’t it should be frappe-bench folder only?

3 Likes

Hi @Suresh_Thakor
I’m receiving the below error on step 5.2, I’m using a VM with Ubuntu 22.04:

$ sudo supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
WARN: restarting supervisor failed. Use bench restart to retry.
$ bench build
Assets for Release v15.3.0 don’t exist
*Traceback (most recent call last):/apps/frappe/node_modules to ./assets/frappe/node_modules *

  • File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main*
  • return _run_code(code, main_globals, None,*
  • File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code*
  • exec(code, run_globals)*
  • File “/home/frappe1/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in *
  • main()*
  • File “/home/frappe1/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main*
  • click.Group(commands=commands)(prog_name=“bench”)*
  • File “/home/frappe1/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1157, in call*
  • return self.main(*args, *kwargs)
  • File “/home/frappe1/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1078, in main*
  • rv = self.invoke(ctx)*
  • File “/home/frappe1/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke*
  • return _process_result(sub_ctx.command.invoke(sub_ctx))*
  • File “/home/frappe1/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke*
  • return _process_result(sub_ctx.command.invoke(sub_ctx))*
  • File “/home/frappe1/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1434, in invoke*
  • return ctx.invoke(self.callback, *ctx.params)
  • File “/home/frappe1/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 783, in invoke*
  • return __callback(*args, *kwargs)
  • File “/home/frappe1/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 72, in build*
  • bundle(*
  • File “/home/frappe1/frappe-bench/apps/frappe/frappe/build.py”, line 236, in bundle*
  • make_asset_dirs(hard_link=hard_link)*
  • File “/home/frappe1/frappe-bench/apps/frappe/frappe/build.py”, line 390, in make_asset_dirs*
  • click.echo(unstrip(click.style(“\u2714”, fg=“green”) + " Application Assets Linked") + “\n”)*
  • File “/home/frappe1/frappe-bench/env/lib/python3.10/site-packages/click/utils.py”, line 318, in echo*
  • file.write(out) # type: ignore*
    UnicodeEncodeError: ‘latin-1’ codec can’t encode character ‘\u2714’ in position 5: ordinal not in range(256)
    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.10/dist-packages/bench/commands/make.py”, line 75, in init*
  • init(*
  • File “/usr/local/lib/python3.10/dist-packages/bench/utils/render.py”, line 105, in wrapper_fn*
  • return fn(*args, *kwargs)
  • File “/usr/local/lib/python3.10/dist-packages/bench/utils/system.py”, line 112, in init*
  • build_assets(bench_path=path)*
  • File “/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py”, line 351, in build_assets*
  • exec_cmd(command, cwd=bench_path, env={“BENCH_DEVELOPER”: “1”})*
  • File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 158, 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
Do you want to rollback these changes? [y/N]:

Any clue what might be?

Thanks,

RollBack ? No

go to bench folder then run

bench setup requirements --python

bench pip install -e apps/frappe
2 Likes