Email – info@odoo-india.com

Call us – +91 9971800665

 

Odoo Installation

There are mutliple ways to install Odoo, or not install it at all, depending on the intended use case. This documents attempts to describe most of the installation options.

Build your server

Create the Odoo user that will own and run the application

Install and configure the database server, PostgreSQL

Get the Odoo server

Installing Python libraries for the server

Configuring the Odoo application.

Installing the boot script.

Setting up the log directory.

Testing the server.

a

Automating Odoo startup and shutdown.

How To install Odoo-10 on Ubuntu Server 16.10

One can simply download a .deb (for Debian/Ubuntu) or .rpm (Redhat/CentOS) package of Odoo 10 and install that. For a fine grained control of the installation, we use the following procedure for the installation.

Step 1. Build your server

Once you have logged into your server (using SSH in case of remote or cloud server), we need to update the package lists for the latest packages:

sudo apt-get update
sudo apt-get dist-upgrade

 

Step 2. Create the Odoo user that will own and run the application

The following command will create a new group “odoo”, a new system user “odoo” which will have the home directory as /opt/odoo. This is where we will keep our odoo files. The user is a system user, ie., it can not be looged in using SSH or from front end. We will use this new user to own and run the application.

sudo adduser –system –home=/opt/odoo –group odoo

 

Step 3. Install and configure the database server, PostgreSQL

Now we need to setup postgresql server on our server. For the same, we will install the latest release of postgresql and create a new user on the same.

sudo apt-get install postgresql

Then configure the Odoo user on postgres:

First change to the postgres user so we have the necessary privileges to configure the database.

sudo su – postgres

Now create a new database user. This is so Odoo has access rights to connect to PostgreSQL and to create and drop databases. Remember what your choice of password is here; you will need it later on.

createuser –createdb –username postgres –no-createrole –no-superuser –pwprompt odoo
Enter password for new role: ********
Enter it again: ********

In case you decide to use a different database user, then you need to note the same. We will be needing it later on during configurations.

Finally exit from the postgres user account:

exit

Step 4. Get the Odoo server

Install Git.
sudo apt-get install git

Switch to the Odoo user:
sudo su – odoo -s /bin/bash

Grab a copy of the most current Odoo 10 branch (Note the “.” at the end of this command!):
git clone https://www.github.com/odoo/odoo –depth 1 –branch 10.0 –single-branch .

Once the odoo is downloaded, exit the Odoo user shell

exit

 

Step 5. Installing Python libraries for the server

We need to resolve the python libraries to run Odoo. For this, we will install the following packages on the server.

sudo apt-get install -y python-pip wkhtmltopdf libpq-dev python-dev libxml2-dev libxslt1-dev zlib1g-dev libldap2-dev libsasl2-dev

Odoo package maintains a requirements file with properly defined package name and the version. We will use the same to install the requirements.

sudo pip install -r /opt/odoo/requirements.txt

The following commands will be required to resolve the web dependencies –

sudo apt-get install -y npm

sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less less-plugin-clean-css

Step 6. Configuring the Odoo application

The default configuration file for the server (/opt/odoo/debian/odoo-server.conf) is actually very minimal and will, with only a small change work fine so we’ll copy that file to where we need it and change it’s ownership and permissions:

sudo cp /opt/odoo/debian/odoo.conf /etc/odoo-server.conf
sudo chown odoo: /etc/odoo-server.conf
sudo chmod 640 /etc/odoo-server.conf

We need to make the configuration for our application. For the same, we will make the following changes in the configuration file –

  1. Database settings –

If we do not provide the database settings, then the system assumes the default settings. However, we like to provide the basic details:

db_host = localhost. If the postgres is installed on a different host, then you need to provide the same here.

db_port = 5432. This is the default port by postgres. In case of different port, provide the same.

db_user = odoo. The same user as given in step 3.

db_password = False to the same password used back in step 3.

  1. Addons path

addons_path = /usr/lib/python2.7/dist-packages/odoo/addons so that it reads addons_path = /opt/odoo/addons instead.

  1. Logfile settings

We need to maintain the server logs. For the same, we need to provide some configurations such as –

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

By default, Odoo keeps only 1 file for the logs. But we like to maintain daily logfiles. This is more helpful in debugging. This can be configured by –

logrotate = True

 

Step 7. Installing the boot script

By going with our Last step, You need to get a script installed and in-turn it will help to start and shut down the server automatically and also minitor the application as the correct user during run time. There script you can use in /opt/odoo/debian/init but this will need a few small modifications to work with the system installed the way it has been described above. The same can be copied from here. (This script has been provided by the opensourcerer team and we thank them for the same). We have also developed an enhanced script to update the modules on a specific database from the terminal end. It can be provided on request.

Download the file using the following command –

sudo wget -O /etc/init.d/odoo-server https://goo.gl/HD4WcZ

sudo chmod 755 /etc/init.d/odoo-server
sudo chown root: /etc/init.d/odoo-server

Note: In Odoo 10, the main file has been changed to `odoo-bin`. Using your favorite editor, open the /etc/init.d/odoo-server file and and change the line that reads DAEMON=/opt/odoo/odoo-server to DAEMON=/opt/odoo/odoo-bin

Step 8: Setting up the log directory

In the configuration file there’s an entry for the server’s log file. We need to create that directory first so that the server has somewhere to log to and also we must make it writeable by the Odoo user:

sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo

Step 9. Testing the server

To start the Odoo server type:

sudo /etc/init.d/odoo-server start

You should now be able to view the logfile and see that the server has started.

tail -f /var/log/odoo/odoo-server.log

 

If the log file looks OK, now point your web browser at the domain or IP address of your Odoo server (or localhost if you are on the same machine) and use port 8069. The url will look something like this:

http://IP_or_domain.com:8069

 

If you want to make sure the server stops properly:

sudo /etc/init.d/odoo-server stop

Check the log file again to make sure it has stopped and/or look at your server’s process list.

Step 10. Automating Odoo startup and shutdown

If everything above seems to be working OK, the final step is make the script start and stop automatically with the Ubuntu Server. To do this type:

sudo update-rc.d odoo-server defaults

Please feel free to ask us for odoo installation help if again with the above document you are still facing problems, We will assist you for sure by getting below details: