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 http://nightly.openerp.com/7.0/nightly/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/yourOdooSite.com
upstream oddo {

server {
    listen      443 default;
    server_name yourOdooSite.com;

    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;
    server_name yourOdooSite.com;

    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/yourOdooSite.com /etc/nginx/sites-enabled/yourOdooSite.com
$ 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 https://yourOdooSite.com, 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.

Categories: Tutorials

View Comments

Leave a Comment