How to Install OpenERP Odoo 8 on Ubuntu Server 14.04 LTS

odoo_logo_rgb

Introduction

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

The new release of Odoo 8.0 is a major upgrade introducing a great many new features and a new name.

Odoo 8.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 Odoo. Ecommerce, CMS, Integrated BI…

Rather than me blathering on about what’s new, you can simply just go and read the release notes here.

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 (for Debian/Ubuntu type systems) or a. rpm (Redhat/CentOS) package of OpenERP and install that. 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).

This time, rather than using a source tarball as the basis for installation we are going to take the code straight from the Odoo 8.0 branch on Github. This should help when it comes to installing updates and bug fixes in the future by being able to issue a git pull command to update the code. Bear in mind before doing a pull request you should always have backups and you may need to update your Odoo database(s) as well.

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

UPDATE: Note that it seems denyhosts is no longer being maintained and is not in the main Ubuntu repository any more. I’m aware of a possibly suitable alternative called fail2ban but have not used it yet; do you own research. Thanks to Rami for the cluebat!

UPDATE2: Thanks to Paul for the pointer. I have added python-unicodecsv to the list of dependencies. Apparently this is required to correctly restore backups.

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 Odoo install.

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

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

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/odoo, 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 Odoo/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/odoo80, /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 Odoo server as the odoo system user from the command line if it has no shell. This can be done quite easily:

sudo su - odoo -s /bin/bash

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

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

Step 3. Install and configure the database server, PostgreSQL

sudo apt-get install postgresql

Then configure the Odoo 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 Odoo 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 odoo
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-cups python-dateutil python-decorator python-docutils python-feedparser \
python-gdata python-geoip python-gevent python-imaging python-jinja2 python-ldap python-libxslt1
python-lxml python-mako python-mock python-openid python-passlib python-psutil python-psycopg2
python-pybabel python-pychart python-pydot python-pyparsing python-pypdf python-reportlab python-requests \
python-simplejson python-tz python-unicodecsv python-unittest2 python-vatnumber python-vobject \
python-werkzeug python-xlwt python-yaml wkhtmltopdf

With that done, all the dependencies for installing Odoo 8.0 are now satisfied (note that there are some changes between this and the packages required for OpenERP 7.0).

UPDATE & NOTE: It has been pointed out to me that the Qweb templating engine in Odoo 8 is warning that the version of wkhtmltopdf is too old. It turns out that Ubuntu 14.04 packages version 0.9.9 of this library even though this is rather old. To update your Ubuntu server please follow the instructions on this page. Many thanks to Ruben Kannan for pointing this out :-).

UPDATE & NOTE II: Zak suggests an alternative method to get and install the most recent version of wkhtmltopdf in this comment below. Thanks Zak.

UPDATE & NOTE III: David suggested adding python-cups and python-geoip to the list of modules to install in this comment below. Thanks David.

Step 5. Install the Odoo server

Install Git.
sudo apt-get install git

Switch to the Odoo user:
sudo su - odoo -s /bin/bash

Grab a copy of the most current Odoo 8 branch (Note the “.” at the end of this command!):
git clone https://www.github.com/odoo/odoo --depth 1 --branch 8.0 --single-branch .
(This might take a little while depending on the speed of your Internet connection.)

Note: Thanks to Ian Beardslee for the cluebat. Have now added --depth 1 to the command so it only retrieves the latest version without all the history. The download is now quite a bit quicker.

Once it’s finished exit from the odoo user: exit.

Step 6. Configuring the OpenERP application

The default configuration file for the server (/opt/odoo/debian/openerp-server.conf) is actually very minimal and will, with only a small change work fine so we’ll copy that file to where we need it and change it’s ownership and permissions:

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

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

To allow the odoo server to run initially, you should only need to change two lines 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. Then modify the line addons_path = /usr/lib/python2.7/dist-packages/openerp/addons so that it reads addons_path = /opt/odoo/addons instead.

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

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

Use your favourite text editor here. I tend to use nano, e.g.

sudo nano /etc/odoo-server.conf

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

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

If you end up with a few lines eventually saying OpenERP (Yes. The log still says OpenERP and not Odoo) is running and waiting for connections then you are all set.

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/odoo/debian/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 Odoo version 8.

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 odoo-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/odoo-server
sudo chown root: /etc/init.d/odoo-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/odoo
sudo chown odoo:root /var/log/odoo

Step 8. Testing the server

To start the Odoo server type:

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

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

less /var/log/odoo/odoo-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…

Odoo 8 New Database

Odoo 8 New Database

If the log file looks OK, now point your web browser at the domain or IP address of your Odoo 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 Odoo 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/odoo-server.conf file; hence why we restricted access to just odoo and root. When you change and save the new password the /etc/odoo-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/odoo-server stop

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

Step 9. Automating Odoo 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 odoo-server defaults

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

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

odoo 1491 0.1 10.6 207132 53596 ? Sl 22:23 0:02 python /opt/odoo/openerp-server -c /etc/odoo-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.

Odoo 8 Opening Screen

Odoo 8 Opening 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 feel for the new User Interface in Odoo 8 and shows you how easy it is to set up a basic system.

Tags: , , ,

276 Comments

  • Kevin G says:

    Funny, I just subscribed for updates less than an hour before you posted this, as I have been wondering when you would come out with this post. I have been following and using your guides since 6.0, and have always wanted to get into direct contact with you.
    I have been wanting to ask what you thought of 7.0, as I have never really gotten comfortable with it and am still installing 6.1 for clients. I can never seem to get it to work without issues, am bothered by the lack of a true ‘stable’ release, and honestly don’t care much for the direction the company has been going. Unfortunately, it is still the best open ERP available (particularly for SMEs) and it is what I know.
    Anyway, I’ll be giving 8.0 a test drive (following your instructions of course, I have tried using the deb and installing from source but have yet to get it to work properly, although I haven’t really tried too hard yet), and will comment further when I do. Feel free to send me an email if you like, we have very similar business models and philosophies.

  • Neelu says:

    sudo cp /opt/odoo/debian/openerp-server.conf /etc/odoo-server.conf this does not work. It gives the error
    cp: cannot stat ‘/opt/odoo/debian/openerp-server.conf’: No such file or directory

  • Great tuto, thanks Alan!
    Suggestion i have:
    If you plan to get more than one instance/version of odoo on the same server, a good idea must set a python virtualenv before the step 4 and run instance/version with in.

    To do before the step 4:

    Install python virtualenv:
    sudo apt-get -y install python-pip python-virtualenv

    Move into the odoo directory:
    cd /opt/odoo/

    Make directory for virtual env
    mkdir venv_oddo

    Install a virtual env in:
    virtualenv --no-site-packages venv_oddo

    Activate the virtual env:
    source venv_oddo/bin/activate

    Use pip to install dependencies, a good way is use requierments.txt provided by odoo(https://github.com/odoo/odoo/blob/master/requirements.txt):
    pip intall -r /path_to/requirements.txt

    Deactivate your venv:
    deactivate

    Follow next steps provided by this tuto up to step 7, you have to modify the init script to activate your vitrual env when odoo deamon start, use this script instead of the proposed.

  • Alloice says:

    Continue doing the Greatv Work..I usually Use Your Guides to install OpenERP on Ubuntu.And it is 100%

  • Victor Hernandez says:

    Same error on step 5 , de dot does not correspond to opr/odoo/debian

  • Dan Lawson says:

    I’d *highly* recommend you add in dropping superuser postgresql privileges after the database is created. I’ll be publishing the vulnerabilities in a couple of weeks (after they finish getting patched), but in the meanwhile, it is dangerous to run Odoo in any kind of production environment with the database user having superuser access to the database.

  • Omar Khan says:

    you mention that:

    “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/odoo/openerp-server”

    When did we create teh openerp user?
    Thanks

  • Vincent says:

    Regarding the git clone : git clone https://www.github.com/odoo/odoo –branch 8.0 –single-branch .

    My debian says : unknown option –single-branch, and it doesn’t want the dot at the end either. Since I have no clue about git, I did it : git clone https://www.github.com/odoo/odoo –branch 8.0

    Hope this is fine, and if you know why my git doesn’t know –single-branch, I am curious about it…

    Thanks for your tuto anyway.

  • Vincent says:

    By the way : git clone https://www.github.com/odoo/odoo –branch 8.0 .
    fatal: destination path ‘.’ already exists and is not an empty directory.
    Whereas I am in /opt/odoo and I only have a .lesshst file in the directory…

    I am lost…

    • Alan Lord says:

      Your target directory, the “.” is not empty. Remove the .lesshst and try again.

      • Vincent says:

        Thanks a lot, you are right, it works perfectly on ubuntu. Thank you

      • bjorn says:

        First of all : you saved my mental sanity more than once. So many thanks for that. Now the newbi question : how do you “Remove the .lesshst” ? ^^

        • Alan Lord says:

          rm .lesshst (su to the odoo user first).

          But thinking on this, I might move the git clone command destination into a sub directory – this is sub-optimal as it will affect other users too I think. Maybe instead of a target of “.” it should go into a sub directory like odoo (again) or “server” perhaps. So the full path to the Odoo code would be /opt/odoo/{odoo,server}/?

          What do you think?

          • bjorn says:

            You are really asking me, the guy that couldn’t delete a file ? 😀 (I tried to remove it as a directory..). Thanks for the answer anyway !

          • bjorn says:

            Sooo… actually, it does not work for me. At this point, I should may ben mention that I’m running it on a Raspberry Pi…
            I get the error : fatal: destination path ‘.’ already exists and is not an empty directory.
            a “rm .lesshst” gives “rm: cannot remove `.lesshst’: No such file or directory”
            a “rm .” gives “rm: cannot remove `.’: Is a directory”
            a “rmdir .” gives “rmdir: failed to remove `.’: Invalid argument”
            so maybe your suggestion in using another sub-dir would be more noob-proof. 🙂

          • Alan Lord says:

            Maybe there are other files in your directory?

            ls -la will show you everything. (typing man commandname will show you a manual page telling you about the options you can use for each command, e.g. man ls..

            You cannot delete “.” that is your present working directory.

            NB: This howto isn’t really meant to be a lesson in Linux command line basics 😉

          • bjorn says:

            You are right, but the problem seem more complex (at least for me).
            I solved it by putting everything in a “server” sub-folder.
            Thanks for your work.

          • Alan Lord says:

            Well done 🙂 Glad to hear you sorted it.

  • maie says:

    How to update it?

  • Ueflee says:

    Thank you for the how to document.

    I did this all things, and if i start by hand it’s work. (/opt/odoo/openerp-server)
    If i start like service for auto starting testing:
    sudo /etc/init.d/odoo-server start
    Starting odoo-server: odoo-server.

    i got 500 Internal Server Error in my browser

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

    How can i solve this? What do it wrong?

    Thank you

  • David says:

    Thanks for taking the time to write this detailed instruction. Now that Odoo has been officially released, are these instructions still current? If not what else has to be done?

  • Ian Beardslee says:

    Nice instructions again ..

    Because you are describing how to get Odoo going and not to develop it, you don’t need the entire git history ..

    git clone https://www.github.com/odoo/odoo --depth 1 --branch 8.0 --single-branch .

  • Luthfi says:

    Hi allan,
    Thanks for the great tips. it works perfectly.

    can you show the instruction how do i update Odoo 8 to the latest release if there is an update?

    Thanks 😉

  • usha says:

    Works well.. just one typo in view log file..
    it should be /var/log/odoo /… instead of /openerp

    — Usha

  • Luis Lafaurie says:

    Hi Alan,

    Very good instructions.

    Just to say that the dot “.” at the end of the “git clone” command (git clone https://www.github.com/odoo/odoo –depth 1 –branch 8.0 –single-branch .) didn’t work, but taking it off did.

    Thanks.

  • Aporie says:

    Thanks for your tuto !

    Works well, except this line : less /var/log/openerp/odoo-server.log

    Have to put less /var/log/odoo/odoo-server.log instead.

  • Rami Talat says:

    While doing a test-upgrade of our Ubuntu server to 14.04, I found that the package DenyHosts is no longer available. Installing it gives following error:

    apt-get install denyhosts
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package denyhosts

    Apparently it has been deleted, according to launchpad!!!

  • Zak says:

    to solve wkhtmltopdf issue (report are empty or version error) use this :
    sudo wget http://jaist.dl.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
    sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
    sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
    sudo cp /usr/local/bin/wkhtmltoimage /usr/bin

  • Kevin says:

    Hi Allan,
    GREAT WORK! Thanks for the instructions.
    I have successfully installed and its working fine.
    I however notice that although I have added multiple databases, I don’t see the database list that I am accustomed to seeing (in previous versions) at the top right hand of the login screen.

    How do I address this?

    • Kevin says:

      Please ignore, the databases were not created successfully.
      Now that I have created them successfully, the list is displayed.(No longer in the top right hand corner, above the username instead).

  • williams says:

    when I did git clone https://www.github.com/odoo/odoo --depth 1 --branch 8.0 --single-branch . the "." does not work. So I took it off then it go thru. It create a folder "odoo" under /opt/odoo
    Then
    sudo cp /opt/odoo/debian/openerp-server.conf /etc/odoo-server.conf won't work because the path will be /opt/odoo/odoo/debian/openerp-server.com So the right command will be
    sudo cp /opt/odoo/odoo/debian/openerp-server.conf /etc/odoo-server.conf
    then everything followed will be changed.

  • Vincent says:

    Odoo website port configuration.

    We connect to odoo as http://www.myodoo.com:8069, which is fine, nevertheless for the web site or the ecommerce site we cannot ask our visitors to add 8069 at the end of the domain name. Any hint on how to configure this part ?
    I guess we need to go through apache so we can use port 80, perhaps using mod_wsgi ?

    Thanks a lot

    • Thomas says:

      Change app to port 80

      iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 8069
      iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 443 -j REDIRECT –to-port 8070
      iptables-save

      apt-get install iptables-persistent

      • Alan Lord says:

        That’s an interesting idea. I’d not considered using IPtables before. Of course will only be useful on a dedicated machine.

        And are you sure Odoo will terminate SSL on port 8070? How do you configure Odoo for this? I thought this support was removed back in 6.1?

      • Stefan says:

        I suggest using a reverse Proxy like nginx. It then can also provide SSL encryption to the server.

        the nginx config should look like this:

        #openerp
        upstream openerp {
        server your.internal. ip.here:8069; # OpenERP, on same machine use 127.0.0.1
        }

        server {
        listen your.external.ip.here:443 ssl;
        server_name your.domain.com
        client_max_body_size 200M;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        keepalive_timeout 60;

        ## send request back to openerp on ubuntu 14.04 ##
        location / {
        proxy_pass http://openerp;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;
        proxy_buffering on;
        proxy_buffer_size 64k;
        proxy_buffers 8 32k;

        proxy_set_header Accept-Encoding “”;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        ### Most PHP, Python, Rails, Java App can use this header ###
        #proxy_set_header X-Forwarded-Proto https;
        #This is better##
        proxy_set_header X-Forwarded-Proto $scheme;
        add_header Front-End-Https on;

        }

        }

      • Zahid Ali says:

        I’ve installed the odoo 8 on digitalocean cloud. I’m using odoo on erisp.co:8069 url. I need to access it on erisp.co. I already use the way you explain but in my case the iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 8069 it doesnot work. it shows this error
        Bad argument `–dport’
        Try `iptables -h’ or ‘iptables –help’ for more information.
        kindly help me what I should do?
        Thanks in advance

  • Santiago says:

    Hi Allan,

    In step 2 you give a hint on how to run several instances of odoo on the same server, but I tried it a couple times unsuccessfully.
    It would be great if you could give further details on how to attain that installation procedure.

    Regards

  • César says:

    This ies exactly what I needed! Thanks. One question, though. Is this good enough for production? No apache or gunicorn? Thank you

    • Alan Lord says:

      @César,

      Thanks and to answer your question, it really depends on the use-case.

      I’ve written both apache and Nginx howtos before for earlier versions of OpenERP. If I get time I will write one for Odoo 8, but I’m sure there are others on-line already…

  • Milan says:

    odoo@udp:~$ git pull
    fatal: Not a git repository (or any of the parent directories): .git

    It’s not work for me.
    ls tells that odoo directory is in correct place
    odoo@udp:/opt$ ls
    odoo odoo-8 openerp
    odoo@udp:/opt$ cd odoo
    odoo@udp:~$ cd /opt/odoo/

    How to resolve the problem

  • Séraphine says:

    Hi Alan,
    Tks for the document
    I just install it but not with the boot script. But when I try to create my database I have server error :
    OpenERP Server Error


    AccessDenied: Access denied.
    Do you know why please?

  • voathnak lim says:

    Hi, Thanks for the instructions.

  • superbe says:

    excellent! followed the steps for a debian like ‘copy & past’ & it works immediatly

    you make it too easy 😉

  • Séraphine says:

    I’ve just had another problem. My /var/log/odoo/odoo-server.log contain nothing
    The way “logfile = /var/log/odoo/odoo-server.log” is correct in the “/etc/odoo-server.conf”.
    What’s wrong with my file?

    Tks,

  • Malek says:

    Hello,

    I followed all your steps and everything installs correct. But when i open localhost:8069 on my browser i get an internal server error. I check the log file and this is the error:

    File “/opt/odoo/openerp/http.py”, line 1373, in db_list
    dbs = dispatch_rpc(“db”, “list”, [force])
    File “/opt/odoo/openerp/http.py”, line 100, in dispatch_rpc
    result = dispatch(method, params)
    File “/opt/odoo/openerp/service/db.py”, line 70, in dispatch
    return fn(*params)
    File “/opt/odoo/openerp/service/db.py”, line 313, in exp_list
    with closing(db.cursor()) as cr:
    File “/opt/odoo/openerp/sql_db.py”, line 567, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
    File “/opt/odoo/openerp/sql_db.py”, line 181, in __init__
    self._cnx = pool.borrow(dsn)
    File “/opt/odoo/openerp/sql_db.py”, line 460, in _locked
    return fun(self, *args, **kwargs)
    File “/opt/odoo/openerp/sql_db.py”, line 522, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
    File “/usr/lib/python2.7/dist-packages/psycopg2/__init__.py”, line 179, in connect
    connection_factory=connection_factory, async=async)
    OperationalError: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?

    I searched everywhere i even uninstalled and reinstalled postgresql and same error. Im installing Odoo on a server.

    Please any information that can help??

    • Alan Lord says:

      That sounds like PostgreSQL isn’t running or is running on a different port perhaps? Are you using Ubuntu 14.04?

      • Malek says:

        yes im using ubunty 14.04
        I checked on what port postgresql is running and its running on port 5432. I tried alot of things but im still getting the same error. Any idea?

  • bvdcomp says:

    Hi
    I’ve follow your instruction and I get this error when I creat a new DB:
    ——————————————–
    Traceback (most recent call last):
    File “/opt/odoo/odoo/openerp/http.py”, line 500, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
    File “/opt/odoo/odoo/openerp/http.py”, line 517, in dispatch
    result = self._call_function(**self.params)
    File “/opt/odoo/odoo/openerp/http.py”, line 284, in _call_function
    return self.endpoint(*args, **kwargs)
    File “/opt/odoo/odoo/openerp/http.py”, line 733, in __call__
    return self.method(*args, **kw)
    File “/opt/odoo/odoo/openerp/http.py”, line 376, in response_wrap
    response = f(*args, **kw)
    File “/opt/odoo/odoo/addons/web/controllers/main.py”, line 690, in create
    params[‘create_admin_pwd’])
    File “/opt/odoo/odoo/openerp/http.py”, line 807, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
    File “/opt/odoo/odoo/openerp/http.py”, line 100, in dispatch_rpc
    result = dispatch(method, params)
    File “/opt/odoo/odoo/openerp/service/db.py”, line 70, in dispatch
    return fn(*params)
    File “/opt/odoo/odoo/openerp/service/db.py”, line 87, in exp_create_database
    _create_empty_database(db_name)
    File “/opt/odoo/odoo/openerp/service/db.py”, line 82, in _create_empty_database
    cr.execute(“””CREATE DATABASE “%s” ENCODING ‘unicode’ TEMPLATE “%s” “”” % (name, chosen_template))
    File “/opt/odoo/odoo/openerp/sql_db.py”, line 158, in wrapper
    return f(self, *args, **kwargs)
    File “/opt/odoo/odoo/openerp/sql_db.py”, line 234, in execute
    res = self._obj.execute(query, params)
    DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
    HINT: Use the same encoding as in the template database, or use template0 as template.
    ——————————————-

    Can you help?

    Thx

    • Alan Lord says:

      The Error message is very clear to me:

      DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)

      Just stick that into Google 😉

      • bvdcomp says:

        Thank you very much:

        That was the solution:
        ———————

        In console run psql:
        sudo -u postgres psql postgres

        then in psql console execute sequence of commands:

        update pg_database set datallowconn = TRUE where datname = ‘template0’;
        \c template0
        update pg_database set datistemplate = FALSE where datname = ‘template1’;
        drop database template1;
        create database template1 with template = template0 encoding = ‘UTF8’;
        update pg_database set datistemplate = TRUE where datname = ‘template1’;
        \c template1
        update pg_database set datallowconn = FALSE where datname = ‘template0’;

  • Intasar says:

    Hello,

    Your all steps was successfully in Ubuntu 14.04 TLS. all done and odoo is installed successfully. Only problem occur in your boot init script.

    When i run this command as a root: /etc/init.d/odoo-server start it shows following.

    root@cloud-odoo:~# /etc/init.d/odoo-server start
    -bash: /etc/init.d/odoo-server: /bin/sh^M: bad interpreter: No such file or directory

    i Double checked, file was there and copied properly as per your advise. permissions and ownership accurate as you stated. so kindly help and check your init script. because its very difficult to start odoo every time when you reboot VPS. so init script is must.

    • Alan Lord says:

      Please copy the error into Google (/bin/sh^M: bad interpreter: No such file or directory) and you will see lots of mentions.

      That would suggest you’ve edited the file with a Windows editor and this has added a CRLF at the end of a line. Linux doesn’t use the same line termination character as Windows…

  • Lam says:

    Dear Alan Lord,

    Thanks for the guide, I was setup odoo run with nginx proxy using ssl and enable live chat support, but browse always block live chat because it have mixed and insecure content from live chat module. Could you give me a advice to secure content of live chat module.

    Thanks.

    Lam

  • Humberto says:

    Great How-To Alan. Thank you so much for this. I owe you a beer or two!!

  • Vincent says:

    Thanks a lot, you truly allowed me to have a deep understanding of the installation.

    I did a script of my own without interactivity, so that it’s more straightforward.

    Most of all, I love how this article grows from great to even better with the additional notes given by readers.

    Cheers!

  • Michael Soo says:

    Hi guys,

    When I tried to run git pull, I got this error. Can anyone help me please?

    odoo@Odoo:~/odoo$ git pull origin 8.0
    fatal: unable to access ‘https://www.github.com/odoo/odoo/’: Could not resolve host: http://www.github.com

    • Alan Lord says:

      Thanks for the compliments Michael.

      I will not be doing what you request any time soon – I simply do not have the time and I don’t use eclipse much anyway – but please feel free to use this as a template and create something of your own to publish somewhere on line. All the stuff on here that we write is cc-by-sa.

  • Antoine says:

    Hello Alan,

    That was a pleasure to follow your How-To. I have justed adapted the installation of wkhtmltopdf that I do with a wget and a dpkg of the last .deb file.
    As you probablye understood, I did the installation on Debian.

    Almost everything works however I don’t succeed in automatize launch and stop of the odoo server 🙁

    Firstly I tried with your script :
    Here are the perms on it :
    root@mydebianmachine:/home/antoine# ls -al /etc/init.d/odoo-server
    -rwxr-xr-x 1 root root 2192 oct. 22 21:30 /etc/init.d/odoo-server

    My modified script to fit my path
    => When I launch your script, it doesn’t even print the usage.

    Then, I tried the provided script.
    I modified the vars to fit my path, followed the same steps (mv to /etc/init.d/ ; chmod)
    => It prints Usage, Ok but can’t stop as in reality it never launched it (as I can see in ps aux)

    Do you have any idea of leads to get it work ?

    At this stage, in order to launch Odoo, I open a session with the user antoine, then su – odoo then launch manually ./openerp-server

  • kdclaver says:

    Hi,
    On Ubuntu 14.04, when I try this command git clone https://www.github.com/odoo/odoo –depth 1 –branch 8.0 –single-branch .
    The system return this error message “fatal: destination path ‘.’ already exists and is not an empty directory.”
    How can I solve this error message and achieve my install ?
    Thanks more

    • Alan Lord says:

      This is already mentioned in the comments. “.” is your current working directory (i.e. /opt/odoo/).

      If /opt/odoo is not empty git will not clone into it. Type ls -la and see what it shows. There might be a .bash_history hidden file or something. Delete everything before running the command, or alternatively, you can clone into a subdirectory and then edit the config files to reflect the new location. To do this simply replace the dot at the end of the git clone command with the subdirectory name of your choice. odoo would seem appropriate, e.g.

      git clone https://www.github.com/odoo/odoo –depth 1 –branch 8.0 –single-branch odoo

      You will then have a directory structure like /opt/odoo/odoo/

      • kdclaver says:

        Thanks more, I move to /opt/odoo and git and complete the installation without any bug.

        Thanks again and I just want to congratulate the writer of this howto.

  • Ifeoma says:

    Thank you, thank you and thank you again. For an Ubuntu newbie, I was able to deploy odoo8 on AWS using your guidelines. At the end the only change I had to make to my instance security rules was to add a Custom TCP rule for port 8069. No hitches whatsoever. Hats off!

  • Billie Mead says:

    I ran this command:

    sudo su – odoo -s /bin/bash

    And now when I try to switch to user odo its asking for a password? Already.. what did I do wrong? I didn’t set a password did i?

  • Scott Nolan says:

    Hey Great tutorial and everything works like a charm however i am trying to run this on AWS and want to get port 80 to serve the front and back end as the bitnami stack can do.

    Why don’t i just use bitnami i hear you say. Well there are issues installing chat modules etc and it seems slow and clunky compared to my own install as per the instructions above and greatly received.

    Furthermore teh Android app wont connect to the bitnami stack which is critical as i will have field engineers and the messaging and to do list is great as well as uploading files using notes.

    So bitnami falls short on those two points.

    So back to what alot o fusers may want to know How can we get port 80 and will the Messaging app still work after?

    Secondly i have issues logging in with a new user with the app i can only login using the admin credentials so i checked permissions and cant see anything different any clues?

    I found a Great script for using on AWS for those who want a one wget and run install and i will update and post for AWS people when i can get the port 80 issue sorted and app connectivity.

  • Osay says:

    Hi,
    Great article. Unfortunately after following the instructions I’m unable to create the database. When I change the default admin password, put in my company name and create password and hit create database I get the following errors
    2014-11-05 10:54:34,098 25679 INFO ? openerp.addons.bus.bus: Bus.loop listen imbus on db postgres
    2014-11-05 10:54:34,670 25679 INFO ? openerp.addons.report.models.report: Will use the Wkhtmltopdf binary at /usr/bin/wkhtmltopdf
    2014-11-05 10:54:34,876 25679 INFO ? openerp.http: HTTP Configuring static files
    2014-11-05 10:54:34,908 25679 INFO None openerp.http: Generating nondb routing
    2014-11-05 10:54:34,944 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:34] "GET / HTTP/1.1" 303 -
    2014-11-05 10:54:35,057 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:35] "GET /web HTTP/1.1" 303 -
    2014-11-05 10:54:35,135 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:35] "GET /web/database/selector HTTP/1.1" 303 -
    2014-11-05 10:54:35,235 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:35] "GET /web/database/manager HTTP/1.1" 200 -
    2014-11-05 10:54:35,837 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:35] "POST /web/session/get_session_info HTTP/1.1" 200 -
    2014-11-05 10:54:36,049 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:36] "POST /web/webclient/bootstrap_translations HTTP/1.1" 200 -
    2014-11-05 10:54:36,154 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:36] "POST /web/proxy/load HTTP/1.1" 200 -
    2014-11-05 10:54:36,311 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:36] "POST /web/session/get_lang_list HTTP/1.1" 200 -
    2014-11-05 10:54:36,321 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:54:36] "POST /web/database/get_list HTTP/1.1" 200 -
    2014-11-05 10:55:23,952 25679 ERROR None openerp.http: Exception during JSON request handling.
    Traceback (most recent call last):
    File "/opt/odoo/openerp/http.py", line 500, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
    File "/opt/odoo/openerp/http.py", line 517, in dispatch
    result = self._call_function(**self.params)
    File "/opt/odoo/openerp/http.py", line 284, in _call_function
    return self.endpoint(*args, **kwargs)
    File "/opt/odoo/openerp/http.py", line 733, in __call__
    return self.method(*args, **kw)
    File "/opt/odoo/openerp/http.py", line 376, in response_wrap
    response = f(*args, **kw)
    File "/opt/odoo/addons/web/controllers/main.py", line 694, in create
    params['create_admin_pwd'])
    File "/opt/odoo/openerp/http.py", line 807, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
    File "/opt/odoo/openerp/http.py", line 100, in dispatch_rpc
    result = dispatch(method, params)
    File "/opt/odoo/openerp/service/db.py", line 62, in dispatch
    security.check_super(passwd)
    File "/opt/odoo/openerp/service/security.py", line 33, in check_super
    raise openerp.exceptions.AccessDenied()
    AccessDenied: Access denied.
    2014-11-05 10:55:23,966 25679 INFO None werkzeug: 10.29.128.147 - - [05/Nov/2014 10:55:23] "POST /web/database/create HTTP/1.1" 200 -

    • Osay says:

      Really strange thing here. I started from scratch and tried again. Same issue. Then I used admin for all the passwords and presto, it’s working. Also I checked load demo database and unchecked this when I changed the passwords so I’m not sure if it’s the unchecking of the demo database or the use of admin.

      Cheers
      Osay

  • Malte Helmhold says:

    Hey guys,
    I had a LOOOT of truble with bitnami after using it a while. Always stuff that did not work properly and the dev version was not upgradable at all. there was stuff going on and the bitnami people could not solve it. In order to forward to port 80 you can just modify the routing table. And I also find that these scripts update a lot. So thanks a looot for your script opensourcerer, but many people want to use just an installation script out of the box. I explain how it works in my video here:

    https://www.youtube.com/watch?v=FTrDT7Ovjs0

    This port 80 and apache configuration very often caused me a lot of pain. I think when you want to use ssl you definitely have to setup nginx or apache, but when you don’t need secure connection use routing table:)

    and concerning AWS: It’s soooo expensive!!!!! You’re at $100 so fast when you just make copies to try something. And using micro instance is too slow:( so digitalocean or any other host 100% could be a better solution. I love when this is discussed, because probably some people have very good reasons for AWS, then please correct my post here:) I’m always trying to offering my best tips to people I’m recording tutorials for:)

    thank you for you code!

  • Juan Carlos Choque says:

    Hi, first of all your tutorial is great, I followed it step by step but I have the following error after finalize the tutorial and I want to initialize the openerp (http://localhost:8069)

    Traceback (most recent call last):
    File “/opt/odoo/openerp/http.py”, line 500, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
    File “/opt/odoo/openerp/http.py”, line 517, in dispatch
    result = self._call_function(**self.params)
    File “/opt/odoo/openerp/http.py”, line 284, in _call_function
    return self.endpoint(*args, **kwargs)
    File “/opt/odoo/openerp/http.py”, line 733, in __call__
    return self.method(*args, **kw)
    File “/opt/odoo/openerp/http.py”, line 376, in response_wrap
    response = f(*args, **kw)
    File “/opt/odoo/addons/web/controllers/main.py”, line 694, in create
    params[‘create_admin_pwd’])
    File “/opt/odoo/openerp/http.py”, line 807, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
    File “/opt/odoo/openerp/http.py”, line 100, in dispatch_rpc
    result = dispatch(method, params)
    File “/opt/odoo/openerp/service/db.py”, line 62, in dispatch
    security.check_super(passwd)
    File “/opt/odoo/openerp/service/security.py”, line 33, in check_super
    raise openerp.exceptions.AccessDenied()
    AccessDenied: Access denied.

    I read all comments but I do not found a solution, my SO is Ubuntu 14.04

    Thanks in advance

    • Juan Carlos Choque says:

      I’m so sorry that was my own mistake because I was changing the default master password, but since I kept the default password the message won’t show anymore.

  • Step 6. Configuring the OpenERP application

    The default configuration file for the server (/opt/odoo/debian/openerp-server.conf) is actually very minimal and will, with only a small change work fine so we’ll copy that file to where we need it and change it’s ownership and permissions.

    In my installation on Amazon Web Services the openerp-server.conf is located at /opt/odoo/odoo/debian/ instead of at /opt/odoo/debian/

  • Step 6. Configuring the OpenERP application
    In my installation on Amazon Web Services the path is
    addons_path = /opt/odoo/odoo/addons instead of
    addons_path = /opt/odoo/addons

  • krnkris says:

    Thank You, Alan Lord!

    Perfect & detailed information as on version 7 before….

  • kdclaver says:

    I have a running OpenERP 7.x (I follow your howto http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/) and I have tested this howto that works fine. How can I upgrade my running OpenERP 7.x to Odoo ?

    Thanks more for your feedback !!!

    • Alan Lord says:

      Upgrading OpenERP/Odoo can be a complicated business. You have a few choices:

      1. Buy an Enterprise Warranty from Odoo
      2. Try open-upgrade: https://doc.therp.nl/openupgrade/
      3. Examine the structure of the version 7 and version 8 databases and manually migrate, or write your own scripts to implement the changes.

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=""> <s> <strike> <strong>