We used cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. What For?

« Back to Blogs

Setup Odoo v10 as a Service on Ubuntu

Setup Odoo v10 service on ubuntu

 

Odoo is one of the most popular and most powerful Open Source ERP business software based on the Python programming language. In this post, we will give you exact idea about how to install Odoo 10 community version On an Ubuntu system. The installation of Odoo 10 on an Ubuntu and setup as a service should take a few minutes if you follow the very easy steps described below:

 

Step 1: Creating system user:

  • Create a new user for odoo by using below command if already exist then skip it.

    • sudo adduser “username”

 

Step 2: Installing Postgres Database Server:

  • Execute below command to update the packages from the repositories and update them to get information of packages and their dependencies.

    • sudo apt-get update

  • Now install postgres database server by executing below command.

    • sudo apt-get install postgresql-9.3

  • Install pgadmin only when user want to access database using postgres client.

    • sudo apt-get install pgadmin3

 

Step 3: Installing necessary packages required for using Odoo:

  • Odoo is a powerful software and has lot of dependencies. Run the following command to download all the necessary packages.

    • sudo apt-get install python-dateutil python-feedparser python-gdata python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-dateutil python-feedparser python-pip python-dev libevent-dev gcc libxml2-dev libxslt-dev node-less

  • Python is the core language of Odoo. So, it is necessary to get required python packages. Do so by executing the following commands in the terminal:

    • sudo apt-get install python-dateutil python-decorator python-docutils python-feedparser \python-gdata python-gevent python-imaging python-jinja2 python-ldap python-libxslt1 python-lxml \python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 python-pybabel \python-pychart python-pydot python-pyparsing python-pypdf python-reportlab python-requests \python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-werkzeug \python-xlwt python-yaml

    • sudo apt-get install curl

    • curl -sL https://deb.nodesource.com/setup_0.10 | sudo bash -

    • sudo apt-get install python-software-properties

    • sudo apt-add-repository ppa:chris-lea/node.js

    • sudo apt-get install python-geoip

  • Install Odoo Web dependencies using following commands:

    • sudo apt-get install -y nodejs

    • sudo npm install -g npm

    • sudo npm install -g less less-plugin-clean-css

 

Step 4: Create a User for PostgreSQL:

  • Create a new database role with same name as you are using for login into system by using below commands:

    • sudo su postgres

    • createuser -P -s -e odoo

    • psql

    • ALTER ROLE odoo WITH SUPERUSER CREATEDB CREATEROLE REPLICATION;

    • Press Ctrl + d two times to exit.

 

Step 5: Setup and Configure Odoo Server:

  • Create odoo directory by typing the following code.

    • sudo mkdir /opt/odoo

  • Copy this odoo folder “/opt/odoo” using below command:

    • sudo cp -r “odoo_folder_name” /opt/odoo/

  • Create odoo configuration file by following command:

    • sudo nano /etc/odoo10-server.conf

  • Copy below contents into odoo10-server.conf file.

 

[options]

; This is the password that allows database operations:

admin_passwd = admin

db_host = localhost

db_port = 5432

xmlrpc_port = 8069

db_user = {USERNAME}

db_password = {PASSWORD}

addons_path =  /opt/odoo/odoo-10.0/addons

logfile = /var/log/odoo/odoo10-server.log

db_template = template1

dbfilter = .*

debug_mode = False

demo = {}

dev_mode = False

email_from = False

geoip_database = /usr/share/GeoIP/GeoLiteCity.dat

import_partial =

limit_memory_hard = 2684354560

limit_memory_soft = 2147483648

limit_request = 8192

limit_time_cpu = 120

limit_time_real = 240

list_db = True

log_db = False

log_db_level = warning

log_handler = :INFO

log_level = info

logrotate = True

longpolling_port = 8072

max_cron_threads = 2

osv_memory_age_limit = 1.0

osv_memory_count_limit = False

pg_path = None

pidfile = False

proxy_mode = False

reportgz = False

server_wide_modules = None

smtp_password = False

smtp_port = 25

smtp_server = localhost

smtp_ssl = False

smtp_user = False

syslog = False

test_commit = False

test_enable = False

test_file = False

test_report_directory = False

translate_modules = ['all']

unaccent = False

without_demo = False

workers = 3

xmlrpc = True

xmlrpc_interface =

 

  • Change ownership and permissions of “odoo” folder using following commands:

    • sudo chown odoo: -R /opt/odoo

    • sudo chmod -R 755 /opt/odoo

    • sudo chown odoo: /etc/odoo10-server.conf

    • sudo chmod 740 /etc/odoo10-server.conf

  • Create service file named “odoo10-server” using following command:

    • sudo nano odoo10-server

  • Copy below contents into odoo10-server file.

 

[options]

; This is the password that allows database operations:

admin_passwd = admin

db_host = localhost

db_port = 5432

xmlrpc_port = 8069

db_user = {USERNAME}

db_password = {PASSWORD}

addons_path =  /opt/odoo/odoo-10.0/addons

logfile = /var/log/odoo/odoo10-server.log

db_template = template1

dbfilter = .*

debug_mode = False

demo = {}

dev_mode = False

email_from = False

geoip_database = /usr/share/GeoIP/GeoLiteCity.dat

import_partial =

limit_memory_hard = 2684354560

limit_memory_soft = 2147483648

limit_request = 8192

limit_time_cpu = 120

limit_time_real = 240

list_db = True

log_db = False

log_db_level = warning

log_handler = :INFO

log_level = info

logrotate = True

longpolling_port = 8072

max_cron_threads = 2

osv_memory_age_limit = 1.0

osv_memory_count_limit = False

pg_path = None

pidfile = False

proxy_mode = False

reportgz = False

server_wide_modules = None

smtp_password = False

smtp_port = 25

smtp_server = localhost

smtp_ssl = False

smtp_user = False

syslog = False

test_commit = False

test_enable = False

test_file = False

test_report_directory = False

translate_modules = ['all']

unaccent = False

without_demo = False

workers = 3

xmlrpc = True

xmlrpc_interface =

 

  • Copy “odoo10-server” file to “/etc/init.d/ folder using following command:

    • sudo cp -f odoo10-server /etc/init.d/

  • Change ownership and permissions of “odoo10-server” using following command:

    • sudo chown odoo: -R /etc/init.d/odoo10-server

    • sudo chmod -R 755 /etc/init.d/odoo10-server

  • Create a log file using following command:

    • sudo mkdir /var/log/odoo

    • sudo touch /var/log/odoo/odoo10-server.log

    • sudo chown odoo: -R /var/log/odoo

    • sudo chmod -R 777 /var/log/odoo/odoo10-server.log

  • Start odoo server odoo user using following command mentioned in below url:

    • service odoo10-server start

  • Execute below command to see the log file for odoo:

    • sudo tail -f /var/log/odoo/odoo10-server.log

  • Stop odoo server odoo user using following command:

    • service odoo10-server stop

  • Change permission of pid file using following command:

    • sudo chown odoo: -R /opt/odoo/odoo10.pid

    • sudo chmod -R 755 /opt/odoo/odoo10.pid

  • Make this server start and stop automatically using below command:

    • sudo update-rc.d odoo10-server defaults

  • If you want to disable existing odoo service you can use following command:

    • sudo update-rc.d odoo-10.0 disable

 

Step 6: wkhtltopdf library required to print reports from odoo:

  • Install the package using command:

    • sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb

  • Copy wkhtmltoimage to /usr/bin location from /usr/local/bin by using below command:

    • sudo cp /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage

  • Copy wkhtmltopdf to /usr/bin location from /usr/local/bin by using below command:

    • sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf


For more implementation details or support, you may contact us at [email protected].

contact-us Request a callback WhatsApp