ERPNext with Ubuntu 18.04.3 Server

“Works on Ubuntu 16.04+, CentOS 7+, Debian 8+”

That said for sure YMMV so check the forum for help details say for eg Error on ERPNext - Ubuntu 18.04 LTS Installation - #62 by Ankeamx

The easy installation script does not seem to end without errors on the latest versions of Ubuntu, sadly. :frowning:

Hello, should with manual work without problems?
Last Updated: October 22, 2019:

It looks easier for me and it is a newer tutorial.

Problem speedysense 01:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/
sudo tar -xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -C /opt`

Change to:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

Check:

wkhtmltopdf -V
wkhtmltopdf 0.12.4 (with patched qt)

save jannis

Now: Step 9 Install and Create Virtual Environment

Step 12 Get ERPNext Apps

Problem speedysense 02:

    bench get-app --branch master erpnext https://github.com/frappe/erpnext.git
INFO:bench.app:getting app erpnext
INFO:bench.utils:git clone https://github.com/frappe/erpnext.git --branch master --depth 1 --origin upstream
fatal: destination path 'erpnext' already exists and is not an empty directory.
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/jannis/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jannis/erpnext/bench-repo/bench/commands/make.py", line 42, in get_app
    get_app(git_url, branch=branch, skip_assets=skip_assets)
  File "/home/jannis/erpnext/bench-repo/bench/app.py", line 125, in get_app
    cwd=os.path.join(bench_path, 'apps'))
  File "/home/jannis/erpnext/bench-repo/bench/utils.py", line 173, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git clone https://github.com/frappe/erpnext.git --branch master --depth 1 --origin upstream

How can i solved this problem?

jannis

I think that you should use version-12 as branch in place of master

bench init --frappe-branch version-12 --frappe-path https://github.com/frappe/frappe.git frappe-bench

Try starting over and use the steps detailed here:

Both the manual and easy install methods were broken and this is at least one well tested way to get a server running.

As always… Your mileage may vary… :sunglasses:

BKM

Hello bkm, at which step should start again with my installation?

Is " Step 9 Install and Create Virtual Environment" ok?

No, I would re-install the VPS operating system and begin again from a clean server. I would not use the instructions at SpeedySense because they were written at a time when the install process was more stable.

Since the publishing of those instructions much has changed. So I recommend getting your OS clean and fresh, then use the instructions in my link to do the install from scratch.

The only thing I would add would be to do the

apt-get update
apt-get upgrade

Do those 2 commands from the root directory before you create the new user in my instructions. The instructions I linked to have been successfully run as late as this morning, so you have a very good chance of finding success today.

NOTE Even in the instructions that I linked, you will encounter errors but they are explained in the post and you have additional instructions for getting past the errors to a successful server.

BKM

New fresh Ubuntu 18.04.3 LTS install.

Tutorial bkm, link therefore.
httxx://discuss.frappe.io/t/error-on-erpnext-ubuntu-18-04-lts-installation/54961/31

def_user@ubu:~$ wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
--2020-01-10 16:20:42--  https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.12.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.12.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14831 (14K) [text/plain]
Saving to: ‘install.py.2’

install.py.2              100%[==================================>]  14,48K  --.-KB/s    in 0,03s   

2020-01-10 16:20:42 (447 KB/s) - ‘install.py.2’ saved [14831/14831]

def_user@ubu:~$ sudo -H python3 install.py –production –user [def_user]
usage: install.py [-h] [--develop | --production] [--site SITE]
                  [--without-site] [--verbose] [--user USER]
                  [--bench-branch BENCH_BRANCH] [--repo-url REPO_URL]
                  [--frappe-repo-url FRAPPE_REPO_URL]
                  [--frappe-branch FRAPPE_BRANCH]
                  [--erpnext-repo-url ERPNEXT_REPO_URL]
                  [--erpnext-branch ERPNEXT_BRANCH] [--without-erpnext]
                  [--version VERSION] [--overwrite]
                  [--mysql-root-password MYSQL_ROOT_PASSWORD]
                  [--mariadb-version MARIADB_VERSION]
                  [--admin-password ADMIN_PASSWORD] [--bench-name BENCH_NAME]
                  [--container]
install.py: error: unrecognized arguments: –production –user [def_user]
def_user@ubu:~$

Where is my mistake?

The mistake was in the arguments for the install.py command. When I typed them into the forum it combined the double dashes into a single long dash

The command should look like this

sudo -H python3 install.py --production --user [def_user]

And then you must change [def_user] to whatever username you created with the “adduser” command. So for example, if you did this:

adduser jannnis

then your command would look like this:

sudo -H python3 install.py --production --user jannis

The instructions state to create the new user and give it sudo access. That would look like this:

adduser jannis
usermod -aG sudo jannis

Then to logout out of the server and log back in as the new user, in this case jannis.

Then start using all of the commands.

Anytime you see in my example commands something in brackets [like_this] it meas that you substitute your information there. Just like in the [def_user] gets replaces with jannis.

Hope this helps.

BKM

Hello bkm, your turorial have little mistake:
Wrong:
sudo -H python3 install.py –production –user [def_user]

Right:
sudo -H python3 install.py --production --user [def_user]

In my jannis case:
sudo -H python3 install.py --production --user def_user

My defaultuser is now “def_user”

def_user for defaultuser with sudo right.

Can i use a ssh connection to install ERPNext without problems?

Thank you

Yes. Connect as the def_user.

BKM

NOTE - I will try to edit the original instructions again. My browser and the forum evidently do not agree with each other on how dashes are supposed to be included. I will use a different browser to try to do the edits.

def_user@ubu:~$ sudo -H python3 install.py --production --user def_user
[sudo] password for def_user: 
Logs are saved under /tmp/logs/easy-install__2020-01-10__17-12.log
Checking System Compatibility...
ubuntu 18 is compatible!
Bench's CLI needs these to be defined!
Run the following commands in shell: 
export LC_ALL=C.UTF-8
def_user@ubu:~$ export LC_ALL=C.UTF-8
def_user@ubu:~$

Next Step:

def_user@ubu:~$ cd /tmp/.bench/playbooks/roles/nodejs/tasks
-bash: cd: /tmp/.bench/playbooks/roles/nodejs/tasks: No such file or directory
def_user@ubu:~$

How get i “bench” and “nodesjs” with your tutorial?
httxx://discuss.frappe.io/t/error-on-erpnext-ubuntu-18-04-lts-installation/54961/31

The problem was that your edition of Ubuntu needed the UTF-8 adjustment. So after you ran:

def_user@ubu:~$ export LC_ALL=C.UTF-8

Your actual next step would be to restart the install command. The error was warning you that the install could not continue unless the UTF-8 adjustment was made. So after performing the suggested command you need to re-reun the install command:

sudo -H python3 install.py --production --user def_user

Then you will be caught up again.

BKM

1 Like

Very important! ```
export LC_ALL=C.UTF-8

**

> The problem was that your edition of Ubuntu needed the UTF-8 adjustment. 

**

    def_user@ubu:~$ sudo -H python3 install.py --production --user def_user
    Logs are saved under /tmp/logs/easy-install__2020-01-10__17-24.log
    Checking System Compatibility...
    ubuntu 18 is compatible!
    curl already installed!
    wget already installed!
    git already installed!
    pip3 already installed!
     [WARNING]: No inventory was parsed, only implicit localhost is available
     [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
    localhost does not match 'all'
    Input MySQL and Frappe Administrator passwords:
    Passwords saved at ~/passwords.txt
     [WARNING]: No inventory was parsed, only implicit localhost is available
     [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
    localhost does not match 'all'
     [WARNING]: Could not find aptitude. Using apt-get instead

    [WARNING]: Consider using the get_url or uri module rather than running 'curl'.  If you need to use
    command because get_url or uri is insufficient you can add 'warn: false' to this command task or set
    'command_warnings=False' in ansible.cfg to get rid of this message.
    [DEPRECATION WARNING]: evaluating [] as a bare variable, this behaviour will go away and you might 
    need to add |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration 
    toggle.. This feature will be removed in version 2.12. Deprecation warnings can be disabled by 
    setting deprecation_warnings=False in ansible.cfg.
     [WARNING]: Consider using the file module with owner rather than running 'chown'.  If you need to
    use command because file is insufficient you can add 'warn: false' to this command task or set
    'command_warnings=False' in ansible.cfg to get rid of this message.


Must i install aptitude or can i use apt, apt-get?

No need to install aptitude. Let the installation process continue.

BKM

The warning messages that you see are normal. You only need to take action if the process stops.

At this point the process should not stop until it is almost done. If it ends in and error AND that error ends with “exit status 2” then you are still working within the given instructions.

BKM

def_user@ubu:~$ sudo -H python3 install.py --production --user def_user
[sudo] password for def_user: 
Logs are saved under /tmp/logs/easy-install__2020-01-10__17-12.log
Checking System Compatibility...
ubuntu 18 is compatible!
Bench's CLI needs these to be defined!
Run the following commands in shell: 
export LC_ALL=C.UTF-8                                                                                
def_user@ubu:~$ export LC_ALL=C.UTF-8
def_user@ubu:~$ cd /tmp/.bench/playbooks/roles/nodejs/tasks
-bash: cd: /tmp/.bench/playbooks/roles/nodejs/tasks: No such file or directory
def_user@ubu:~$ export LC_ALL=C.UTF-8
def_user@ubu:~$ sudo -H python3 install.py --production --user def_user
Logs are saved under /tmp/logs/easy-install__2020-01-10__17-24.log
Checking System Compatibility...
ubuntu 18 is compatible!
curl already installed!
wget already installed!
git already installed!
pip3 already installed!
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'
Input MySQL and Frappe Administrator passwords:
Passwords saved at ~/passwords.txt
 [WARNING]: No inventory was parsed, only implicit localhost is available
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'
 [WARNING]: Could not find aptitude. Using apt-get instead

 [WARNING]: Consider using the get_url or uri module rather than running 'curl'.  If you need to use
command because get_url or uri is insufficient you can add 'warn: false' to this command task or set
'command_warnings=False' in ansible.cfg to get rid of this message.
[DEPRECATION WARNING]: evaluating [] as a bare variable, this behaviour will go away and you might 
need to add |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration 
toggle.. This feature will be removed in version 2.12. Deprecation warnings can be disabled by 
setting deprecation_warnings=False in ansible.cfg.
 [WARNING]: Consider using the file module with owner rather than running 'chown'.  If you need to
use command because file is insufficient you can add 'warn: false' to this command task or set
'command_warnings=False' in ansible.cfg to get rid of this message.
 [WARNING]: Module remote_tmp /home/def_user/.ansible/tmp did not exist and was created with a mode
of 0700, this may cause issues when running as another user. To avoid this, create the remote_tmp    
dir with the correct permissions manually                                                            
                                                                                                     
Bench + Frappe + ERPNext has been successfully installed!                                            
def_user@ubu:~$

I must wait a very, very, very long time and i had see nothing action.

Next Step:

def_user@ubu:~$ cd /tmp/.bench/playbooks/roles/nodejs/tasks                                          
-bash: cd: /tmp/.bench/playbooks/roles/nodejs/tasks: No such file or directory                       
def_user@ubu:~$
1 Like

Since you did not get the error that ends in “exit status 2” then you can attempt to login to the system ad Administrator.

The “/tmp/.bench/playbooks/roles/nodejs/tasks” is only generated if you get the long error message that ends with “exit status 2”. Since you did not get that, you can attempt to login as administrator.

However, if you run into any problem logging in, then you need to do this part of the instructions before you attempt to login again:

sudo npm install -g yarn
cd frappe-bench
bench update

So far, it looks like you are having better luck than most.

BKM

1 Like

My output:

bench update