Fully Automated Install Script for ERPNext Version 14

UPDATE: Support added for Ubuntu 23.04, 24.04 and Debian 12. Also, ERPNext installation is now optional and added optional install for HRMS.

Just tried - everything ran fine until HRMS install.

Installation for Frappe HR app failed due to an error. Please try re-installing the app or report the issue on https://github.com/frappe/hrm
s/issues/new if not resolved.
An error occurred while installing hrms: Module import failed for Expense Claim Type, the DocType you’re trying to open might be deleted.<br
Error: No module named ‘frappe.core.doctype.expense_claim_type’

Then the script stopped - and the webpage gives:

Uncaught Server Exception

There was an error building this page

Error Code: 404

If you don’t know what just happened, and wish to file a ticket please
copy the error below and share it.

I’ll try it again in a few hours without the HRMS module.

Tried again without HRMS. Ran smoothly and installed no problem.

Ahh - just noticed - instead of a directory “frappe-bench” - it created one named “v14-bench” instead (and I installed ERPNext v15).

My bad. I have reverted the bench directory to the default frappe-bench.

i noticed that HRMS install fails sometimes but its got nothing to do with the script.

1 Like

So it is better to skip HRMS in auto installer and do it manually right?

Yes. Although the failure doesn’t occur every time

Hello @flexy2ky,

it is me again :), i want to install ERPNext by your script, but i get error;

Enter the site name (If you wish to install SSL later, please enter a FQDN): erpnextdemo.local
Enter the Administrator password:
Confirm password:
Password confirmed

Now setting up your site. This might take a few minutes. Please wait...
Traceback (most recent call last):
  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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/frappe/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/frappe/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/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 68, in new_site
    _new_site(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 87, in _new_site
    install_db(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 160, in install_db
    setup_database(force, source_sql, verbose, no_mariadb_socket)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/__init__.py", line 21, in setup_database
    return frappe.database.mariadb.setup_db.setup_database(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 31, in setup_database
    if force or (db_name not in dbman.get_database_list()):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py", line 50, in get_database_list
    return self.db.sql("SHOW DATABASES", pluck=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 211, in sql
    self.connect()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 117, in connect
    self._conn: "MariadbConnection" | "PostgresConnection" = self.get_connection()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 107, in get_connection
    conn = self._get_connection()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 113, in _get_connection
    return self.create_connection()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 116, in create_connection
    return pymysql.connect(**self.get_connection_settings())
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 361, in __init__
    self.connect()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 669, in connect
    self._request_authentication()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 957, in _request_authentication
    auth_packet = self._read_packet()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1698, "Access denied for user 'root'@'localhost'")
An error occurred on line 369 with exit status 0

root had password but i removed it (How to remove root password on Debian? - Unix & Linux Stack Exchange), still gives errors.