You are on page 1of 6

STEP BY STEP GUIDE TO

INSTALL ODOO V10 ON


UBUNTU 16.04 LTS
M A N E X WA R E S . A .

STEP BY STEP GUIDE TO INSTALL


ODOO V10 ON UBUNTU 16.04 LTS
October 4, 2016

Here we are again with one more new Odoo version and a step by step guide on
how to install it.
As Odoo v10 release is just around the corner, It is a good idea to go through a
small tutorial on how to install Odoo v10 on Ubuntu 16.04 LTS.

Option 1:
Getting the necessary installation files using wget command.
1

This is shortest and quickest way to install without much of a fuss.


Just execute the following command, sit back and relax.
sudo wget bit.ly/odoo_v10_nginx_1604 && bash odoo_v10_nginx_1604
Note: You need to have a proper requirement for the installation to succeed. If
there is a requirement fail, it is better to follow the option 2 mentioned below.

Option 2 :
Step 1: Creating an Odoo user
Our next step is to create an odoo user. The odoo user is required to control the
different aspects of the system. You can do it by typing the following code into the
terminal.
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/odoo --gecos 'odoo'
--group odoo
Step 2: Creating a directory for config file and Logs
Config file and log play a major role in maintaining the system. To ensure that
they the config file and records are kept in the right place, we need to create a directory for them. Type the following command to the terminal for the desirable effect.
sudo mkdir /etc/odoo && mkdir /var/log/odoo/
Step 3: Installing necessary packages required for using Odoo
Odoo is a powerful software and has a lot of dependencies. To ensure that all dependencies are met, it is time to download the necessary packages. To make
sure all the necessary packages are downloaded, run the following command in
your terminal.
sudo apt-get update && apt-get upgrade -y && apt-get install postgresql
postgresql-server-dev-9.5 build-essential python-imaging python-lxml python-ldap
python-dev libldap2-dev libsasl2-dev npm nodejs git python-setuptools libxml2-dev
libxslt1-dev libjpeg-dev python-pip gdebi -y
Step 4: Cloning the Odoo Git repository with preference to minimal change
history
Our next step is to get the Odoo files from Git Repository. To do so, enter the following command in the terminal.
git clone --depth=1 --branch=10.0 https://github.com/odoo/odoo.git /opt/odoo/odoo
The step will take some time. Wait until it gets completed.
Step 5: Installing Python packages required for Odoo
Python is the core of Odoo. For proper functioning, it is necessary to get required
python packages. Do so by typing in the following command in the terminal. You
can copy the command if you don't wish to type it in.
sudo chown odoo:odoo /opt/odoo/ -R && sudo chown odoo:odoo /var/log/odoo/ -R
&& cd /opt/odoo/odoo && sudo pip install --upgrade pip && sudo pip install -r
requirements.txt
2

Step 6: Node and related packages to run Odoo Website


We will also require Nodejs and associated packages for Odoo website. Let's get
it done by the following command.
sudo npm install -g less less-plugin-clean-css -y && sudo ln -s /usr/bin/nodejs /usr/
bin/node
Step 7: wkhtltopdf library required to print reports from odoo
wkhtmltopdf is a mouthful, but it is a necessary library to ensure proper functioning of Odoo reporting. To make sure that Odoo reporting works correctly, we
need to run the following two commands (in the sequence shown below.)
cd /tmp && wget
http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trustyamd64.deb && sudo gdebi -n wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && rm
wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin/ && sudo ln -s /usr/local/bin/
wkhtmltoimage /usr/bin/
Step 8: Optional installation of GeoIP database for user tracking on the website
If you are thinking of using Odoo to create your website, it is a good idea to get
GeoIP. GeoIP locates the origin of the user and helps your business to understand the demographics better.
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
&& sudo gunzip GeoLiteCity.dat.gz && sudo mkdir /usr/share/GeoIP/ && sudo mv
GeoLiteCity.dat /usr/share/GeoIP/
Step 9: Create a User for PostgreSQL
To ensure that the database is setup properly fro the Odoo, we need to create a
user for PostgreSQL.
sudo su - postgres -c "createuser -s odoo"
Step 10. Generating Odoo Config File
We need a config file to make Odoo work. To do so, copy and paste the below
two commands to the terminal.
sudo su - odoo -c "/opt/odoo/odoo/odoo-bin --addons-path=/opt/odoo/odoo/addons
-s --stop-after-init"
sudo mv /opt/odoo/.odoorc /etc/odoo/odoo.conf
Step 11: Making Odoo as a service
Odoo requires being served as service. The following commands can do it.
sudo cp /opt/odoo/odoo/debian/init /etc/init.d/odoo && chmod +x /etc/init.d/odoo
sudo ln -s /opt/odoo/odoo/odoo-bin /usr/bin/odoo
sudo update-rc.d -f odoo start 20 2 3 4 5 .
Step 12: Starting the Odoo Server
start the Odoo Server.
3

sudo service odoo start


Yuppie! You made it. Now, all you need to do is go to the
http://{IP_ADDRESS}:8069 and try out the installation.
Step 12: Installing Nginx
sudo apt-get install nginx -y
Step 13: Configure Nginx for Odoo
Get your machines IP Address by following command
ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'
Create a configuration for Odoo, DONOT FORGET TO REPLACE $IPADR value
with your IP Address.
vim /etc/nginx/site-available/odoo
Put following content in the file
upstream odooweb {
server 0.0.0.0:8069 weight=1 fail_timeout=300s;
}
upstream odooweb-im {
server 0.0.0.0:8072 weight=1 fail_timeout=300s;
}
server {
# server port and name
listen 80;
server_name $IPADR;
# Specifies the maximum accepted body size of a client request,
# as indicated by the request header Content-Length.
client_max_body_size 200m;
#log files
access_log /var/log/nginx/odoo-access.log;
error_log /var/log/nginx/odoo-error.log;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
keepalive_timeout 600;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript application/xjavascript text/xml application/xml application/xml+rss application/rss+xml text/
4

javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/


opentype image/bmp image/png image/gif image/jpeg image/jpg;
# increase proxy buffer to handle some odoo web requests
proxy_buffers 16 64k;
proxy_buffer_size 128k;
location / {
proxy_pass http://odooweb;
# force timeouts if the backend dies proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
# set headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
# by default, do not forward anything
proxy_redirect off; }
location /longpolling {
proxy_pass http://odooweb-im; }
# cache some static data in memory for 60mins.
# under heavy load this should relieve stress on the odoo web interface a bit.
location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odooweb;
}
}
Step 14: Enable New Configuration
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/odoo
Step 15: Restart Nginx For New Configuration To Take Effect
sudo service nginx restart
That's it, You can now access your Odoo instance over Nginx by using
http://{your_ip_address}
If you loved the tutorial, don't forget to share and comment. Also, don't hesitate to
ask questions if you are stuck on the installation process.

You might also like