Install Odoo (formerly OpenERP) with Nginx on an Ubuntu VPS

In today’s post we will explain you how you can easily install Odoo with Nginx as a reverse proxy server on a Ubuntu VPS.
Odoo (formerly OpenERP) is a suite of open source Business apps. Some of the modules included in Odoo are: E-commerce, Accounting & Finance, Expense Management, Calendar ..etc.

Update your system

To update your system run the following commands:

$ sudo apt-get update
$ sudo apt-get upgrade -y

Install Odoo (formerly OpenERP)

Add the repository to your sources list

$ vim /etc/apt/sources.list
deb ./

and install Odoo

$ sudo apt-get update
$ sudo apt-get install openerp -y

Install PostgreSQL Server

$ sudo apt-get install postgresql -y
$ sudo su - postgres -c "createuser -s openerp" 2> /dev/null || true

Set the password for the openerp postgres user

sudo su postgres
psql template1
ALTER ROLE openerp WITH password 'odooPassWord';

Install and Configure Nginx

$ sudo apt-get install nginx

Generate ssl certificate

$ sudo mkdir /etc/nginx/ssl
$ cd /etc/nginx/ssl
$ sudo openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
$ sudo openssl rsa -passin pass:x -in server.pass.key -out server.key
$ sudo rm server.pass.key
$ sudo openssl req -new -key server.key -out server.csr
$ sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Create Nginx server block

$ sudo vim /etc/nginx/sites-available/
upstream oddo {

server {
    listen      443 default;

    access_log  /var/log/nginx/oddo.access.log;
    error_log   /var/log/nginx/oddo.error.log;

    ssl on;
    ssl_certificate     /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    keepalive_timeout   60;

    ssl_ciphers             HIGH:!ADH:!MD5;
    ssl_protocols           SSLv3 TLSv1;
    ssl_prefer_server_ciphers on;

    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

    location / {
        proxy_pass  http://oddo;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;

        proxy_set_header    Host            $host;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto https;

    location ~* /web/static/ {
        proxy_cache_valid 200 60m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://oddo;

server {
    listen      80;

    add_header Strict-Transport-Security max-age=2592000;
    rewrite ^/.*$ https://$host$request_uri? permanent;

Activate the server block by creating a symbolic link and restart nginx

$ sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
$ sudo /etc/init.d/nginx restart

Configure the ODOO application

Edit the server configuration


and set the password

db_password = odooPassWord

Create a New Database

Open your browser, go to, fill the input fields and click on the “Create Database” button.

After the database is created, you will be redirected to the admin panel where you can change your password.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install Odoo for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

How to Install Typesetter CMS on CentOS
How to install Laravel 4 with Twitter Bootstrap on Linux VPS
Installing Redmine on a CentOS 6 VPS
  • El Sonny (@el_sonny)

    Thanks so much for this article, I was able to setup Odoo on nginx with it.

    I would like to point out a bug in the source, In the “generate ssl certificate” section and server block you have different routes for the ssl certificates:


    After I solved that everything worked fine.

    • admin


      Author Reply

      Thanks for noticing that. Corrected.

  • Murray


    Author Reply

    Nicely laid out, but before I try it I notice that you made no mention of installing all or any of the required dependencies for Odoo 8.0 to work.

    How have you covered that? Is there something you did that I missed?

    Curious to know :)

    • admin


      Author Reply

      To install Python Dependencies for Odoo (OpenERP) run:

      sudo apt-get install python-dateutil python-docutils python-feedparser 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 poppler-utils python-pip

      To install supporting packages for Odoo (OpenERP) run the following:

      sudo apt-get install gcc python-dev mc bzr python-setuptools python-babel python-feedparser python-reportlab-accel python-zsi python-openssl python-egenix-mxdatetime python-jinja2 python-unittest2 python-mock python-docutils lptools make python-psutil python-paramiko poppler-utils python-pdftools antiword

  • Gabriel Mongeau

    Thanks for this great tutorial !

    However, I am having issues relaunching the openerp-server after a server reboot. Restarting Nginx is not working for me. Since their is no script in /etc/init.d/, I am out of idea to relaunch the openerp-server. I also checked all the pid running and Odoo is not running.

    Your help would be greatly appreciated. Thanks !

  • James Utru

    James UtruJames Utru

    Author Reply

    Can someone make this into a script please?

  • kartik


    Author Reply

    when i try

    deb ./
    so it give error
    “deb” command not found

    After i try to install openerp

    sudo apt-get install openerp -y

    it gives error like,
    “E: unable to locate package openerp”

    please help for solve this issue

    • admin


      Author Reply

      You need to add one of the lines below in the /etc/apt/sources.list file

      deb ./ # for Odoo 7
      deb ./ # for Odoo 8

      and install it with:

      sudo apt-get update && sudo apt-get install openerp # for Odoo 7
      sudo apt-get update && sudo apt-get install odoo    # for Odoo 8

    • admin


      Author Reply

      You need to add one of the lines below in the /etc/apt/sources.list file

      deb ./ # for Odoo 7
      deb ./ # for Odoo 8

      and install it with:

      sudo apt-get update && sudo apt-get install openerp # for Odoo 7
      sudo apt-get update && sudo apt-get install odoo    # for Odoo 8

  • Randy Harkediansa

    Thanks! This post made my day!!!

    • shivam dudhat

      i was fetch this eror
      please help me
      [emerg] unknown directive “tream” in /etc/nginx/sites-enabled/
      nginx: configuration file /etc/nginx/nginx.conf test failed

      • admin


        Author Reply

        Please edit your nginx server block related to Odoo and change tream to upstream.

  • Chuvindra Singh


    I did same thing in two amazon server, one is working well without any error and second server showing not found error and there is no error in log file of odoo and nginx. I did not understand where i did mistake, can you help please

    I access page by this url


  • Hasan Fakih

    Hello and thank you for the great tutorial. In odoo you can create a website and an e-commerce webpage and those usually are public pages and there’s a login button above that let’s you login to the erp system. My question is, how can we make the public pages non HTTPS and when the user want to login, he gets redirected to HTTPS and stays in HTTPS while using the ERP system? I’m aware that he can setup another instance of odoo and sync the data but this way some integration features will be lost. Is there a way to do that on a single odoo instance?

    • admin


      Author Reply

      Hello Hasan. You can make your login pages redirect to HTTPS using Nginx rewrite rules. For example this code:

      if ($request_uri ~* "/login.php") {
      rewrite ^ https://$host$request_uri permanent;

      It will redirect http://domain_name/login.php to https://domain_name/login.php

      For more info on Nginx rewrites please visit their official article.

  • Tanzil Khan

    I am following your tutorial to one of my servers. But I am getting 504 Gateway Time-out error.
    I have followed every step still facing the problem.

  • Ahmed


    Author Reply

    pls i will love to know how to host website created using odoo v8. running perfectly well on local host. i will like to have a domain e.g for that site. wld be grateful if I’m helped. Thanks

  • Kabeer


    Author Reply

    I can’t restart nginx server using $ sudo /etc/init.d/nginx restart, getting an error: * Restarting nginx nginx [fail]. then i ran this command sudo nginx -t output was:
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful

    how can i restart nginx?

    • admin


      Author Reply

      Did you check your Nginx error log file?