O doo 10 is released on 5th Oct 2016, this page will guide you to install Odoo 10 in ubuntu 16.04 LTS. There can be many blogs and several ways to install the odoo, this page will help you to install odoo manually.
Prepare Ubuntu
Make sure you have sudo access or logged in as root. to log in as a root you need to run below command and provide the system password.
sudo su
We will update the ubuntu with the latest version of the packages and perform the function of the upgrade. below command will do that for you.
sudo apt-get update && sudo apt-get dist-upgrade
Add system user
Now you need to create a system user to run the odoo server below command will add the user “odoo”, creates the home path
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/odoo --group odoo
The user should also be added to the sudo’ers group.
sudo adduser odoo sudo
Install & Prepare Postgres
Odoo uses Postgres as the database layer, below command will install Postgres (version 9.5.4 is default in ubuntu 16.04)
apt-get update postgresql -y
After installing Postgres check the version of the Postgres using
psql --version
Now depending on the version you need to install postgresql-server-dev, if your version is 9.5.3 then 9.5 and if 9.4.0 then 9.4, run the below command
sudo apt-get install postgresql-server-dev-9.5
After installing odoo we will create user “odoo” in Postgres, for that you need to log into Postgres first using
su postgres
and after that create Postgres user for odoo 10, it will prompt for the password of the new user.
createuser --createdb --username postgres --superuser --pwprompt odoo
Install required packages
In order to run the Odoo, you need several packages & python libs installed in ubuntu.
sudo apt-get install wget git python-pip python-dev gdebi-core \ node-clean-css node-less python-gevent libevent-dev gcc \ libxml2-dev libxslt-dev libldap2-dev libssl-dev libsasl
Now we will install the python libs which is required by the odoo 10. for that we will fetch the requirement.txt file from the GitHub odoo 10 branch raw source and install using the pip(python package management system). below command will do that for you.
cd /tmp && wget https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt && sudo pip install -r requirements.txt
Install wkhtmltopdf
wkhtmltopdf is required in odoo to print the reports. depending on your OS bit you can install wkhtmltopdf for odoo 10.
How do I check if I have a 32-bit or a 64-bit OS?
uname -i
if you get i386 or i586, i.e OS is 32 bit
if you get x86_64, i.e OS is 64 bit
For 64 bit architecture
cd /tmp && wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb \ && sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
For 32 bit architecture
cd /tmp && wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-i386.deb \ && sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-i386.deb
Get Odoo 10 source
Now we will fetch the odoo source using GitHub. or you can also get the nightly source(https://nightly.odoo.com/10.0/nightly/src/)
below command will clone the git odoo 10 source code in /opt/odoo directory
sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/odoo /opt/odoo/
After getting the source change the permission for the odoo source using
sudo chown -R odoo:odoo /opt/odoo/
Configure Odoo 10
Default configuration file for the odoo 10 will be under /opt/odoo/debian/openerp-server.conf, we will copy that file and put that under /etc/odoo/
below command will do that for you.
sudo mkdir /etc/odoo && cd /etc/odoo && sudo cp /opt/odoo/debian/odoo.conf /etc/odoo/odoo-server.conf
we will edit the odoo 10 configureation file using
nano /etc/odoo/odoo-server.conf
and change the parameters according to your system
[options] ; This is the password that allows database operations: admin_passwd = suerp@dmin db_host = localhost db_port = 5432 db_user = odoo db_password = Postgr3s_odoo_passw0rd addons_path = /opt/odoo/addons
For more info : See Odoo configuration parameters
Now we will provide proper permission to the odoo 10 config file using below command
sudo chown odoo: /etc/odoo/odoo-server.conf \&& sudo chmod 640 /etc/odoo/odoo-server.conf
Place init script
Init script is used to start and stop the odoo server with proper configuration. we will copy the init file place it into /etc/init.d/ using
cp /opt/odoo/debian/init /etc/init.d/odoo-server
Now we will edit the file and change the DEMON path from the file to /opt/odoo/odoo-bin using
sudo nano /etc/init.d/odoo-server
and change the path of a demon from
DAEMON=/usr/bin/odoo
to
DAEMON=/opt/odoo/odoo-bin
and will provide proper permission to the file using
sudo chmod 755 /etc/init.d/odoo-server \ && sudo chown root: /etc/init.d/odoo-server
We will create log file based on init file using below command
sudo mkdir /var/log/odoo && sudo touch odoo-server.log
and will provide proper permission to the odoo 10 server log file
sudo chown -R odoo:root /var/log/odoo
Test Odoo server
now it’s time to get the result of hard work! to start the odoo 10 server type
sudo /etc/init.d/odoo-server start
and you can check the log using
sudo tail -f /var/log/odoo/odoo-server.log
press ctrl + c to exit
and if the server is local type the 127.0.0.1:8069 in the browser or your server’s public_ip:8069
for the first time, you will see database manager to create your first database.
Now stop the server using
sudo /etc/init.d/odoo-server stop
And check the log file again to make sure odoo has stopped properly.
Automize Odoo Service
If everything working well we can do an entry of odoo-server in update-rc.d which will automatically start & stops the odoo server along with ubuntu
sudo update-rc.d odoo-server defaults
reboot your server and check for the odoo service using ps -ax | grep odoo.
you can also configure odoo with Nginx or apache to make it work with your domain.
Give me a comment if you stuck at any point, I will be happy to help you & revert back to you as soon as possible.
hello
I would like to say great tutorial.
but I have a small problem, the master password does not use the password in the config file and when I set it from odoo it will be deleted after a restart.
what did I miss?
Hello Mohannad,
Thanks for your compliments!
have you set the
admin_passwd = master@admin@password?
in the config file? have you checked the permission to the config file?
Hello Atul, It was a very good stuff. But unfortunately, I am facing an error while starting the server using the command (sudo /etc/init.d/odoo-server start), which says, failed (root@CISM509:/etc/odoo# sudo /etc/init.d/odoo-server start
[….] Starting odoo-server (via systemctl): odoo-server.serviceFailed to start odoo-server.service: Unit odoo-server.service not found.
failed!
). I have already checked the file in the directory, file are also there, I am not able to understand what’s wrong here. Please help me.
Hi Aditya, I also encountered that error.
Run this command to fix it:
sudo systemctl daemon-reload
There are many ways to install Odoo, you can install Odoo manually by running one by one command, see the article here : https://tech.heliconia.in/insight/odoo/install-odoo-10-in-ubuntu-16-04-lts/
I heard that it is possible to run multiple Odoo instances on one server, but I didn’t manage to do that following these instructions. Luckily the guys at https://linuxhostsupport.com installed 4 different Odoo instances on my server 🙂
It is good to know that I don’t need separate servers for Odoo.
[…] are many ways to install Odoo, you can install Odoo manually by running one by one command, it will help you to understand the Odoo process and when you do not […]