Odoo is regarded as the world’s easiest all-in-one management software. Odoo’s modularity makes it the most sought after business application among the business communities. Apart from the list of fundamental management modules, Odoo encompasses more than 14,000 apps/plugins extending its managerial capabilities. And the astonishing fact is that every module is custom worked for various business needs. Odoo indeed promises to be the most significant and promising business application in the coming time.
This blog details you the steps to consider while installing Odoo 12 in the latest ubuntu 19.04. You might be knowing that the Ubuntu 19.04 Disco Dingo is not an LTS version, therefore not recommended wisely by many.
However, keeping into consideration the request of our readers, I hereby help you with the steps of installing Odoo 12 in Ubuntu19.04.
Follow the below steps to install Odoo 12 on Ubuntu 19 04
Step 1: Update the OS
First, you need to update your system with the below-mentioned command in the terminal.
sudo apt-get update
sudo apt-get upgrade
The above command will update & upgrade the package that needs upgrading, as well as new packages that have just come to the repositories.
Step 2: Secure Server
Run this command to make your server/system remotely accessible.
sudo apt-get install openssh-server fail2ban
OpenSSH is an implementation of the SSH protocol. OpenSSH allows you to log in to a remote computer or server and control it through a command-line interface.
Step 3: System User for Odoo
Now we have updated the package and installed OpenSSH, now the next step is to create a system user for Odoo. The below command line will create a system user to run Odoo service. The source code of Odoo will reside in the home directory of this user, here Odoois the user. In case if you need a different user other than this, just change the name “odoo” followed by the group.
sudo adduser --system --home=/opt/odoo --group odoo
Step 4: Install and Configure PostgreSQL
As you may be known PostgreSQL is the database used by Odoo, we need to install PostgreSQL in the system. PostgreSQL can be installed by using below command in Terminal.
sudo apt-get install postgresql
One the PostgreSQL installation is completed, we need to create a user in PostgreSQL for Odoo to manage the database. To create a user first we need to login to Postgresby using the below command.
sudo su - postgres
Once you run the above command, the system will switch you to the Postgres,
Now let us create the user for Odoo with below command in terminal.
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo12
Here “Odoo12” is the user in below command line. If required, you can change Odoo12 as per your requirement.
Note: While entering the above command thePostgres will prompt you to enter the password for the user. Its recommended toprovide a strong password and to remember the same.(if you don't need anypassword just press enter, which is not recommended)
Once the user is created, exit from Postgres by using the below command.
exit
Step 5:Installing dependencies for Odoo
As Odoo has dependiciene with some packages, and for better performance of packages, we need Python 3.
Where we will be installing these dependencies in Python 3. So required pip version 3 for that.
To install pip 3 use below command.
sudo apt-get install -y python3-pip
After the successful installation of pip3, install dependencies usingpip3. These dependencies you can find in requirements.txt
sudo pip3 install chardet decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 libsass lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycopg2 pydot pyldap pyparsing PyPDF2 pyserial python-dateutil pytz pyusb PyYAML qrcode reportlab requests suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd
While running the above command in the terminal if you find any failure in psycopg2 then try
sudo pip3 install psycopg2-binary
Now we need to install some web dependencies like Node.js and less. To install these dependencies run the below command on terminal.
sudo apt-get install -y npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less less-plugin-clean-css
sudo apt-get install -y node-less
To generate PDF reports in Odoo, we need to install the wkhtmltopdf.
You can download the latest version from this link
To download just use the below command in terminal.
sudo wget http://security.ubuntu.com/ubuntu/pool/universe/w/wkhtmltopdf/wkhtmltopdf_0.12.5-1_amd64.deb
Once you run the above command, the system will download the latest version of the wkhtmltopdf. Then install the downloaded package by using the below command.
sudo dpkg -i wkhtmltopdf_0.12.5-1_amd64.deb
This will install the wkhtmltopdf package in your system. Then run these two commands to ensure the smooth working of the package.
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
Step 6: Get Odoo
The next step is to download the Odoo. Here you can either download it from the Odoo’s website or Clone from Github repo.
Here we are cloning from Git.
So, first, we need to install git by issuing the below commands.
sudo apt-get install git
The following is to change our user as the system user which we have created for Odoo(in step3). Otherwise, the Odoo will end up with access to rights-related issues.
sudo su - odoo -s /bin/bash
Now we are ready to clone Odoo 12 (this is only for community edition)
git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 --single-branch .
Note the '.' at the end of the command. This will download Odoo source files to the home directory of the user (/opt/odoo).
Exit from Odoo user to continue the installation:
exit
Step 7: ConfigureOdoo
At first, we are creating a log file location for Odoo. Odoo will create and maintain its log files there.
sudo mkdir /var/log/odoo
Then provide the full access to this directory to the Odoo user. To do so, enter below command in the Terminal.
sudo chown odoo:root /var/log/odoo
After creating a log directory, we are going to create a configuration file for Odoo.
There is a configuration file that comes with the Odoo we just downloaded.
So we will copy that file to a more appropriate location
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
Then we have to make some changes in the configuration file, to edit the file, we can make use of the editor called nano. Below is the command for the same.
sudo nano /etc/odoo.conf
Here is an example of the configuration file:
[options]; This is the password that allows database operations:; admin_passwd = admindb_host = Falsedb_port = Falsedb_user = odoodb_password = False;This is the password of database which we have created in step4addons_path = /opt/odoo/addons; if you use enterprise edition just add the path separating with a comma(,)logfile = /var/log/odoo/odoo.log
By default, Odoo run in 8069port, however, if needed to run in a different port, just add below line to the config file
xmlrpc_port = 8001
Then save the file by CTRL+O and exit CTRL+X. After the configuration file is ready, we have to give the ownership of the file to the Odoo user. To do so makes use of below commands.
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
Step 8: Creating an odoo service
The next step is to create a system unit for Odoo so that it can start behaving like a service.
Create a new file odoo.service at /etc/systemd/system/ location. Belowmentioned the command for same.
sudo nano /etc/systemd/system/odoo.service
You can use this content for your file
[Unit]
Description=Odoo
Documentation=http://www.odoo.com
[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo
ExecStart=/opt/odoo/odoo-bin -c /etc/odoo.conf
[Install]
WantedBy=default.target
Since this is a service, we are giving full rights to this file to the root user.
sudo chmod 755 /etc/systemd/system/odoo.service
sudo chown root: /etc/systemd/system/odoo.service
Step 9: Test Odoo
sudo systemctl start odoo.service
You can check the log file of Odoo by entering
sudo tail -f /var/log/odoo/odoo.log
Step 10: Automating Starting of Odoo
This will enable the Odoo service to start automatically at boot time.
sudo systemctl enable odoo.service
Step 11: Access Odoo
Open a new browser window and enter HTTP://<your_domain_or_IP_address>:8069 in the address bar
If everything is working properly, you will redirect to Odoo'sdatabase creation page.
Have a look at the following blog to explore more about Install Odoo 16 Ubuntu. Install Odoo 16 Ubuntu