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

i’m having error in bench restart as well. Any resolution on this @shashank_shirke ?

خطوات تثبيت ERPNEXT الاصدار 15

https://archive.org/details/workshop-erpnext/work_001_InstallERPNEXT_v02.pdf

1 Like

The trick is to do setup production twice ,
first do setup production then setup nginx and supervisor again even though its already there and do setup production again even though its already done ,

Dont know why its needed or why it works this way but it does solve the issue ,

3 Likes

This is the most working and best instructions i’ve found so far for v14 and v15.

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

can anyone explain why we need to do this on the whole user home directory and not just the frappe-bench folder?

it feels a bit off for me…

2 Likes

Hi @flexy2ky , your script work perfectly for me. Thank you!

But I have some question. After installation, I just can access the localhost site from http://172.31.195.183. Site run properly.

My configurated address was localhost. I can open the localhost with :8000 port. But the site appear unproperly like this:

So my question:

  1. How to change http://172.31.195.183 to localhost or my_pc_local_ip as I can did on Virtual Box VM?
  2. How to fix the site so it can run properly?

Right now I’m using Ubuntu LTS. So any commands / hints that can help me fix these problem, will much appreciated!

@kholidraf This is a permission issue. It appears the permissions to the frappe-bench directory was not set properly. Please run this command from your user’s home directory: sudo chmod 755 /home/$(echo $USER) and then go to your frappe-bench directory and run bench --site all migrate. This should fix the permission and display issue. Let me know if it works.

Also, if you setup production then you do not need to add the :8000 port except you’re running development mode.

Hi,

best instructions so far, but I am facing an error on a plain Ubuntu 22.02. installation.

frappe@eprv15:~/frappe-bench$ bench restart
$ sudo supervisorctl restart frappe-bench-web:
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-web:frappe-bench-node-socketio: ERROR (spawn error)
frappe-bench-web:frappe-bench-frappe-web: started
ERROR: sudo supervisorctl restart frappe-bench-web:
subprocess.CalledProcessError: Command 'sudo supervisorctl restart frappe-bench-web:' returned non-zero exit status 7.

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 327, 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-bench-web:

frappe@eprv15:~/frappe-bench$ sudo supervisorctl status
frappe-bench-redis:frappe-bench-redis-cache               RUNNING   pid 11933, uptime 0:04:30
frappe-bench-redis:frappe-bench-redis-queue               RUNNING   pid 11934, uptime 0:04:30
frappe-bench-web:frappe-bench-frappe-web                  RUNNING   pid 12035, uptime 0:03:48
frappe-bench-web:frappe-bench-node-socketio               FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-long-worker-0    RUNNING   pid 11947, uptime 0:04:30
frappe-bench-workers:frappe-bench-frappe-schedule         RUNNING   pid 11937, uptime 0:04:30
frappe-bench-workers:frappe-bench-frappe-short-worker-0   RUNNING   pid 11946, uptime 0:04:30

node-socketio.error.log:

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/frappe/frappe-bench/apps/frappe/node_modules/@redis/client/dist/index.js:18:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
/home/frappe/frappe-bench/apps/frappe/node_modules/@redis/client/dist/lib/client/index.js:35
            modules: extensions?.modules,
                                ^

supervisor.conf:

frappe@eprv15:~/frappe-bench/config$ cat supervisor.conf 
; Notes:
; priority=1 --> Lower priorities indicate programs that start first and shut down last
; killasgroup=true --> send kill signal to child processes too

; graceful timeout should always be lower than stopwaitsecs to avoid orphan gunicorn workers.
[program:frappe-bench-frappe-web]
command=/home/frappe/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 9 --max-requests 5000 --max-requests-jitter 500 -t 120 --graceful-timeout 30 frappe.app:application --preload
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/web.log
stderr_logfile=/home/frappe/frappe-bench/logs/web.error.log
stopwaitsecs=40
killasgroup=true
user=frappe
directory=/home/frappe/frappe-bench/sites

[program:frappe-bench-frappe-schedule]
command=/usr/local/bin/bench schedule
priority=3
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/schedule.log
stderr_logfile=/home/frappe/frappe-bench/logs/schedule.error.log
user=frappe
directory=/home/frappe/frappe-bench



[program:frappe-bench-frappe-short-worker]
command=/usr/local/bin/bench worker --queue short,default
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/worker.log
stderr_logfile=/home/frappe/frappe-bench/logs/worker.error.log
user=frappe
stopwaitsecs=360
directory=/home/frappe/frappe-bench
killasgroup=true
numprocs=1
process_name=%(program_name)s-%(process_num)d

[program:frappe-bench-frappe-long-worker]
command=/usr/local/bin/bench worker --queue long,default,short
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/worker.log
stderr_logfile=/home/frappe/frappe-bench/logs/worker.error.log
user=frappe
stopwaitsecs=1560
directory=/home/frappe/frappe-bench
killasgroup=true
numprocs=1
process_name=%(program_name)s-%(process_num)d





[program:frappe-bench-redis-cache]
command=/usr/bin/redis-server /home/frappe/frappe-bench/config/redis_cache.conf
priority=1
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/redis-cache.log
stderr_logfile=/home/frappe/frappe-bench/logs/redis-cache.error.log
user=frappe
directory=/home/frappe/frappe-bench/sites

[program:frappe-bench-redis-queue]
command=/usr/bin/redis-server /home/frappe/frappe-bench/config/redis_queue.conf
priority=1
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/redis-queue.log
stderr_logfile=/home/frappe/frappe-bench/logs/redis-queue.error.log
user=frappe
directory=/home/frappe/frappe-bench/sites



[program:frappe-bench-node-socketio]
command=/usr/bin/node /home/frappe/frappe-bench/apps/frappe/socketio.js
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/node-socketio.log
stderr_logfile=/home/frappe/frappe-bench/logs/node-socketio.error.log
user=frappe
directory=/home/frappe/frappe-bench


[group:frappe-bench-web]
programs=frappe-bench-frappe-web,frappe-bench-node-socketio




[group:frappe-bench-workers]
programs=frappe-bench-frappe-schedule,frappe-bench-frappe-short-worker,frappe-bench-frappe-long-worker




[group:frappe-bench-redis]
programs=frappe-bench-redis-cache,frappe-bench-redis-queue

bench --version: 5.20.0
node -v: v18.19.0

I am trying to get v15 up and running different way and servers/VMs, but everywhere the same error.
any ideas, how to fix this?

br
Andreas

me have same issue

/frappe-bench$ sudo supervisorctl restart all
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-redis:frappe-bench-redis-cache: stopped
frappe-bench-redis:frappe-bench-redis-queue: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-web:frappe-bench-node-socketio: ERROR (spawn error)
frappe-bench-redis:frappe-bench-redis-cache: started
frappe-bench-redis:frappe-bench-redis-queue: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started

frappe-bench-web:frappe-bench-node-socketio: ERROR (spawn error)

killall -9 node will terminate the process, and then you can run
supervisorctl restart all

:~/frappe-bench$ killall -9 node
node: no process found

Can you do one for k8s using helm charts?

1 Like

This helped me:

$ bench doctor
$ bench update --requirements
$ bench setup socketio
$ bench setup redis
$ bench retry-upgrade
$ sudo supervisorctl restart
$ sudo service nginx restart>

br
Andreas

2 Likes

Hey everyone,

Made a simple install script with prompts and stuff…
Enjoy!

1 Like

On

bench new-site --verbose site1.local

I get the below error

Created user _b533f5fdd65aaf8c
Created database _b533f5fdd65aaf8c
Granted privileges to user _b533f5fdd65aaf8c and database _b533f5fdd65aaf8c
Starting database import...
Imported from database /home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/framework_mariadb.sql
Illegal instruction (core dumped)

I am installing on this on Ubuntu 22.04.4 LTS installed on Virtual Box 7.0 on windows host.

1 Like

If you are on Proxmox VM Ubuntu then you need to set for CPU that its using HOST so it passes AVX AVX2 instructions from CPU

Hi Dino_M

How can I change avx2 settings ? Can u help me ?

Change it to host under cpu configuration

how do i change it? I don’t use host. It’s a local computer at work.

today i tried this script and it has errors and the installation fails, it needs a revision