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

@Manan_Shah Hahaha that’s very humble of you to call yourself a newbie :stuck_out_tongue_winking_eye:

Thanks for pointing out though, updated it!

I am a newbie for these tasks like Installation :slight_smile:

On a serious note, this is the easiest installation guide I have come across so far. Thanks

1 Like

MariaDB refused to start in Ubuntu 22
Please advise

Please post the error you’re getting. Also, try rebooting the server once and then check MySQL status by service mysql status

Hi! Followed your Ubuntu guide carefully but nothing showed on port 80 web. (Have done similar V14 install on latest Stream and Fedora releases with the same results.)
Here is the error when I bench restart:

$ bench restart
$ supervisorctl restart frappe:
error: <class 'PermissionError'>, [Errno 13] Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py line: 560
ERROR:
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 127, in cli
    bench_command()
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  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 150, in reload
    restart_supervisor_processes(bench_path=self.name, web_workers=web)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py", line 304, in restart_supervisor_processes
    bench.run(f"{sudo}supervisorctl restart {group}")
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 47, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/__init__.py", line 155, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError

try this

Hi, this looks like a user permission issues. I hope you’re running all the commands as the [frappe-user] with sudo.

If you’re still facing issues, follow this to resolve the problem :point_down:t3:

1 Like

@shashank_shirke Thank you. That corrected the problem.

@shashank_shirke - Great guide mate. I think this is probably the first correct guide for version 14 on ubuntu 22.04

I am struggling with installing my positiveSSL on the ERP site, is this something you do as a service?

Hi @CodingRockz

Good to know that you found the guide helpful. Regarding the SSL certificate issue, you’ll first have to first add a custom domain and then enable dns_multitenant on the default site and then install your SSL certificate on the site.

@shashank_shirke This is largely a perfect guide thanks. I followed it and the only error that I encountered is on Mariadb barracuda issue.

It is important for the settings to be taken to /etc/mysql/mariadb.conf.d/mariadb.cnf instead of /etc/mysql/my.cnf.

That is the only change I did and it worked.

for me the mentioned one in the guide worked.

Hello Shashank!
Thank you so much for this guide. Recently I was able to install v13 with my own collected infos, but I never got to work production mode or the correct creation of PDF files.
I used your guide to install a new VM. I have a Proxmox server and I used the LXC Ubuntu 22.04 template.
Everything installed fine and it is much better than my own install guide.
I have one remaining issue: When i create an offer and I want to create&download the offer-PDF-file, then the PDF is zoomed in and the outer edges of the page are missing.
Do you have an idea how to solve this?
Thank you very much for your work!
Edit: It might be this bug:

Hi @mwogi

Thanks for the update on this. Some installations might require additional configuration to be done in MariaDB cnf files as well. This was required in v13 but for v14 I tried with just the my.cnf file and it did work.

But I understand some server images and packages repos are different and so might require additional configs. Thanks for updating this.

Also, please do share the exact config you used in the mariadb.cnf file so that it will be helpful for others facing this issue.

Hi @DrSchnagels

Great to know that you found the guide useful. As for the PDF generation issue, this has been reported in the past as well.

Can you confirm what version of wkhtmltopdf have you installed by running;

wkhtmltopdf --version

Also, if possible share a screenshot of a sample PDF file that you’re facing issues with.

this is my output:
Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.39-3-pve x86_64)
wkhtmltopdf 0.12.6


Hi!
Can you help me understand why there is two times a
“sudo bench setup production [frappe-user]”
in 7.3 and 7.5 ?
Thanks!

@shashank_shirke the link you attached worked. Thank you!

This is just to make sure that the NGINX config file is created correctly. Sometimes the NGINX config doesn’t get written correctly the first time so running the command twice ensure that there are no issues.

After some research I got the PDF creation working flawlessly. I found out that the installed version of wkhtmltopdf is the NON-qt-patched version. But the qt-patched version is needed in order to generate correct PDF files from the document preview.

The “sudo apt-get wkhtmltopdf” for Ubuntu 22.04 variant installs the non-qt-patched version. This one does not support the parameter " --disable-smart-shrinking".
Therefor all PDF files are truncated, shrunk, at the edges, even removing logos or text.
The preview is correct, the created pdf file is mistakenly shrunken / cut.

I solved it with these commands:

remove bad version

sudo apt-get remove wkhtmltopdf

download the latest, qt-patched version from the official github

visit wkhtmltopdf website to see for other distros
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb

install correct version with qt-patched and check if it works

sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb
vvv@gggg:~$ wkhtmltopdf -V
wkhtmltopdf 0.12.6.1 (with patched qt)

After this PDF files are correctly generated.
BTW: I tried to do “sudo bench install wkhtmltopdf” but this only threw errors at the end.

6 Likes