Skip to content

Deploying Installing Odoo (10c) on Ubuntu 16.04 LTS Server : Linux Reference

Jigar edited this page Aug 9, 2017 · 2 revisions

Deploying Odoo (10c) on Ubuntu 16.04 LTS Server

Add System User named odoo


  1. Switch to root user (if you are already root user skip this):

    sudo su - 
    
  2. Add user odoo

    adduser odoo
    

Install Back-end (database server) to be used with Odoo


  1. Installing Postgresql (Databse Server)

    apt-get install postgresql
    

Install Odoo (application server) dependencies and supporting libraries required to run odoo server.


  1. Install git

    apt-get install git
    
  2. Install pip: python package manager

    apt-get install python-pip
    
  3. Installing devel packages for compiling python libraries

    apt-get install python-dev postgresql-server-dev-all libjpeg-dev zlib1g-dev libpng12-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev
    
  4. Node-less installation

    apt-get install node-less
    
  5. Clone odoo

    su odoo
    cd /home/odoo
    git clone https://github.com/odoo/odoo.git
    exit
    
  6. Install python library

    cd /home/odoo/odoo pip install -r requirements.txt

  7. Create odoo user for postgresql with database creation rights

    su postgres createuser -d odoo exit

  8. Install wkhtmltopdf 0.12.1 !! (0.12.1 is identified to be working perfect with odoo, other version have bug and you may encounter unexpected issues. )

Get correct installer of wkhtmlpdf for your OS from here : https://github.com/wkhtmltopdf/wkhtmltopdf/releases/tag/0.12.1

(Below instruction are for x64 bit machine with an ubuntu x64 bit 16.04)

apt-get install fontconfig libfontconfig1 libxrender1 fontconfig-config
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
cd /usr/local/bin/
cp wkhtmltoimage /usr/bin/wkhtmltoimage
cp wkhtmltopdf /usr/bin/wkhtmltopdf
  1. Testing the installation of odoo is working correction (this is optional) :

    su odoo
    cd /home/odoo/odoo
    ./odoo-bin
    

Launch the browser http://<yourip>:8069 the odoo database creation page should open, tried to create a database Ctrl + c to kill the odoo process from the console Switch back to root user by exiting odoo user exit

Create Odoo boot script (init.d)


  1. Deploy init.d script to start odoo daemons (Odoo as system service) and start odoo automatically on system boot

12.1. Create a log directory

    su odoo
mkdir /home/odoo/log or /var/log.odoo

12.2. Create odoo config file: following command will generate the Odoo config file with all parameter set to give -c file path)

    cd /home/odoo/odoo
./odoo-bin -s -c /home/odoo/odoo.conf --stop-after-init --logfile=/home/odoo/log/odoo.log

12.3. Create the odoo daemons (init.d) file :

    exit 
    cp /home/odoo/odoo/debian/init /etc/init.d/odoo 

12.4. Update the odoo daemons (init.d) file permissions (linux accessrigths)

    chmod 755 /etc/init.d/odoo

12.5. Modify the odoo daemons (init.d) file parameters (Update odoo server executable file path, config file path and odoo log file path in daemons file )

    nano /etc/init.d/odoo


  12.5.1 Update file with the following lines (replace existing lines with this lines):


    DAEMON = /home/odoo/odoo/odoo-bin
CONFIGFILE = /home/odoo/odoo.conf
LOGFILE = /home/odoo/log/odoo-server.log

12.6 Testing the Odoo daemons (init.d) script :

    /etc/init.d/odoo start


   Test again on `http://<yourip>:8069`

12.7. Ensure that the Odoo daemons (init.d) script runs at on system boot at startup

    update-rc.d odoo defaults
  1. Running Odoo behind proxy servers (configure nginx for odoo: edit conf file), you can find nginx configuration at below URL:

  2. Basic Security Measures: Odoo more accessible on the port and change the master password 14.1. Update Odoo conf file from :

    vim /home/odoo/odoo.conf

Change following parameter

    admin_passwd = admin 
Xmlrpc_interface =
proxy_mode = False


 With 

    admin_passwd = your_secret_password
xmlrpc_interface = 127.0.0.1
proxy_mode = True

14.2 Finally Restart odoo server

    /etc/init.d/odoo restart

Important Tip !!!

For testing and production run Odoo in multi-processing mode to get maximum out of system. Out-of-box odoo runs on multi-threading mode which is not optimal for production.

More on understanding Odoo Server and Your deployment.