How to install OpenERP 7.0 on Ubuntu 12.04 LTS

OpenERP Logo

Introduction

Welcome to the latest of our very popular OpenERP installation “How Tos”.

The new release of OpenERP 7.0 is a major upgrade and a new Long Term Support release; the 7.0 Release Notes extend to over 90 pages! The most noticeable change is a complete re-write of the User Interface that features a much more modern look and feel.

OpenERP 7.0 is not only better looking and easier to use, it also brings many improvements to the existing feature-set and adds a number of brand new features which extend the scope of the business needs covered by OpenERP. Integration of social network capabilities, integration with Google Docs and LinkedIn, new Contract Management, new Event Management, new Point of Sale, new Address Book, new Fleet Management,… are only some of the many enhancements in OpenERP 7.0.

The How To

Following that introduction, I bet you can’t wait to get your hands dirty…

Just one thing before we start: You can simply download a “.deb” package of OpenERP and install that on Ubuntu. Unfortunately that approach doesn’t provide us (Libertus Solutions) with enough fine-grained control over where things get installed, and it restricts our flexibility to modify & customise, hence I prefer to do it a slightly more manual way (this install process below should only take about 10-15 minutes once the host machine has been built).

So without further ado here we go:

Step 1. Build your server

I install just the bare minimum from the install routine (you may want to install the openssh-server during the install procedure or install subsequently depending on your needs).

After the server has restarted for the first time I install the openssh-server package (so we can connect to it remotely) and denyhosts to add a degree of brute-force attack protection. There are other protection applications available: I’m not saying this one is the best, but it’s one that works and is easy to configure and manage. If you don’t already, it’s also worth looking at setting up key-based ssh access, rather than relying on passwords. This can also help to limit the potential of brute-force attacks. [NB: This isn't a How To on securing your server...]

sudo apt-get install openssh-server denyhosts

Now make sure your server has all the latest versions & patches by doing an update:

sudo apt-get update
sudo apt-get dist-upgrade

Although not always essential it’s probably a good idea to reboot your server now and make sure it all comes back up and you can login via ssh.

Now we’re ready to start the OpenERP install.

Step 2. Create the OpenERP user that will own and run the application

sudo adduser --system --home=/opt/openerp --group openerp

This is a “system” user. It is there to own and run the application, it isn’t supposed to be a person type user with a login etc. In Ubuntu, a system user gets a UID below 1000, has no shell (it’s actually /bin/false) and has logins disabled. Note that I’ve specified a “home” of /opt/openerp, this is where the OpenERP server code will reside and is created automatically by the command above. The location of the server code is your choice of course, but be aware that some of the instructions and configuration files below may need to be altered if you decide to install to a different location.

[Note: If you want to run multiple versions of OpenERP on the same server, the way I do it is to create multiple users with the correct version number as part of the name, e.g. openerp70, openerp61 etc. If you also use this when creating the Postgres users too, you can have full separation of systems on the same server. I also use similarly named home directories, e.g. /opt/openerp70, /opt/openerp61 and config and start-up/shutdown files. You will also need to configure different ports for each instance or else only the first will start.]

A question I have been asked a few times is how to run the OpenERP server as the openerp system user from the command line if it has no shell. This can be done quite easily:

sudo su - openerp -s /bin/bash

This will su your current terminal login to the openerp user (the “-” between su and openerp is correct) and use the shell /bin/bash. When this command is run you will be in openerp’s home directory: /opt/openerp.

When you have done what you need you can leave the openerp user’s shell by typing exit.

Step 3. Install and configure the database server, PostgreSQL

sudo apt-get install postgresql

Then configure the OpenERP user on postgres:

First change to the postgres user so we have the necessary privileges to configure the database.

sudo su - postgres

Now create a new database user. This is so OpenERP has access rights to connect to PostgreSQL and to create and drop databases. Remember what your choice of password is here; you will need it later on:

createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
Enter password for new role: ********
Enter it again: ********

Finally exit from the postgres user account:

exit

Step 4. Install the necessary Python libraries for the server

sudo apt-get install python-dateutil python-docutils python-feedparser python-gdata \
python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid \
python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing \
python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject \
python-webdav python-werkzeug python-xlwt python-yaml python-zsi

With that done, all the dependencies for installing OpenERP 7.0 are now satisfied (note that there are some new packages required since 6.1).

Step 5. Install the OpenERP server

I tend to use wget for this sort of thing and I download the files to my home directory.

Make sure you get the latest version of the application: at the time of writing this it’s 7.0. I got the download links from their download pages (note there are also deb, rpm and exe builds in this area too). There isn’t a static 7.0 release tarball as such anymore, but there is a nightly build of the 7.0 source tree which should be just as good and will contain patches as and when things get fixed. The link below is to the source tarball for the 7.0 branch.

Note: As an alternative method of getting the code onto your server, Jerome added a very useful comment showing how to get it straight from launchpad. Thanks!

wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-latest.tar.gz

Now install the code where we need it: cd to the /opt/openerp/ directory and extract the tarball there.

cd /opt/openerp
sudo tar xvf ~/openerp-7.0-latest.tar.gz

Next we need to change the ownership of all the the files to the OpenERP user and group we created earlier.

sudo chown -R openerp: *

And finally, the way I have done this is to copy the server directory to something with a simpler name so that the configuration files and boot scripts don’t need constant editing (I called it, rather unimaginatively, server). I started out using a symlink solution, but I found that when it comes to upgrading, it seems to make more sense to me to just keep a copy of the files in place and then overwrite them with the new code. This way you keep any custom or user-installed modules and reports etc. all in the right place.

sudo cp -a openerp-7.0 server

As an example, should OpenERP 7.0.1 come out soon, I can extract the tarballs into /opt/openerp/ as above. I can do any testing I need, then repeat the copy command so that the modified files will overwrite as needed and any custom modules, report templates and such will be retained. Once satisfied the upgrade is stable, the older 7.0 directories can be removed if wanted.

That’s the OpenERP server software installed. The last steps to a working system is to set up the configuration file and associated boot script so OpenERP starts and stops automatically when the server itself stops and starts.

Step 6. Configuring the OpenERP application

The default configuration file for the server (in /opt/openerp/server/install/) is actually very minimal and will, with only one small change work fine so we’ll simply copy that file to where we need it and change it’s ownership and permissions:

sudo cp /opt/openerp/server/install/openerp-server.conf /etc/
sudo chown openerp: /etc/openerp-server.conf
sudo chmod 640 /etc/openerp-server.conf

The above commands make the file owned and writeable only by the openerp user and group and only readable by openerp and root.

To allow the OpenERP server to run initially, you should only need to change one line in this file. Toward to the top of the file change the line db_password = False to the same password you used back in step 3. Use your favourite text editor here. I tend to use nano, e.g.

sudo nano /etc/openerp-server.conf

One other line we might as well add to the configuration file now, is to tell OpenERP where to write its log file. To complement my suggested location below add the following line to the openerp-server.conf file:

logfile = /var/log/openerp/openerp-server.log

Once the configuration file is edited and saved, you can start the server just to check if it actually runs.

sudo su - openerp -s /bin/bash
/opt/openerp/server/openerp-server

If you end up with a few lines eventually saying OpenERP is running and waiting for connections then you are all set.

On my system I noticed the following warning:

2012-12-19 11:53:51,613 6586 WARNING ? openerp.addons.google_docs.google_docs: Please install latest gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list

The Ubuntu 12.04 packaged version of the python gdata client library is not quite recent enough, so to install a more up-to-date version I did the following (exit from the openerp user’s shell if you are still in it first):

sudo apt-get install python-pip
sudo pip install gdata --upgrade

Going back and repeating the commands to start the server resulted in no further warnings

sudo su - openerp -s /bin/bash
/opt/openerp/server/openerp-server

If there are errors, you’ll need to go back and find out where the problem is.

Otherwise simply enter CTL+C to stop the server and then exit to leave the openerp user account and go back to your own shell.

Step 7. Installing the boot script

For the final step we need to install a script which will be used to start-up and shut down the server automatically and also run the application as the correct user. There is a script you can use in /opt/openerp/server/install/openerp-server.init but this will need a few small modifications to work with the system installed the way I have described above. Here’s a link to the one I’ve already modified for 7.0.

Similar to the configuration file, you need to either copy it or paste the contents of this script to a file in /etc/init.d/ and call it openerp-server. Once it is in the right place you will need to make it executable and owned by root:

sudo chmod 755 /etc/init.d/openerp-server
sudo chown root: /etc/init.d/openerp-server

In the configuration file there’s an entry for the server’s log file. We need to create that directory first so that the server has somewhere to log to and also we must make it writeable by the openerp user:

sudo mkdir /var/log/openerp
sudo chown openerp:root /var/log/openerp

Step 8. Testing the server

To start the OpenERP server type:

sudo /etc/init.d/openerp-server start

You should now be able to view the logfile and see that the server has started.

less /var/log/openerp/openerp-server.log

If there are any problems starting the server you need to go back and check. There’s really no point ploughing on if the server doesn’t start…

OpenERP 7 Database Management Screen

OpenERP 7 Database Management Screen

If the log file looks OK, now point your web browser at the domain or IP address of your OpenERP server (or localhost if you are on the same machine) and use port 8069. The url will look something like this:

http://IP_or_domain.com:8069

What you should see is a screen like this one (it is the Database Management Screen because you have no OpenERP databases yet):

What I do recommend you do at this point is to change the super admin password to something nice and strong (Click the “Password” menu). By default this password is just “admin” and knowing that, a user can create, backup, restore and drop databases! This password is stored in plain text in the /etc/openerp-server.conf file; hence why we restricted access to just openerp and root. When you change and save the new password the /etc/openerp-server.conf file will be re-written and will have a lot more options in it.

Now it’s time to make sure the server stops properly too:

sudo /etc/init.d/openerp-server stop

Check the logfile again to make sure it has stopped and/or look at your server’s process list.

Step 9. Automating OpenERP startup and shutdown

If everything above seems to be working OK, the final step is make the script start and stop automatically with the Ubuntu Server. To do this type:

sudo update-rc.d openerp-server defaults

You can now try rebooting you server if you like. OpenERP should be running by the time you log back in.

If you type ps aux | grep openerp you should see a line similar to this:

openerp 1491 0.1 10.6 207132 53596 ? Sl 22:23 0:02 python /opt/openerp/server/openerp-server -c /etc/openerp-server.conf

Which shows that the server is running. And of course you can check the logfile or visit the server from your web browser too.

OpenERP 70 Main Setup Screen

OpenERP 70 Main Setup Screen

That’s it! Next I would suggest you create a new database filling in the fields as desired. Once the database is initialised, you will be directed straight to the new main configuration screen which gives you a fell for the new User Interface in OpenERP 7 and shows you how easy it is to set up a basic system.

Tags: , , ,

413 Comments

  • Salil Kalghatgi says:

    dude awesome! funny enough i just finished running through your 6.1 how-to using 1204lts. and openerp just relaunched their website. good time to learn i guess. I’m not sure how 7.0 is treating ecommerce integration, but i’ve always been wary of their “copy and paste a couple lines of html” in the old manua,l hopefully they update documentation soon.
    cheers

  • moula says:

    Thank you very much
    Good work.

  • fab says:

    Thanks a lot. Very useful.

  • Jay Vora says:

    Excellent as always, Alan Lord Style!!!

  • Paul says:

    Plenty in time!!!
    Why you do not give a guide also for the upgrade? For example, from 6.1 to 7.0…

  • wong says:

    thanks a bunch!

  • Vardan says:

    A very Useful Blog

  • John says:

    Tried it but at some stage “sudo su – postgres” I am asked for openerp paswoord. Tried my system psw and it didn’t worked. Stucked.

  • Alan Lord says:

    That command is expecting *your* password – you must have sudo access.

  • Michel Tomas says:

    Really great. Followed your instructions, now our small company can start using its first ERP.
    Many thanks !! Take care !!!

  • Miguel says:

    Awesome tutorial. I follow all the steps and got it installed. The only thing is that while configurating it, I got the message “Database not ready. Currently, this database is not fully loaded and can not be used” at the time of installing email-gateway module. Of course, after installing it, is not working so I couldn’t configure incoming email servers. I don’t find any info related to this issue. Should I change the files of this module?? Thanks

  • S Widmer says:

    @john – Alan is correct, as I had a similar issue, what you might not have noticed was that you may still be in the openerp user shell you created a few steps back. Make sure you exit all shell back to you own.

  • mkchris says:

    Everything works fantastically till step 6 but openerp will not start with the boot script. Any help?

  • Jerome says:

    For installing latest Openerp Version you can dowload it directly in lauchnpad
    in step 5
    replace Wget command by :

    sudo apt-get install bzr
    sudo su - openerp
    cd /opt/openerp
    bzr branch lp:openobject-server/7.0 server
    bzr branch lp:openobject-addons/7.0 addons
    bzr branch lp:openerp-web/7.0 web

    • Alan Lord says:

      Thanks for adding this.

    • If you created a user using
      sudo adduser --system --home=/opt/openerp --group openerp
      as mentioned in steps above, then you will need to switch to openerp user using:
      sudo su - openerp -s /bin/bash

    • Iveen says:

      When I try to do the bzr branch, I got a public key error …

      • rolandog says:

        You must have your OpenPGP and SSH keys integrated into your launchpad account; I think you might have set your launchpad-login … so now you’ve gotta do it the hard way … check the comment I left below, I had the same issue you had.

    • Ted Kitch says:

      This does get you the latest version, but downloading the branch via bzr is so much slower. If you are in a hurry, I would download OpenERP via the instructions given in the main article.

    • rolandog says:

      Alas, it took me too much time to find the bugs, but I managed to bypass two different hurdles that prevented me! The first one was the lack of an OpenPGP key in my Launchpad account when I set my launchpad-login:

      openerp@rolandog-HP-Notebook:~$ bzr launchpad-login rolandog

      When I attempted to create an OpenPGP key, I got the error “Couldn’t generate PGP key” and “General error”. This was solved by changing the ownership and group of the ~/.gnupg folder and its files:

      rolandog@rolandog-HP-Notebook:~$ sudo chown -R rolandog .gnupg
      rolandog@rolandog-HP-Notebook:~$ sudo chgrp -R rolandog .gnupg

      After attempting to use bzr branch, I had the following error:
      openerp@rolandog-HP-Notebook:~$ bzr branch lp:openobject-addons/7.0 addons
      The authenticity of host 'bazaar.launchpad.net (91.189.95.84)' can't be established.
      RSA key fingerprint is 9d:38:3a:63:b1:d5:6f:c4:44:67:53:49:2e:ee:fc:89.
      Are you sure you want to continue connecting (yes/no)? y
      Please type 'yes' or 'no': yes
      Warning: Permanently added 'bazaar.launchpad.net,91.189.95.84' (RSA) to the list of known hosts.
      Permission denied (publickey).
      ConnectionReset reading response for 'BzrDir.open_2.1', retrying
      Permission denied (publickey).
      bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

      So, I had to greate an SSH key (and import it in Launchpad) for the openerp user

      openerp@rolandog-HP-Notebook:~$ ssh-keygen -t rsa
      Generating public/private rsa key pair.
      Enter file in which to save the key (/opt/openerp/.ssh/id_rsa):
      Enter passphrase (empty for no passphrase):
      Enter same passphrase again:
      Your identification has been saved in /opt/openerp/.ssh/id_rsa.
      Your public key has been saved in /opt/openerp/.ssh/id_rsa.pub.

      After importing this key in launchpad, everything worked like a charm:

      openerp@rolandog-HP-Notebook:~$ bzr branch lp:openobject-addons/7.0 addonsEnter passphrase for key '/opt/openerp/.ssh/id_rsa':

      • rolandog says:

        Also, it is worth mentioning that the command to run OpenERP, using Jerome’s method of pulling the code is:
        openerp@rolandog-HP-Notebook:~$ /opt/openerp/server/openerp-server --addons-path=/opt/openerp/addons,/opt/openerp/web/addons

  • Sergio Fabbrini says:

    Hi.
    Thanks for your instruction. I have a little queston: how can I modify the “openerp” user in order to let me access the system through ssh? When I try to connect it ask me the password, but it’s not the same I choose for the user…
    Thanks in advance for your reply.

    • Alan Lord says:

      You shouldn’t need to modify the openerp user.

      ssh to the server as *you* (a normal user that has sudo rights) and then use the commands described in the post to su to the openerp user.

      • Sergio Fabbrini says:

        Yes, I know that, but I need to develope some modules for openerp (running in a server) and opening a remote folder logged as a ssh user of the system will help me a lot. In this way I could modify the files without set permission or make the packages and install. Hope you understand.
        Thanks.

  • Hi!

    Thanks for this great tutorial :)

    I have followed your instructions, but I have changed the path as you suggested in the text to /opt/openerp-test/ and when I try to execute this errors happends:
    2012-12-29 11:07:28,868 7828 INFO ? openerp: OpenERP version 7.0alpha
    2012-12-29 11:07:28,868 7828 INFO ? openerp: addons paths: /opt/openerp-test/server/openerp/addons
    2012-12-29 11:07:28,868 7828 INFO ? openerp: database hostname: localhost
    2012-12-29 11:07:28,868 7828 INFO ? openerp: database port: 5432
    2012-12-29 11:07:28,868 7828 INFO ? openerp: database user: openerp-test
    2012-12-29 11:07:28,869 7828 WARNING ? openerp.modules.module: module web: module not found
    2012-12-29 11:07:28,870 7828 CRITICAL ? openerp.modules.module: Couldn’t load module web
    2012-12-29 11:07:28,870 7828 CRITICAL ? openerp.modules.module: unsupported operand type(s) for +: ‘bool’ and ‘str’
    2012-12-29 11:07:28,870 7828 ERROR ? openerp.service: Failed to load server-wide module `web`.
    The `web` module is provided by the addons found in the `openerp-web` project.
    Maybe you forgot to add those addons in your addons_path configuration.
    Traceback (most recent call last):
    File “/opt/openerp-test/server/openerp/service/__init__.py”, line 59, in load_server_wide_modules
    openerp.modules.module.load_openerp_module(m)
    File “/opt/openerp-test/server/openerp/modules/module.py”, line 403, in load_openerp_module
    zip_mod_path = mod_path + ‘.zip’
    TypeError: unsupported operand type(s) for +: ‘bool’ and ‘str’
    2012-12-29 11:07:28,870 7828 WARNING ? openerp.modules.module: module web_kanban: module not found
    2012-12-29 11:07:28,870 7828 CRITICAL ? openerp.modules.module: Couldn’t load module web_kanban
    2012-12-29 11:07:28,870 7828 CRITICAL ? openerp.modules.module: unsupported operand type(s) for +: ‘bool’ and ‘str’
    2012-12-29 11:07:28,870 7828 ERROR ? openerp.service: Failed to load server-wide module `web_kanban`.
    Traceback (most recent call last):
    File “/opt/openerp-test/server/openerp/service/__init__.py”, line 59, in load_server_wide_modules
    openerp.modules.module.load_openerp_module(m)
    File “/opt/openerp-test/server/openerp/modules/module.py”, line 403, in load_openerp_module
    zip_mod_path = mod_path + ‘.zip’
    TypeError: unsupported operand type(s) for +: ‘bool’ and ‘str’
    2012-12-29 11:07:28,871 7828 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8069
    2012-12-29 11:07:28,872 7828 INFO ? openerp: OpenERP server is running, waiting for connections…
    2012-12-29 11:07:40,968 7828 INFO ? werkzeug: 127.0.0.1 – - [29/Dec/2012 11:07:40] “GET / HTTP/1.1″ 404 -
    2012-12-29 11:07:41,659 7828 INFO ? werkzeug: 127.0.0.1 – - [29/Dec/2012 11:07:41] “GET / HTTP/1.1″ 404 -
    2012-12-29 11:07:41,902 7828 INFO ? werkzeug: 127.0.0.1 – - [29/Dec/2012 11:07:41] “GET / HTTP/1.1″ 404 -

    I supose I have to change somewhere a path, and I think this could be usefull for other readers of your blog. Do you have any idea about what I have did bad?

    Thank you!

    • Alan Lord says:

      You will need to add a valid addons_path line in your openerp-server.conf file.

      • It took some time to find the correct answer, but here it is: /opt/openerp-test/server/openerp-server –addons-path=/opt/openerp-test/addons,/opt/openerp-test/web/addons

        Or add in the config file this line: addons-path=/opt/openerp-test/addons,/opt/openerp-test/web/addons

        • Eddie says:

          Its weird, if you wanna put addons path on the config file you gotta use an underscore. So, I reckon its gotta be

          addons_path = /opt/openerp-test/addons,/opt/openerp-test/web/addons

          instead.

  • EYAM says:

    hi, Thanks for this tutorial
    I also had a similiar error. I used openerp70, I also have openerp 6, up there you wrote [You will also need to configure different ports for each instance or else only the first will start.] how to do this, I got this error:
    sudo su – openerp70 -s /bin/bash
    /opt/openerp70/server/openerp-server

    2012-12-30 06:30:43,795 3140 INFO ? openerp: OpenERP version 7.0alpha-20121206-000102
    2012-12-30 06:30:43,796 3140 INFO ? openerp: addons paths: /opt/openerp70/server/openerp/addons
    2012-12-30 06:30:43,796 3140 INFO ? openerp: database hostname: localhost
    2012-12-30 06:30:43,796 3140 INFO ? openerp: database port: 5432
    2012-12-30 06:30:43,797 3140 INFO ? openerp: database user: openerp70
    Traceback (most recent call last):
    File “/opt/openerp70/server/openerp-server”, line 5, in
    openerp.cli.main()
    File “/opt/openerp70/server/openerp/cli/__init__.py”, line 42, in main
    o.run(args)
    File “/opt/openerp70/server/openerp/cli/server.py”, line 273, in run
    main(args)
    File “/opt/openerp70/server/openerp/cli/server.py”, line 259, in main
    openerp.service.start_services()
    File “/opt/openerp70/server/openerp/service/__init__.py”, line 83, in start_services
    netrpc_server.init_servers()
    File “/opt/openerp70/server/openerp/service/netrpc_server.py”, line 165, in init_servers
    int(tools.config.get(‘netrpc_port’, 8070)))
    File “/opt/openerp70/server/openerp/service/netrpc_server.py”, line 110, in __init__
    self.socket.bind((self.__interface, self.__port))
    File “/usr/lib/python2.7/socket.py”, line 224, in meth
    return getattr(self._sock,name)(*args)
    socket.error: [Errno 98] Address already in use

    • Alan Lord says:

      Port numbers are all configured in the .conf files.

      • PSTS says:

        Hello Alan,

        As per you statement “You will also need to configure different ports for each instance or else only the first will start.” you clarify that ports must be changed in order to allow both openerp instances to launch, but what is the right option to be changed in the .conf files? which port must be set for each instance? a specific port or random one?

        Thanks!

  • Abdul says:

    Awesome Awesome tutorial. When I reached step 6 to execute and start the openerp server, I got 2 errors:
    line 2: import: command not found
    line 8: syntax error: unexpected end of file

    Can you gudie me on how to resolve this? I am very much a newbie in linux and openerp. I had changed the user name and directory names to openerp70 instead of just openerp to keep the older version running on the same server. Thanks very much in advance.

    • Abdul says:

      I’m sorry this was such a stupid mistake! I typed those two command lines in one line as one command instead of two:

      sudo su – openerp -s /bin/bash
      /opt/openerp/server/openerp-server

  • priyanka says:

    2013-01-01 21:01:32,269 3657 INFO ? openerp: OpenERP version 7.0-20121231-000812
    2013-01-01 21:01:32,270 3657 INFO ? openerp: addons paths: /home/sysnova/workspace/server7/openerp/addons
    2013-01-01 21:01:32,270 3657 INFO ? openerp: database hostname: localhost
    2013-01-01 21:01:32,270 3657 INFO ? openerp: database port: 5432
    2013-01-01 21:01:32,270 3657 INFO ? openerp: database user: sysnova
    2013-01-01 21:01:32,909 3657 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8069
    2013-01-01 21:01:32,910 3657 INFO ? openerp: OpenERP server is running, waiting for connections…
    2013-01-01 21:01:57,598 3657 INFO postgres werkzeug: 127.0.0.1 – - [01/Jan/2013 21:01:57] “GET / HTTP/1.1″ 200 -
    2013-01-01 21:01:57,644 3657 INFO postgres werkzeug: 127.0.0.1 – - [01/Jan/2013 21:01:57] “GET /web/webclient/css HTTP/1.1″ 304 -
    2013-01-01 21:01:58,264 3657 INFO postgres werkzeug: 127.0.0.1 – - [01/Jan/2013 21:01:58] “GET /web/webclient/js HTTP/1.1″ 304 -

    server is running.But i could n’t see anything in browser.What can i do??

    • Christian says:

      Hello priyanka!

      I face the same problem. It seems to be an issue caused by the server system but I didn’t found any solution yet. If you found out more please let me know.

      Thanks!

  • Max says:

    Everything install and run perfectly when I use

    sudo su – openerp -s /bin/bash
    /opt/openerp/server/openerp-server

    but error 500 occur when i use
    sudo /etc/init.d/openerp-server start

    How to configure correctly?

    Thanks.

    • Max says:

      The error message are shown below:

      OSError: [Errno 13] Permission denied: ‘/tmp/oe-sessions-root/tmpmAQro4.__wz_sess’

      • Max says:

        ok, i got it correctly by using
        “service openerp-server start” to start it rather using
        “sudo /etc/init.d/openerp-server start”

        • Alan Lord says:

          That command syntax shouldn’t make any difference at all.

          I suspect that you had run OpenERP as root (or another user) at some point and hence those session files stored in /tmp were owned by root (or the other user). After a reboot these would have been removed so the system will then start as normal.

          • gabrielcz says:

            yes it mothers!!
            running as “sudo service openerp-server start” solved my problem! Thanks!

  • Alec says:

    Thanks Alan,
    Unfortunately I did not have luck this time around. Everything went smoothly until step 6 where I was trying to copy server configuration file. I received no such a directory message. a check through openerp directory, I realised that there is no server folder. I repeated the whole steps but still step 5 cannot configure server. shed some light on what i am doing wrong. thank you

  • Raul says:

    Hi,

    server is running ok in my pc but when i try to access via web browser i only see “No handler found” when i use http://127.0.0.1:8069, if i use http://127.0.0.1:8070 is impossible to connect.

    Can you say me why?

    Thanks in advance and best regards

  • Raul says:

    OK, its solucionated, i only have to reboot.

  • Jan says:

    I have a problem at this point… At the end of the step 6, see that it appears an error how this:

    bassman@ubuntu:/opt/openerp$ sudo su – openerp -s /bin/bash /opt/openerp/openerp-7.0-20130103-002220/openerp-server
    No protocol specified
    No protocol specified
    import: unable to open X server `:0′ @ error/import.c/ImportImageCommand/366.
    /opt/openerp/openerp-7.0-20130103-002220/openerp-server: line 8: Syntactic error: it did not expect the end of the file

    (the directory server corresponds to *openerp-7.0-20130103-002220)

    Which is the problem that I’ve to solve?

  • Jan says:

    The file/script openerp-server is:

    #!/usr/bin/env python
    import openerp

    if __name__ == “__main__”:
    openerp.cli.main()

    # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

    Is that correct?

  • Rod says:

    whit commad sudo /etc/init.d/openerp-server start …server does not start.But whit sudo su – openerp -s /bin/bash
    /opt/openerp/server/openerp-server it is start…

    but i want automatic…what im doing wrong??

  • Steven says:

    Great Tutorial….I had use earlier tutorials from the theopensourcerer for my v6.1 install.

    Looking forward to:

    How to: OpenERP 7.0, Ubuntu 12.04 LTS, nginx SSL Reverse Proxy
    How to: OpenERP 7.0 Migration from v6.x

    Thanks,

    Steven

  • John says:

    Hi,

    I installed openERP 7 on same Ubuntu server (12 x64) which contains other 4 instances of openERP 6.1 but i get errors when starting openERP 7 server. Any thoughts ??
    Other instances of openERP 6.1 are working ok.

    Error:

    “2013-01-04 17:24:51,084 1821 CRITICAL ? openerp.modules.module: Couldn’t load module web
    2013-01-04 17:24:51,084 1821 CRITICAL ? openerp.modules.module: No module nam ed unittest2
    2013-01-04 17:24:51,084 1821 ERROR ? openerp.service: Failed to load server-w ide module `web`.
    The `web` module is provided by the addons found in the `openerp-web` project .
    Maybe you forgot to add those addons in your addons_path configuration.
    Traceback (most recent call last):
    File “/opt/oedemo7/openerp/openerp/service/_init_.py”, line 59, in load_s erver_wide_modules
    openerp.modules.module.load_openerp_module(m)
    File “/opt/oedemo7/openerp/openerp/modules/module.py”, line 405, in load_op enerp_module”

    error about modules…

    Can anyone help me?
    Thank you in advance!

    John

    • Alan Lord says:

      There are clear messages in the errors you show.

      unittest2 missing and you have an issue with your config file and the addons_path.

      PS: As you are running multiple instances of OpenERP I hope you are using different users, ports, config and script files.

  • Onur Baser says:

    Thanks for this great tutorial and also thanks to Ray Carnes (providing the link from openerp forums) and Jerome for bzr addition.

  • John David says:

    Thank Alan, however I get the following message when I excute this command sudo cp -a openerp-7.0 server

    cp: cannot stat `openerp-7.0′: No such file or directory

    another question, wich particular command create server directory inside openerp directory? i’m a new bie to linux. thank you in advance

    • Alan Lord says:

      That means you do not have a file or directory called openerp-7.0 in the location where you are running that command from.

      The command “cp -a” copies, recursively whilst retaining all permissions etc., the first parameter to the second. So in the case you are referring to it is trying to copy a directory structure called openerp-7.0 to server in the local directory where you are running the command.

      Some other command line tools that might help you:

      ls (list contents of the present working directory)
      pwd (show my present working directory)
      cd [DIR] (change directory to [DIR] – replace [DIR] with the directory path you want to move to.)

      HTH

  • jessica says:

    Thanks for this tutorial Sir,
    I have done smoothly all the 6 steps, however, when I tried to check if my server is actually running, I got this message… what do i need to do? pardon my innocence. :)

    2013-01-10 13:32:38,262 7772 INFO ? openerp: OpenERP version 7.0-20130110-001608
    2013-01-10 13:32:38,262 7772 INFO ? openerp: addons paths: /opt/openerpversion7/server/openerp/addons
    2013-01-10 13:32:38,262 7772 INFO ? openerp: database hostname: localhost
    2013-01-10 13:32:38,262 7772 INFO ? openerp: database port: 5432
    2013-01-10 13:32:38,263 7772 INFO ? openerp: database user: openerpversion7
    2013-01-10 13:32:39,047 7772 WARNING ? openerp.addons.google_docs.google_docs: Please install latest gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list
    2013-01-10 13:32:39,534 7772 INFO ? openerp: OpenERP server is running, waiting for connections…
    Exception in thread Thread-1:
    Traceback (most recent call last):
    File “/usr/lib/python2.7/threading.py”, line 551, in __bootstrap_inner
    self.run()
    File “/usr/lib/python2.7/threading.py”, line 504, in run
    self.__target(*self.__args, **self.__kwargs)
    File “/opt/openerpversion7/server/openerp/service/wsgi_server.py”, line 427, in serve
    httpd = werkzeug.serving.make_server(interface, port, application, threaded=True)
    File “/usr/lib/python2.7/dist-packages/werkzeug/serving.py”, line 399, in make_server
    passthrough_errors, ssl_context)
    File “/usr/lib/python2.7/dist-packages/werkzeug/serving.py”, line 331, in __init__
    HTTPServer.__init__(self, (host, int(port)), handler)
    File “/usr/lib/python2.7/SocketServer.py”, line 408, in __init__
    self.server_bind()
    File “/usr/lib/python2.7/BaseHTTPServer.py”, line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
    File “/usr/lib/python2.7/SocketServer.py”, line 419, in server_bind
    self.socket.bind(self.server_address)
    File “/usr/lib/python2.7/socket.py”, line 224, in meth
    return getattr(self._sock,name)(*args)
    error: [Errno 98] Address already in use

    • Alan Lord says:

      @Jessica,

      You have two issues (at least) in the trace.

      2013-01-10 13:32:39,047 7772 WARNING ? openerp.addons.google_docs.google_docs: Please install latest gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list

      I describe how to fix this one toward the end of step 6.

      The other issue:

      error: [Errno 98] Address already in use

      says that OpenERP can’t bind to it’s port. That probably means you have another instance of OpenERP running in the background (the output of ps aux should show you if it is) or you have a different application already running that is using the same port as OpenERP requires.

  • Jens says:

    Absolute Great tutorial!
    I wonder how to deal with later (nightly builds) openerp 7.x versions coming out?
    Is there any update mechanism you could describe.
    Thx
    Jens

    • Alan Lord says:

      Thanks Jens,

      Updating within a version is fine.

      • Backup
      • Then stop the server
      • update the code (either bzr pull or over-write from a new nightly tarball)
      • then run the openerp-server script with a couple of extra switches:
      • -u all (updates all modules)
      • -d dbname (need to do this for each database)

      Once done you can then restart the server normally.

      • Ciprian says:

        (then run the openerp-server script with a couple of extra switches:) like this sudo service openerp-server restart -u all -d database1 ?

        Plase give me an example with the default configuration from this instal /opt/openerp/server

  • AlanCham says:

    Hi,

    Thank you for your wonderful guide.

    I had follow your guide installing openerp-6.0 and 6.1 in Ubuntu 10.04 successfully. and then i try to install version 7.0 in Ubuntu 10.04, but got error, i checked that unittest2 is used by python-2.7, so i upgrade Ubuntu to version 12.04 and try to install again, it can work.

    Thank you very much.

  • plopplip says:

    Hi, Thank you for this tutorial.

    I have this error error when I want to create the database.

    Client Traceback (most recent call last):
    File "/opt/openerp/server/openerp/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
    File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 728, in create
    params['create_admin_pwd'])
    File "/opt/openerp/server/openerp/addons/web/session.py", line 31, in proxy_method
    result = self.session.send(self.service_name, method, *args)
    File "/opt/openerp/server/openerp/addons/web/session.py", line 98, in send
    raise xmlrpclib.Fault('AccessDenied', str(e))

    Server Access denied.
    Did you have any ideas? Thx

  • Ionel says:

    Hi,

    great guide! I managed successfully to deploy OpenERP by simply following it.

    Thanks a lot!

  • Bernardo says:

    Thanks! I managed to follow your tutorial even not being a linux expert myself. I stumbled a bit on #5 (your suggestion of copying the server files) but besides that everything went smoothly. Now, off to find out how to export my data from 6.1

  • Francismule says:

    Tks the tutorial is good! I’ve installed openerp7 quickly and easy.

    But now i have a trouble when i attempt to update module ad apps. There is a popup that say

    “Apps Server not reachable. Showing local modules.”

    what can i do to fix it ? Tks

    • Bernardo says:

      I believe this is an issue for everyone. For now, you can go to settings>installed modules and remove the filter in the upper right corner. This will show you all the local modules available to install. For external modules I believe you have to go the addons directory way.

  • Francismule says:

    And i have another trouble… in 6.x version there is the possibile to manage multicompany.There is the same in 7 version? I’ve tried the multicompany modules but it seem works wrong.
    let me know how :-)

    tks

  • Ciprian says:

    (then run the openerp-server script with a couple of extra switches:)

    Plase give me an example with the default configuration from this install /opt/openerp/server

    sudo /etc/init.d/openerp-server -u all -d default … or how ?

  • Darco says:

    Why does this tutorial exist? Either three weeks ago the depending packages weren’t existing (possible) or I really don’t know what the author of this was thinking.

    As far as I could see from shortly browsing through this does not cover automatic updates via apt-get. If you really consider using openERP productive this is quite crucial.

    Therefore and because it is much simpler and you for sure don’t forget security relevant settings like the correct user setup you should strongly consider using the official install method (3 steps):

    $ wget http://nightly.openerp.com/7.0/nightly/deb/openerp_7.0-latest-1_all.deb
    $ sudo dpkg -i openerp_7.0-latest-1_all.deb
    $ sudo apt-get install openerp -f

    Ignore warning about dependencies in step two as apt-get will fix (install) them automatically in step 3.

    Depending on your PosgreSQL configuration (if it was already running before the installation) you are already all done and good to go under http://localhost:8069/ (or your IP instead of localhost).
    Otherwise you may need to create the user openerp with the permission to create databases in PosgreSQL (and of course install it if you haven’t already). If you set it up with a password you will need to adjust the openERP config, if openERP is your only application using PosgreSQL and only connections from localhost are allowed (default and recommended) setting the user up with no password is sufficient.

  • Ibru says:

    Hi,
    I installed as per your instruction and it working well, Thank You very much.

    But when I click on Apps/Updates it is giving me following error
    Uncaught TypeError: Cannot read property ‘lang’ of undefined
    http://localhost:8069/web/webclient/js:3031

    Can you please guide me how can I mention addons folder. I couldn’t find any addon folder in server.

    Thanks
    Ibru

  • Hi Alan,

    Just re-posting my issue here and the resolution, as I had by mistake posted it on the how-to for 6.1.
    Hope this helps others.

    Issue:

    Hi Alan,

    Thanks for your comments on LinkedIn for my request for an Idiot’s guide for OpenERP on EC2.
    I do have some updates for you…

    I Crossed the finish line but no trophy yet…

    I executed all the steps mentioned above on an EC2 ubunutu Micro Instance.
    My OpenERP server is running perfectly. The last 2 lines of the log are :

    2013-01-17 19:42:58,382 7016 INFO ? openerp: OpenERP server is running, waiting for connections…
    2013-01-17 19:42:58,384 7016 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8069

    The trouble is:

    I am not able to launch the OpenERP application from my browser. I type these in my address bar:

    http://MyElasticIPGoesHere:8069
    or
    http://http://MyElasticIPGoesHere:8069:8069

    The result for both is that it just does not connect.. Good old Chrome says
    “Oops! Google Chrome could not connect MyElasticIPGoesHere:8069″

    In my AWS console SecurityGroup rules, I have already allowed port 80 for HTTP.
    My AWS security group rules look like this :

    Ports Protocol Source quicklaunch-1
    22 tcp 0.0.0.0/0
    80 tcp 0.0.0.0/0

    I have not mapped my EC2 instance to a load balancer nor have I set up any Autoscaling that is mentioned in the AWS documentation. I’m not able to put the AWS documentation together in my head very well in terms of their settings to simply launch my application from the browser. I am not sure what to do from this point onwards.

    I am new to both AWS and OpenERP. Please could you help me out on this? What am I missing?

    Resolution:

    OK. I just solved the issue myself.. I just had to allow port 8069 as well in my AWS security group.!!!
    How much more stupid could I get…

    My securitygroup rules look like this now.

    Ports Protocol Source quicklaunch-1
    22 tcp 0.0.0.0/0
    80 tcp 0.0.0.0/0
    8069 tcp 0.0.0.0/0

    I can launch using both Elastic IP and the static IP…

    Thanks a lot for your “how-to”. This is a great service to the open source ERP world.. Thank you again from the bottom of my heart.

    Kind Regards,
    Pasha

  • Fede says:

    Nobody had problems adding users?
    The system ask me to setup the email, and dont let me add users (or send invoices by email).
    I made the email setup, and the test told me it works.
    But when I try to add an user, I get a message telling me that I have to setup the email because password cant be sent.
    Any help?

  • felixturcotte says:

    Tank you!!!!!! Appreciate all your work. You could be a very good teacher. Thanks again!

  • Tio says:

    Hi Alan,

    First of all, many thanks for the guidance. I have installed both OpenERRP 6.1 and 7.0 in Ubuntu 12.04 LTS. But I still have problem configuring the port.

    Both log saying OpenERP is running and waiting for connection.
    I can access the OpenERP 6.1 from http://ip-or-domain.com:8069/
    But I can not acces the OpenERP 7.0,

    Should I configure the port in openerp70-server.conf, and what should I set then ?

    Thanks
    Tio

  • john says:

    I have configured 2 version of openerp from your instruction.
    I created openerp70 and openerptrunk user.
    openerp70 is nightly stable source and openerptrunk is bzr update. I changed the init.d file for both with appropriate file path.

    Problem is, when i do /etc/init.d/openerp-server70 start – it works fine.
    when i do /etc/init.d/openerp-server-trunk start – it fails with error in log as “OSError: [Errno 13] Permission denied: ‘/tmp/oe-session-root/tmpay8cc_.__wz_sess’
    For you information, the file oe-session-root has permission 700 and own by openerp70 (i.e the first version of openerp)

    if i delete the oe-session-root and run openerp-server-trunk.. it create files with same permission and own by openerptrunk and runs fine.. but openerp70 unable to start gives internal server error inbrowser.
    i tried stoping one instance and running but it didnt started.. is there is possible to clear the oe-session-root file? or can it be given 777 permission ?

    awaiting your response, thanks for your info.

    • Alan Lord says:

      It sounds like your two instances of OpenERP are trying to run as the same user. You need separate config files with different users (and ideally different postgres users and passwords too).

      You shouldn’t need to touch the /tmp/session files once the system is configured properly. (You might want to delete them and check your process users, config files etc. before starting them again though).

      • john says:

        thanks for reply, but i created two config files for openerp-server70.conf and openerp-server-trunk.conf in /etc. both files owned by respectives users.
        i.e openerp-server70.conf owned by openerp70
        openerp-server-trunk.conf owned by openerp-server-trunk

        i also created different postgres user too. openerp70 and openerptrunk. i changed the port 7069.7070,7071 for openerp70. and 8069…. for openerptrunk. still.. unable to get oe-session-root created by other instance. it the log for openerptrunk says error on permissin failed to access oe-session-root.

        Any hint..

        • john says:

          Alan, i found the workaround.. but strange.. when using /etc/init.d/openerp-server70 start.. it refused to get permission cause oe-session-root is owned by previously started openerp-server-trunk version in /tmp.
          If i do sudo service openerp-server70 start.. this create oe-session-openerp70 with file owned by openerp70.
          either i think i can set the oe-session-root to 777 permisson (or) start each service with “service openerp1,2 start” intead of “/etc/init.d/openerp1,2 start” .

          • john says:

            update: service openerp-server70 start not worked.. it created the oe-session-openerp70 but still the logs shows that it need access to oe-session-root..

            do the script in init.d needs to be owned by root? or it can be owned by openerp70 user?
            I didnt setup script on rc.d cause i dont want openerp server start with ubuntu.
            i like to know Setting permission 777 on oe-session-root will be fine?

          • Alan Lord says:

            You must have something wrong in your config and/or init files. Check them carefully.

            Then remove all of the oe-sessions stuff from /tmp.

            You should NEVER set anything to 777 unless you absolutely know what you are doing and why (or you like being hacked).

            On one of our systems /tmp looks like this:


            drwx------ 2 openerp61 openerp61 4096 2013-01-03 16:26 oe-sessions-openerp61
            drwx------ 2 openerp70 openerp70 20480 2013-01-16 18:03 oe-sessions-openerp70

  • Subhash says:

    Hi Alan,
    The following error shows when installing bzr. I followed the steps of Jerome.Please give me a solution to this.

    sudo apt-get install bzr
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    You might want to run `apt-get -f install’ to correct these:
    The following packages have unmet dependencies:
    bzr: Depends: python-configobj but it is not going to be installed
    Recommends: bzrtools but it is not going to be installed
    Recommends: python-paramiko but it is not going to be installed
    sun-java6-jre: Depends: sun-java6-bin (>= 6.21dlj-0ubuntu1~lucid1~ppa1) but it is not going to be installed or
    ia32-sun-java6-bin (>= 6.21dlj-0ubuntu1~lucid1~ppa1) but it is not installable
    Recommends: gsfonts-x11 but it is not going to be installed
    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

  • GK says:

    Hi Alan,

    I have installed a previous version of OpenERP(6.1) and now I need to install OpenERP 7, but I need them both. Is there any way to install OpenERP 7 without removing 6.1 and also with a different username(not the ‘openerp’ user in step 2). Please help.

  • john says:

    Thanks for replay alan, i searched.. my problem match with the issue at
    https://answers.launchpad.net/openobject-server/+question/196552

    i added openerp1 and openerp2 as defaults in update-rc.d

    then did sudo service openerp1 restart .. now it created write user owned tmp file. and both instance with port 7069 and port 8069 works ok for now.

    • Alan Lord says:

      The issue is that you have started, or are starting, an OpenERP instance as root (hence the name in the /tmp dir – oe-session-root).

      Running multiple instances of OpenERP on the same machine works just fine. We have a development server running OpenERP 5, 6.0, 6.1 and 7 all quite happily. You just have to make sure you get all the configuration right and are consistent about naming so it is easy to work out what is going on.

      The init script provided here, and in previous How Tos, is for Ubuntu. It will start the openerp daemon as the user that is specified on the USER=openerp line. If this doesn’t match everything else it won’t work.

Leave a Reply

XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>