How to Install ERPNext on Ubuntu 20.04

ERPNext is a modern, easy-to-use, free, business system used by more than three thousand enterprises. ERPNext has everything you need to run a business. ERPNext includes all modules and integrations out of the box including Financial Accounting, CRM, Inventory, Sales, Purchasing, Projects, Manufacturing, Education, Healthcare, E-Commerce, Website and Support. Supported industry domains are Non Profit, Agriculture, Hospitality, Healthcare, Education, Manufacturing, Retail, Services and Distribution.

ERPNext recommends that a VPS should have at least 1GB RAM but after I installed this, RAM usage appeared to be between 1-2GB. Using 1GB RAM would not completely load (although I have read that others have been successful while using only a few users), so the minimum required should be 2GB RAM.

The Easy Install script should get you started with a Frappe/ERPNext setup with minimal manual intervention and effort. Since there are a lot of configurations being automatically setup, it is recommended to execute this script on a fresh server.

This script will:

  • install the pre-requisites
  • install the command line bench (under ~/.bench)
  • Create a new bench (a folder that will contain your entire frappe/erpnext setup at ~/frappe-bench)
  • Create a new ERPNext site on the bench (site1.local)

Passwords for Frappe Administrator and MariaDB (root) will be asked and saved under ~/passwords.txt. The log file is saved under /tmp/logs/install_bench.log in case you run into any issues during the install.

  1. Update:
$ sudo apt update
$ sudo apt upgrade
  1. Add a new user (substituting ‘username'):
$ sudo adduser username
$ sudo usermod -aG sudo username
  1. Switch to the new user (substituting ‘username'):
$ su - username
$ export LC_ALL=C.UTF-8
  1. Install Python packages:
$ sudo apt install python3-minimal build-essential python3-testresources python3-setuptools
  1. Download the install file:
$ wget https://raw.githubusercontent.com/frappe/bench/develop/install.py
  1. Run the install script (substituting ‘username'):
$ sudo python3 install.py --verbose --production --user username --frappe-branch version-13 --erpnext-branch version-13

During the Install process you will be asked to enter a mysql & Administrator password.
On a 2GB RAM, 1vCPU Vultr server the install took about 10-15 minutes. When it is complete, you should see:

Bench + Frappe + ERPNext has been successfully installed!

When the setup is complete, you will be able to access the system at http://<your-server-ip>. Enter the Username as ‘Administrator' and the password that was entered during the install process for the Administrator user.

Once logged in, you can follow the prompts to setup ERPNext which include:

  • Selecting your language, region, time zone, currency, a new user (you) with email and password.
  • Select the industry domains you will use for ERPNext
  • Information about your company (eg. Company name, description, bank, beginning of financial year)

REFERENCES

https://github.com/frappe/bench
https://github.com/frappe/bench/blob/develop/docs/easy_install.md
https://discuss.erpnext.com/t/easiest-simple-way-to-install-erpnext-13/77641
https://docs.erpnext.com/docs/v13/user/manual/en

Hosting

This web app has been tested on Vultr and DigitalOcean. This app can also be installed on other hosts such as Amazon AWS, Google Cloud, Microsoft Azure and others.

Minimal Server Requirements

The recommended installation should use at least 2GB of RAM.

Installation & Maintenance

If you would like to get this app installed, maintained or need training, Contact Me to get current rates.

 

5 thoughts on “How to Install ERPNext on Ubuntu 20.04

  1. I’ve tried many instructions and this is the only one which works like a charm! Just that the last step #6, needed to run second time due to the following error occurred for first time :

    EXEC /bin/sh -c ‘rm -f -r /var/tmp/ansible-tmp-1639700685.508107-31119-13456275857625/ > /dev/null 2>&1 && sleep 0’
    fatal: [localhost]: FAILED! => {
    “changed”: true,
    “cmd”: [
    “bench”,
    “restart”
    ],
    “delta”: “0:00:01.945707”,
    “end”: “2021-12-17 00:24:47.625426”,
    “invocation”: {
    “module_args”: {
    “_raw_params”: “bench restart”,
    “_uses_shell”: false,
    “argv”: null,
    “chdir”: “/home/erpnext/frappe-bench”,
    “creates”: null,
    “executable”: null,
    “removes”: null,
    “stdin”: null,
    “stdin_add_newline”: true,
    “strip_empty_ends”: true,
    “warn”: true
    }
    },
    “msg”: “non-zero return code”,
    “rc”: 1,
    “start”: “2021-12-17 00:24:45.679719”,
    “stderr”: “Traceback (most recent call last):\n File \”/usr/local/bin/bench\”, line 33, in \n sys.exit(load_entry_point(‘frappe-bench’, ‘console_scripts’, ‘bench’)())\n File \”/home/erpnext/.bench/bench/cli.py\”, line 117, in cli\n raise e\n File \”/home/erpnext/.bench/bench/cli.py\”, line 107, in cli\n bench_command()\n File \”/usr/lib/python3/dist-packages/click/core.py\”, line 764, in __call__\n return self.main(*args, **kwargs)\n File \”/usr/lib/python3/dist-packages/click/core.py\”, line 717, in main\n rv = self.invoke(ctx)\n File \”/usr/lib/python3/dist-packages/click/core.py\”, line 1137, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File \”/usr/lib/python3/dist-packages/click/core.py\”, line 956, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File \”/usr/lib/python3/dist-packages/click/core.py\”, line 555, in invoke\n return callback(*args, **kwargs)\n File \”/home/erpnext/.bench/bench/commands/utils.py\”, line 31, in restart\n restart_supervisor_processes(bench_path=’.’, web_workers=web)\n File \”/home/erpnext/.bench/bench/utils/bench.py\”, line 267, in restart_supervisor_processes\n bench.run(f\”supervisorctl restart {group}\”)\n File \”/home/erpnext/.bench/bench/bench.py\”, line 43, in run\n return exec_cmd(cmd, cwd=cwd or self.cwd)\n File \”/home/erpnext/.bench/bench/utils/__init__.py\”, line 126, in exec_cmd\n raise CommandFailedError\nbench.exceptions.CommandFailedError”,
    “stderr_lines”: [
    “Traceback (most recent call last):”,
    ” File \”/usr/local/bin/bench\”, line 33, in “,
    ” sys.exit(load_entry_point(‘frappe-bench’, ‘console_scripts’, ‘bench’)())”,
    ” File \”/home/erpnext/.bench/bench/cli.py\”, line 117, in cli”,
    ” raise e”,
    ” File \”/home/erpnext/.bench/bench/cli.py\”, line 107, in cli”,
    ” bench_command()”,
    ” File \”/usr/lib/python3/dist-packages/click/core.py\”, line 764, in __call__”,
    ” return self.main(*args, **kwargs)”,
    ” File \”/usr/lib/python3/dist-packages/click/core.py\”, line 717, in main”,
    ” rv = self.invoke(ctx)”,
    ” File \”/usr/lib/python3/dist-packages/click/core.py\”, line 1137, in invoke”,
    ” return _process_result(sub_ctx.command.invoke(sub_ctx))”,
    ” File \”/usr/lib/python3/dist-packages/click/core.py\”, line 956, in invoke”,
    ” return ctx.invoke(self.callback, **ctx.params)”,
    ” File \”/usr/lib/python3/dist-packages/click/core.py\”, line 555, in invoke”,
    ” return callback(*args, **kwargs)”,
    ” File \”/home/erpnext/.bench/bench/commands/utils.py\”, line 31, in restart”,
    ” restart_supervisor_processes(bench_path=’.’, web_workers=web)”,
    ” File \”/home/erpnext/.bench/bench/utils/bench.py\”, line 267, in restart_supervisor_processes”,
    ” bench.run(f\”supervisorctl restart {group}\”)”,
    ” File \”/home/erpnext/.bench/bench/bench.py\”, line 43, in run”,
    ” return exec_cmd(cmd, cwd=cwd or self.cwd)”,
    ” File \”/home/erpnext/.bench/bench/utils/__init__.py\”, line 126, in exec_cmd”,
    ” raise CommandFailedError”,
    “bench.exceptions.CommandFailedError”
    ],
    “stdout”: “WARN: bench is installed in editable mode!\n\nThis is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`\n\n$ supervisorctl restart frappe:\nfrappe: ERROR (no such group)\nfrappe: ERROR (no such group)\nERROR: “,
    “stdout_lines”: [
    “WARN: bench is installed in editable mode!”,
    “”,
    “This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`”,
    “”,
    “$ supervisorctl restart frappe:”,
    “frappe: ERROR (no such group)”,
    “frappe: ERROR (no such group)”,
    “ERROR: ”
    ]
    }

    PLAY RECAP **********************************************************************
    localhost : ok=87 changed=51 unreachable=0 failed=1 skipped=59 rescued=0 ignored=0

    Traceback (most recent call last):
    File “install.py”, line 500, in
    install_bench(args)
    File “install.py”, line 281, in install_bench
    run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
    File “install.py”, line 416, in run_playbook
    success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
    File “/usr/lib/python3.8/subprocess.py”, line 364, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=erpnext’]’ returned non-zero exit status 2.

    1. I tried #6 twice, and I’m still getting the same error that you did. I get this error no matter the method I use. Each time, I delete my GCP instance and start over. Did you make any changes to make this work?

    2. I tried #6 six times in a row. Still not working. I’m deleting my GCP instance and starting over with a manual method. I just can’t get any install.py method to work.

  2. fatal: [localhost]: FAILED! => {
    “cache_update_time”: 1641969758,
    “cache_updated”: false,
    “changed”: false,
    “invocation”: {
    “module_args”: {
    “allow_unauthenticated”: false,
    “autoclean”: false,
    “autoremove”: false,
    “cache_valid_time”: 0,
    “deb”: null,
    “default_release”: null,
    “dpkg_options”: “force-confdef,force-confold”,
    “force”: false,
    “force_apt_get”: false,
    “install_recommends”: null,
    “only_upgrade”: false,
    “package”: [
    “mariadb-server”,
    “mariadb-client”,
    “libmariadbclient18”
    ],
    “pkg”: [
    “mariadb-server”,
    “mariadb-client”,
    “libmariadbclient18”
    ],
    “policy_rc_d”: null,
    “purge”: false,
    “state”: “present”,
    “update_cache”: null,
    “upgrade”: null
    }
    },
    “msg”: “‘/usr/bin/apt-get -y -o \”Dpkg::Options::=–force-confdef\” -o \”Dpkg::Options::=–force-confold\” install ‘mariadb-client’ ‘libmariadbclient18” failed: E: Unable to correct problems, you have held broken packages.\n”,
    “rc”: 100,
    “stderr”: “E: Unable to correct problems, you have held broken packages.\n”,
    “stderr_lines”: [
    “E: Unable to correct problems, you have held broken packages.”
    ],
    “stdout”: “Reading package lists…\nBuilding dependency tree…\nReading state information…\nSome packages could not be installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet been created\nor been moved out of Incoming.\nThe following information may help to resolve the situation:\n\nThe following packages have unmet dependencies:\n mariadb-client : Depends: mariadb-client-10.4 (>= 1:10.4.22+maria~focal) but it is not going to be installed\n”,
    “stdout_lines”: [
    “Reading package lists…”,
    “Building dependency tree…”,
    “Reading state information…”,
    “Some packages could not be installed. This may mean that you have”,
    “requested an impossible situation or if you are using the unstable”,
    “distribution that some required packages have not yet been created”,
    “or been moved out of Incoming.”,
    “The following information may help to resolve the situation:”,
    “”,
    “The following packages have unmet dependencies:”,
    ” mariadb-client : Depends: mariadb-client-10.4 (>= 1:10.4.22+maria~focal) but it is not going to be installed”
    ]
    }

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.