Installing ERPnext
(uninstallable faux-OpenSource ERP)

I'm running it on an old small form factor HP with Ubuntu Server 20.04 LTS. I put the OS on with only the prerequisite of OpenSSH checked to install from the software list. I did this because I only manage my servers with the Webmin or Virtualmin software options. They're both nice GUI webpage-type interfaces for managing a server.

I also named my machine MyERP (myerp) just to make things handy inside my network; e.g. http://myerp/ is how I access the final system while at home or when OpenVPN connecting to my home network.

WHENEVER YOU DO A PROJECT LIKE THIS! Look for error messages that scroll past the screen during the installation of things. In most casts you can scroll the window up to review the messages thrown at you during install. Sometimes software doesn't get installed on the first try, and you simply try again. Sometimes when you move on without a prerequisite, the goal is not achieved or will operate in a faulty manner.

At first, this choice of OpenSource ERP software looked as cryptic to install as all the other choices, but then I found Geoffrey Karani on YouTube (video below). He also has a blog with the instructions I used to install my own instance. He has great educator skills. I'm probably going to buy his lessons.

These first commands are for the Webmin software:

I'm starting here assuming you have a type of Ubuntu server OS installed on a machine. At this stage the only way to communicate with your server is to be at it's physical keyboard & screen, or to SSH into it with some terminal type console window (CMD for Windows OS). If you named your server myerp , named it's admin erpadmin and you are using a normal computer to access it, in the terminal window type ssh erpadmin@myerp and hit enter. If it looks like an error occured you can use the internal IP that you saw while installing the OS, like this, ssh erpadmin@192.168.1.184.

The first login always asks you to approve the key for encryption so just answer yes. then put in the password you made for that admin. After you're in, do the following:

  • sudo nano /etc/apt/sources.list #(note that the first use of SuDo has you enter the admin password again)
    then add these lines at the bottom of the file,
    # I put this next line in here
    deb http://download.webmin.com/download/repository sarge contrib

    Ctrl+X says leave the Nano file editor, then answer "Y"es to save the changes, then press your enter key to finish.
    ...OR...
    Ctrl+O then [Enter], then Ctrl+X, which is, write out the changes, and leave.

  • sudo wget http://www.webmin.com/jcameron-key.asc

  • sudo apt-key add jcameron-key.asc

  • sudo apt-get update

  • sudo apt-get install -y apt-transport-https

  • sudo apt-get install -y build-essential

  • sudo apt-get install -y libdbi-perl libdbd-pg-perl libhtml-entities-numbered-perl libhtml-html5-entities-perl libtest-exception-perl libmodule-build-perl libwrap0 libwrap0-dev mcrypt libmcrypt-dev zip unzip zip unzip

  • sudo apt -y install git #(on Ubuntu 20.04 it's preinstalled, but you can still run it to see)

  • sudo apt -y upgrade #(look at the messages output near the top after this operation starts. "no longer requirred:")

  • sudo apt -y autoremove #(on a fresh install, this is safe. Once I did it on a complex system and many bad things happened!!!)

  • sudo apt-get -y install webmin

A reboot is comming next, but in this case we side track because of an old paranoia I have from fresh installation problems MariaDB on Ubuntu Servers back when 18.04 was new.

At this point you can access the Webmin system with https://myerp:10000/ and login with any real user with login capabilities you made on the system, but most likely you'll only use the one you created during the OS installation.

Since Webmin uses the "snakeoil" private key for secure websites, you will get the warning pages in a browser. Click the thing for advanced, then look for the thing for accept the risks and click it too.

These first commands are for the MariaDB software and adding the Webmin interface for it:

  • Open Webmin in a browser by the computers name during OS install (https://myerp:10000/), or the IP Address of that machine in your network (maybe https://192.168.1.145:10000/ or something like that).

  • Use the Bootup and Shutdown section of "Webmin -> System" to disable Apparmor

    • Check the box for apparmor, then scroll to the bottom of that screen. Find the button [Disable Now and On Boot], and click it.

  • sudo reboot now, or click the button for [Reboot System], and pro tip, since you use it a lot, click the star atop the next page to add it to favorites. The favorites button is the star near your logout button at the bottom of the left-side-panel.

Go back to your terminal window and login again with ssh. (note, you could also do these commands via webmin, but sometimes a terminal is faster)

Here we are forcing the server to look at the 10.5 version because an earlier attempt failed at the end because Frappe was demanding 10.4 or newer, but Ubuntu's safe repositories are below that version.

  • wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

  • echo "d4e4635eeb79b0e96483bd70703209c63da55a236eadd7397f769ee434d92ca8 mariadb_repo_setup" | sha256sum -c -

  • chmod +x mariadb_repo_setup

  • sudo ./mariadb_repo_setup --mariadb-server-version="mariadb-10.5"

  • sudo apt update

  • sudo apt -y install mariadb-server mariadb-client mariadb-backup libmysqlclient-dev

Back at the Webmin page, look low on the left-side-panel and click the Refresh Modules section, then after it's done select the MySQL Database Server option of "Webmin -> Servers" section. The main screen panel should say "MariaDB Database Server" at the top and you can see that server is running because there's a button to stop it but not one to start it.

If it goes well, use the GUI to stop the database server now, if not, try "sudo systemctl stop mariadb". You are about to alter the config file for MariaDB. Soooo....
Either use sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf to open it for editing in the Terminal Window,
...OR...
Use the "Webmin -> Tools" File Manager GUI option to navigate to and open it for editing the file. When you mouse over a file's row, you see a three dot options menu to get at editing a file.

Either way you decide to use, you will need to alter the subsection for [mysqld] to add the following lines below it, as shown by Karani's guide:

  • innodb-file-format=barracuda

  • innodb-file-per-table=1

  • innodb-large-prefix=1

  • character-set-client-handshake = FALSE

  • character-set-server = utf8mb4

  • collation-server = utf8mb4_unicode_ci


Save and close that file.

Because this base "myerp" server is a "one-trick-pony", also edit the /etc/mysql/my.cnf file to add the following lines:
(note 1: if it's a multi-user and/or virtualized system follow the frappe instructions)
(note 2: there is another way to edit the config files of a server like this in Webmin. Look for the "Edit Config Files" button/icon in the servers page (https://myerp:10000/mysql/edit_manual.cgi?xnavigation=1) and it gives you access to all the config files of that server type.)


  • [mysqld]

  • character-set-client-handshake = FALSE

  • character-set-server = utf8mb4

  • collation-server = utf8mb4_unicode_ci


  • [mysql]

  • default-character-set = utf8mb4

Save that file, restart the MariaDB server with Webmin or systemctl start, To set, or at least know what your DB Admin Password is, do one of two things:
In the the "Webmin -> Servers" section, click the MySQL Database Server option. At the bottom right, look for the button named "Change Administration Password" and click it. Write your "CHANGE-THIS-TO-A-PASSWORD" password in twice then click [Save Now].
...OR...
Go back to your Terminal Window to issue the following commands.

  • sudo mysql -u root

    • USE mysql; #(note the difference between the command prompt before and after you do this command)

    • UPDATE user SET plugin='mysql_native_password' WHERE User='root';

    • UPDATE user SET authentication_string=password('CHANGE-THIS-TO-A-PASSWORD') WHERE user='root';

    • FLUSH PRIVILEGES;

    • EXIT; ...OR... \q

  • If you used the Terminal Window, and your window in Webmin is still at "MariaDB Database Server", refresh the page, if not navagate there again with the servers menu. It should be waiting for you to enter the "CHANGE-THIS-TO-A-PASSWORD" password you just made a couple steps ago. You should now see the GUI controls for manipulating your database schema again.

  • Use Bootup and Shutdown section of "Webmin -> System" to enable Apparmor

    • Check the box for apparmor, then scroll to the bottom of that screen. Find the button [Start Now and On Boot], and click it.

  • sudo reboot now, or click the button for [Reboot System].

After the reboot, have a look at the "MariaDB Database Server" module to see if it's running. It should be.

These commands are for adding NginX web server and the Webmin interface for it: (required for production method)

  • sudo apt -y install nginx

...OR...

  • sudo apt -y install nginx-extras nginx-doc

That was so easy, right? Now for the Webmin GUI.

To prevent geting any possible error about a missing "HTML::Entities module" package from the Perl modules set you need to drop to the Cpan shell in a terminal window, sudo perl -MCPAN -e shell. (It might ask you to permit it to configure itself, type yes, then [Enter]) your goal is to see the "cpan[1]> " prompt waiting for you then type "install HTML::Entities" and hit [Enter].

So in summary:

  • sudo perl -MCPAN -e shell

    • yes

    • install HTML::Entities

    • exit

Sidetrack here, speaking of PEARL, Webmin seems to always have some Pearl programming language module missing. In Webmin's left-side-panel, go to the "Webmin -> Tools" section and click the Pearl Modules option. This GUI is an alternative to the "cpan[1]> " shell you just used moments ago. Switch from the "Install module" tab to the "Suggested modules" tab. You'll probably see the right-side-box "Modules to Install" already populated with some things like "Authen::Libwrap". Those are the things ready to install, so just click the [Install Selected Modules] button at the bottom to install what's in the suggested queue.

Back on track now for the NginX GUI. At the top of the left-side-panel of the Webmin or Dashboard panels is a primary section for Webmin, click it to expand that section and then select the option for Webmin Configuration by clicking it. The main screen now displays a lot of things but right now just click on the "Webmin Modules". Click the radio button for "( ) Third party module from" and put this in the text box"

  • https://www.justindhoffman.com/sites/justindhoffman.com/files/nginx-0.10.wbm_.gz

After clicking the button for [Install Module], follow the prompts for what to do next.

Check the Servers -> NginX webserver app's status. If it's still in error mode, reboot your server. If you click the triangle (Start Server button) in the top right corner and it doesn't start or says the init.d/nginx file isn't there, then NginX failed to install; if the button is a square instead of a triangle, all is well, it's running. Use one of the many methods noted above to install nginx, aka: nginx-core or {-light, -full, -extras}, and maybe nginx-common & nginx-doc on the server. It should be running immediately after that install.

These commands are for preparing the way for ERPnext via Frappe.io's Bench: (production method) DOES NOT WORK

  • sudo apt -y install python3-minimal python3-pip python3-setuptools python3-testresources

  • sudo apt-get -y install libfontconfig wkhtmltopdf #(build-essential already installed to make Webmin happy.)

  • sudo apt-get -y install redis-server

This little section takes care of getting your Node.JS, and Yarn the most recently reccommended way via NVM.

  • curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

  • logout #(Because you altered your .bashrc file you need to logout and log back in again.)

  • nvm install 14

  • npm install -g yarn

This might not happen to you, but I was getting the mysterious appearance of a GUI interface at my servers console. It was making my Webmin freeze and was also making my ssh logins freeze and the window they were logged into also. I found a solution on the Ask Ubuntu website. If you also have this problem, do these commands quickly after a reboot:

  • ssh adminAccountID@myerp

  • sudo systemctl set-default multi-user.target

  • sudo reboot now

If you looked at the row for "multi-user.target" in the System -> Bootup and Shutdown list, you would notice its Service Status switched from Always to No.

Installing the Bench software:

At the time of this writing (06/22/2022) Frappe gave two ways to git'er-dun. One is "Manual Installation" which is good if you want a better handle on the nuts & bolts of the software. The other is the "Easy Install Script" method which I've tried and failed at a few times. See below.

  • wget https://raw.githubusercontent.com/frappe/bench/develop/install.py

  • sudo python3 install.py --production

If that last command doesn't ask you for the "CHANGE-THIS-TO-A-PASSWORD" password you made earlier for the database server, something went wrong. Look at the error and fix it, then try the script again. For example, this happened to me:

Checking System Compatibility...
ubuntu 20 is compatible!
Bench's CLI needs these to be defined!
Run the following commands in shell:
export LC_ALL=C.UTF-8

...SO...

  • export LC_ALL=C.UTF-8

  • sudo python3 install.py --production

Once it's successful open up your version of http://myerp/ to proceed.

Everything I tried ended in a failure!

These commands are for preparing the way for ERPnext via Frappe.io's Bench: (developer method) DOES NOT WORK

Let's check some of the system requirements list before proceding:

  • lsb_release -a #(Ubuntu OS version)

  • git --version

  • mariadb --version

  • strings /usr/sbin/cron | grep Paul && strings /usr/sbin/cron | grep Version #(Cron version)

  • nginx -v

  • curl --version

If any of those commands failed to get the version information, do the appropriate sudo apt -y install _____ for it.

Okay, now were doing the Frappe specific prerequisites:

  • sudo apt -y install python3-dev

  • sudo apt -y install python3-setuptools python3-testresources python3-pip

  • sudo apt -y install python3-virtualenv

  • sudo apt-get -y install redis-server

  • curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

  • sudo apt-get -y install nodejs

  • sudo npm -y install -g yarn

  • sudo apt-get -y install wkhtmltopdf #(this software requires a reboot)

  • sudo reboot now

This might not happen to you, but I was getting the mysterious appearance of a GUI interface at my servers console. I'm 100% certian that it's caused by the install of "wkhtmltopdf" above. It was making my Webmin freeze and was also making my ssh logins freeze and the window they were logged into froze also. I found a solution on the Ask Ubuntu website. If you also have this problem, do these commands quickly after a reboot:

  • ssh adminAccountID@myerp

  • sudo systemctl set-default multi-user.target

  • sudo reboot now

If you looked at the row for "multi-user.target" in the System -> Bootup and Shutdown list, you would notice its Service Status switched from Always to No.

Installing the Bench software the Frappe reccommended way:

At the time of this writing (06/22/2022) Frappe gave two ways to git'er-dun. One is "Manual Installation" which is good if you want a better handle on the nuts & bolts of the software. The other is the "Easy Install Script" method which I've tried and failed at a few times.

Below is me following the Manual Installation.

You can use Webmin's User Administration module "System -> Users and Groups -> [Create a new user]", or the Terminal Window to do the commands below to make the frappe base user for installing their systems. They highly reccomend not using the frappe ID because the default is targeted by hackers; any coffee synonym would be a bad choice.

  • sudo adduser espresso

  • sudo usermod -aG sudo espresso

After the new espresso user is created, you can either open a new Terminal Window and login with ssh espresso@myerp, or you can do the "su" command below to Switch User from your base admin to this new ID with sudo priveledges.

  • sudo su - espresso

  • sudo -H pip install frappe-bench

  • exit #(if your "Shell" is set to /bin/sh instead of /bin/bash, otherwise logout.)

  • ssh espresso@myerp

  • bench --version #(if you see something like 5.11.0 as the answer, you're good.)

  • bench init --frappe-branch version-12 --python /usr/bin/python3 decaf-bench

  • cd decaf-bench


If that last command doesn't ask you for the "CHANGE-THIS-TO-A-PASSWORD" password you made earlier for the database server, something went wrong. Look at the error and fix it, then try the script again. For example, this happened to me:

Checking System Compatibility...
ubuntu 20 is compatible!
Bench's CLI needs these to be defined!
Run the following commands in shell:
export LC_ALL=C.UTF-8

...SO...

  • export LC_ALL=C.UTF-8

  • sudo python3 install.py --production

Once it's successful open up your version of http://myerp/ to proceed.

The Manual Way