Install Odoo 12 on Ubuntu 18.04

In this article, we will explain you have to install Odoo 12 on Ubuntu. Follow 8 easy steps for install Odoo 12 on Ubuntu. It is very easy to install Odoo in Ubuntu. Odoo is a most extensive open-source ERP that provides all business related application. Such as Accounting, CRM, Sales, Purchase, Project, Point of Sale, E-Commerce and many more. So Let’s start how to install and configure Odoo 12 in Ubuntu.

Install Odoo 12 on Ubuntu 18.04

Step 1 Update and Upgrade APT

First of all, update APT list of available packages and their versions. Later, use upgrade command to actually installs newer versions of the packages.

sudo apt-get update && sudo apt-get upgrade

Step 2 Install Prerequisite Dependencies

Next you have to install GIT, Python 3 pip, and other required packages to build Odoo dependencies.

sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less

Step 3 Install & Configure PostgreSQL

Later, you have to install PostgreSQL database server

sudo apt-get install postgresql -y

PostgreSQL access graphical interface, you need to install pgAdmin III.

sudo apt-get install pgadmin3

Setup a PostgreSQL user for Odoo

First, create a user for communicate between Odoo client and PostgreSQL database. You have an open terminal and execute the following command.

sudo su postgres

Create PostgreSQL user same as your system user using the following command.

createuser --createdb --username postgres --no-createrole --pwprompt USERNAME

How to find system user? If your terminal is twink@ubuntu18:/$ then "twink" is your username.

Next, when you execute the above command, it will prompt you password and confirm password. We will use this password later when we access the PostgreSQL database using pgAdmin III.

Enter password for new role: xxxx
Enter it again: xxxx

Later, the terminal asks you for new role be a superuser then provide “y” and press enter.

Shall the new role be a superuser? (y/n)  y

Note: If your terminal not asks you for new role then you might need to follow this comment answer.

Finally, the user created. Also, one more command you have to execute and exit it.

createdb stable --encoding=UNICODE
exit

Access PostgreSQL database using pgAdmin III

Open pgAdmin III, Goto File > Add Server. It opens the configuration window. Here you have to configure the same as below screen. Name and host set localhost. Rest of two username and password enter as per above configured.

PgAdmin III Configuration (Add Server)
PgAdmin III Configuration (Add Server)

Now your PostgresSQL and PgAdmin III configured, and they communicated.

Step 4 Download Odoo 12

Go to workspace path

cd /home/twink/workspace   // here "twink" is a username

Download Odoo 12 source code from Github

git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 --single-branch

Alternate you can download ZIP file from Github Odoo Repository.

Step 5 Install Python depended modules

Once the source code downloaded, You have to go to that directory. Here you see requirement.txt file. Python dependencies listed in the requirements.txt file. You have to execute the below command to install depended Python modules using pip3.

cd /12.0
sudo pip3 install -r requirements.txt

Step 6 Install Wkhtmltopdf

Download and install the Wkhtmltopdf package. The recommended version is 0.12.5 and is available on the wkhtmltopdf download page, in the archive section.

wget https://builds.wkhtmltopdf.org/0.12.1.3/wkhtmltox_0.12.1.3-1~bionic_amd64.deb
sudo apt install ./wkhtmltox_0.12.1.3-1~bionic_amd64.deb

Step 7 Start Odoo 12 Server

Even more, you have to find odoo-bin executable file in Odoo 12. You have to give the following access right to execute.

sudo chmod 775 odoo-bin

Finally, you have to execute the odoo-bin command to start Odoo 12 in your local machine.

./odoo-bin

Step 8 Go to Web browser

To access Odoo 12, go to the following URL and create a new database.

http://localhost:8069

Final Thoughts

This article walked you through the install Odoo 12 on Ubuntu 18.04 in the local machine. Even more, installed PgAdmin III, wkhtmltopdf, and other python dependencies.
You can explore here other Odoo related posts.

We hope you have found this article helpful. Let us know your questions or feedback if any through the comment section in below. You can subscribe our newsletter and get notified when we publish new articles. Moreover, you can explore here other Odoo related articles.

If you like our article, please consider buying a coffee for us.
Thanks for your support!

Support us on Buy me a coffee! Buy me a coffee!



10 Responses Leave a Comment

  1. Installed and works perfectly… Awesome….

  2. I can’t connect PostgreSQL because my terminal not ask me to assign superuser role.

    Any help?

    1. blank
      SpeedySense Editorial August 2, 2019 at 1:49 PM

      If your terminal not asks you for new role then you might need to execute following command to assign superuser rights to new user.

      $ sudo su postgres
      $ psql
      
      postgres=# \du;
                                          List of roles
       Role name  |                         Attributes                         | 
      ------------+------------------------------------------------------------+-----
       twink      | Create DB                                                  | {}
       postgres   | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
      
      
      postgres=# ALTER USER twink WITH SUPERUSER;
      ALTER ROLE
      postgres=# \du;
                                          List of roles
       Role name  |                         Attributes                         | 
      ------------+------------------------------------------------------------+-----
       twink      | Superuser, Create DB                                       | {}
       postgres   | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

      Try to recoonect PgAdmin again.

  3. How can I run Odoo via LAN?
    Thanks

    1. blank
      SpeedySense Editorial August 16, 2019 at 11:27 AM

      You probably need to read this thread.

  4. Sorry, it worked
    Thanks for your sharing

  5. how can I connect PostgreSQL database using pgAdmin III?

    1. blank
      SpeedySense Editorial September 1, 2019 at 7:05 AM

      Hi,

      You have to follow Step 3 “Setup a PostgreSQL user for Odoo” and “Access PostgreSQL database using pgAdmin III”.

  6. OSError: [Errno 98] Address already in use
    how can I fix this??

    1. blank
      SpeedySense Editorial September 23, 2019 at 5:14 PM

      Odoo is already running on port and you try to run on same port. There are two option you have
      1. Try to run Odoo in another port using --xmlrpc-port 8070 parameter.

      $ ./odoo-bin --addons addons/ --xmlrpc-port 8070

      2. You need to first kill Odoo service. Use below command to find Odoo service.

      $ ps ax|grep odoo
      17025 pts/0    Sl+    0:06 python3 ./odoo-bin --addons addons/

      Use following command to kill service

      $ sudo kill -9 17025

      Now you try to run Odoo.

Join the Discussion.