Fully Automated Install Script for ERPNext Version 14

@Suresh_Thakor Update on your issue: I have found that the script does not handle Bench installation on Ubuntu 20.04 LTS correctly after upgrading Python3.10. This behaviour was unintended and will be fixed shortly. Thank you for bringing this to my attention.

I was getting the error from the redis server about port 11000. I have to remove it again from the conf.d file to be able to run the bench

Did this occur after the script successfully installed ERPNext?

@flexy2ky

hey, I want to say i tried your script and it is working great, after i failed with the regis port 11000 and 6379 error, and couldn’t fix it despite searching and trying… your script works!

I have 3 questions:

1- SSL/Let’s Encrypt. If I have a Asus router which because of my dynamic IP address, and uses a DDNS such as username.asuscomm.com , will SSL works if it redirects to a private IP 192.168.1.222 through router port forward using port 80? If yes, what should i write in the email and site?

2- Can you let us how we can add through your script the automate install of selective apps: HMRS, HEALTH, POSAWESOME,EDUCATION,PAYMENTS? or you can allow us to install for example 0 disable, 1 enable, etc…

3- during the process, is a username frappe created for bench? or ERPnext/bench commands should be executed with the custom username of ubuntu created before running the script?

I think your script is marvelous! thanks for your time!

Hello, I have a question how do i use your script to create the SSL later on (after its was finish) ?
Because i have a client where i need to start development but i don’t have access to the domain name !
Thanks you for script, it’s a time saver !

The easiest way i can tell you is to try to setup SSL when using the script to install even though you don’t have the domain pointed yet. Sure it will fail but the necessary packages for SSL activation would have been installed. Once you have the domain name set up and resolving to the server, all you need do is login to the server via ssh and run

sudo certbot --nginx

and follow the on-screen instructions to attempt the SSL activation. if your domain is resolving to the server then the SSL installation should be successful this time.

1 Like

In case anyone is asking, the script has been updated to manage installation of 3 versions.

2 Likes

Hi @flexy2ky,
I came across your repo and i saw this. What does it do? gui for bench? like bench manager? …

@girumtibebu That’s work in progress. trying to develop a bench manager for deploying ERPNext to remote VPS. Still very much in the early stages of development so i don’t recommend trying it out yet.

1 Like

That’s great!. I was planning to automate the deployment and maintainance of installations too much like bench manager.
Do you think setting up frappe cloud just to manage a couple of erpnext sites is an over kill? currently we use two erpnext sites internally for two of our compaines. but maintaining takes time going to cli everytime.

In README file following command incorrect:

sudo apt update && sudo -y apt upgrade

Sent Pull Request after correcting to:

sudo apt update && sudo apt -y upgrade

Is reboot MUST after above command?

Pull request merged. Thanks for the contribution :100:

Yes it is. There’s a kernel update on Ubuntu 22.04 that always shows up at the point of installing bench which requires a system reboot which will effectively truncate the install process. so best to get that out of the way by updating and rebooting before initiating the install process.

1 Like

Yes, noticed now.

Newer kernel available

│ The currently running kernel version is 5.15.0-82-generic which is not
│ the expected kernel version 5.15.0-87-generic.

│ Restarting the system to load the new kernel will not be handled
│ automatically, so you should consider rebooting.

Thank you.

1 Like

I tried, but installation wes not successful :frowning:

I got:

warning " > @frappe/esbuild-plugin-postcss2@0.1.3" has unmet peer dependency “less@^4.x”.
warning " > @frappe/esbuild-plugin-postcss2@0.1.3" has unmet peer dependency “stylus@^0.x”.
warning " > @vue/component-compiler@4.2.4" has unmet peer dependency “vuetemplate-compiler@*”.

Refer: DeployERP/LearnFrappe/InstallErpNext15.txt at main · GreatDevelopers/DeployERP · GitHub

WARN: restart failed: Couldn’t find supervisorctl in PATH

Refer: DeployERP/LearnFrappe/InstallErpNext15.txt at main · GreatDevelopers/DeployERP · GitHub

ERROR: No matching distribution found for flit_core<4,>=3.4

Refer: DeployERP/LearnFrappe/InstallErpNext15.txt at main · GreatDevelopers/DeployERP · GitHub

Complete log is at:

I rolled back:

ERROR: There was a problem while creating frappe-bench
Do you want to rollback these changes? [y/N]: y
INFO: Rolling back Bench “frappe-bench”
Bench installation complete!

Refer:

What can I do now?

There seem to have been network issues when installing pip here:

Collecting smmap<6,>=3.0.1
Downloading smmap-5.0.1-py3-none-any.whl (24 kB)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from
python-dateutil->python-crontab~=2.6.0->frappe-bench) (1.16.0)
Installing collected packages: honcho, tomli, smmap, semantic-version, python-da
teutil, python-crontab, gitdb, gitpython, frappe-bench
Successfully installed frappe-bench-5.18.0 gitdb-4.0.11 gitpython-3.1.40 honcho-
1.1.0 python-crontab-2.6.0 python-dateutil-2.8.2 semantic-version-2.8.5 smmap-5.
0.1 tomli-2.0.1
WARNING: Running pip as the ‘root’ user can result in broken permissions and con
flicting behaviour with the system package manager. It is recommended to use a v
irtual environment instead: 12. Virtual Environments and Packages — Python 3.12.1 documentation
Initialising bench in frappe-bench folder.
If you get a restart failed, don’t worry, we will resolve that later.
Setting Up Environment
$ python3 -m venv env
$ /home/hsrai/frappe-bench/env/bin/python -m pip install --upgrade pip
Requirement already satisfied: pip in ./env/lib/python3.10/site-packages (22.0.2
)
Collecting pip
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host
=‘files.pythonhosted.org’, port=443): Read timed out. (read timeout=15)”)’: /pac
kages/47/6a/453160888fab7c6a432a6e25f8afe6256d0d9f2cbd25971021da6491d899/pip-23.
3.1-py3-none-any.whl
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host
=‘files.pythonhosted.org’, port=443): Read timed out. (read timeout=15)”)’: /pac
kages/47/6a/453160888fab7c6a432a6e25f8afe6256d0d9f2cbd25971021da6491d899/pip-23.
3.1-py3-none-any.whl
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host
=‘files.pythonhosted.org’, port=443): Read timed out. (read timeout=15)”)’: /pac
kages/47/6a/453160888fab7c6a432a6e25f8afe6256d0d9f2cbd25971021da6491d899/pip-23.
3.1-py3-none-any.whl

and here:

Installing frappe
$ /home/hsrai/frappe-bench/env/bin/python -m pip install --upgrade -e /home/hsr
ai/frappe-bench/apps/frappe
Obtaining file:///home/hsrai/frappe-bench/apps/frappe
Installing build dependencies … done
Checking if build backend supports build_editable … done
Getting requirements to build editable … done
Preparing editable metadata (pyproject.toml) … done
Collecting Babel~=2.12.1 (from frappe==15.0.1)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host
=‘files.pythonhosted.org’, port=443): Read timed out. (read timeout=15)”)’: /pac
kages/df/c4/1088865e0246d7ecf56d819a233ab2b72f7d6ab043965ef327d0731b5434/Babel-2
.12.1-py3-none-any.whl
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, stat
us=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host
=‘files.pythonhosted.org’, port=443): Read timed out. (read timeout=15)”)’: /pac
kages/df/c4/1088865e0246d7ecf56d819a233ab2b72f7d6ab043965ef327d0731b5434/Babel-2
.12.1-py3-none-any.whl

And the second error which occured while frappe was being installed seems to have been as a result of the first error. pip is a mandatory dependency package used by frappe.

To repeat the steps, go to your frappe bench directory, and drop the created site. use --force flag to ensure the site is completely removed. next return to your home directory and delete the frappe bench directory created. re-run the script afterwards and it will skim through all dependency and package installation and re-initiate bench installation. if there are no network interruptions then it will install successfully.

Package was downloaded, as per:

Was downloaded as per:
DeployERP/LearnFrappe/InstallErpNext15.txt at main · GreatDevelopers/DeployERP · GitHub

There was failure, but as it give a number of tries (around 4) and for these two instances it was able to download the reuired packeges before all tries were exhausted.

As I roll backed, as per following:

because frappe bench was not installed, so there was not scope of site creation.
so I need to execute script again.

Script executed again and got it to install Frappe / ERPNext :slight_smile:

Log is at:

DeployERP/LearnFrappe/InstallErpNext15b.txt at main · GreatDevelopers/DeployERP · GitHub

On doing bench start, I got:

02:14:52 watch.1 | :warning: Please update your node version to 18
02:14:52 watch.1 |
02:14:59 watch.1 | yarn run v1.22.19
02:15:01 watch.1 | error frappe-framework@: The engine “node” is incompati
ble with this module. Expected version “>=18”. Got “12.22.9”
02:15:01 watch.1 | error Commands cannot run with an incompatible environm

~/frappe-bench$ node -v
v12.22.9

:~/frappe-bench$ source env/bin/activate
(env) hsrai@civil:~/frappe-bench$ node -v
v12.22.9

while as per DeployERP/LearnFrappe/InstallErpNext15b.txt at main · GreatDevelopers/DeployERP · GitHub of instalation log:

Now using node v18.18.2 (npm v9.8.1)

Will try to fins the solution and report here.

$ nvm use 18.18.2 made me to run ERPNext.

@flexy2ky

Thanks for the awesome installation script. Fantastic work!

I’m installing ERPNext 15 in LXD on Ubuntu 22.04. All went well until I had to answer the following question:

Would you like to continue with production install? (yes/no)
Response: y
bash: erpnext_install.sh: line 375: syntax error near unexpected token `&&'
bash: erpnext_install.sh: line 375: `    && \'

Then the script stops. I re-run it today, but it stops at the same point. Even if I do the steps mentioned at “Note” on the GitHub page.

Anything I could do to get it to finish?

@ste_885932BDX This is a known bug that has been fixed. Please run git pull in the repo home directory to pull the latest commit and try again. If the script has already created the site, please go to the frappe-bench directory and run bench drop-site [your-site-name] and then go to your user’s home directory and remove the frappe-bench directory by running sudo rm -r frappe-bench. You can then re-run the script once you’ve pulled the latest commit.

Ensure you use exactly the same DB password you supplied the first time if you re-run the script on the same machine without resetting the OS otherwise mariadb will return permission error as it has already been initialized.