Installing odoo v14/v15 on Ubuntu 20.04 VMWare [out-dated tuto !! ]

Summary:
1. create a virtual machine
2. virtual machine settings
3. install UBUNTU distribution
4. Install the PGI Odoo in CLI
A. Install PosteGreSQL
B. Install wkhtmltopdf
C. Get the odoo archive and create the installation file
D. Launch the installation
E. Logged in through the web interface

Amin
mabttech
9 min readFeb 14, 2022

--

I. VMware WorkStation Installation & Setting up Ubunutu 20.04

  1. First, you need to install VMWare Work station 16 Pro (the version that I’m using in my case, you can do install a higher version ofc) on windows 10 or higher.
VMware® Workstation 16 Pro

2. Install ubuntu 20.04 x64bit ( or higher version)

3. Open VMWare Work station then File > New Virtual Machine

select your hard ware specs : 2 RAM + 2 CPU + 20 Gb at least

Please select at least 20GB of HardDisk!

my VM settings , Please select at least 20GB of hard disk so you don’t encounter capacity issues later
change your VM keyboard (input source) to azerty: Settings > Region & Language
Ubuntu 20.04.3 LTS
apt-get upgrade

use this command to upgrade first :

apt-get upgrade

the upgrade will take a few mins to fully download

in case you get this error then

Install dpkg then you can use its commands:

apt install dpkg

You can find more about the installation on the odoo documentation: https://www.odoo.com/documentation/15.0/administration/install/install.html#prepare

Now you’re Ready to Go!

II. Odoo v14 / v 15 installation on your VMWare Ubuntu 20.04

Installation Documentation that will help you — need to check them out to verify that you’re on the right version :

Prepare

Odoo needs a PostgreSQL server to run properly. The default configuration for the Odoo ‘deb’ package is to use the PostgreSQL server on the same host as your Odoo instance. Execute the following command in order to install the PostgreSQL server:

After upgrades are done, Now you want to install PostgreSQL using the following command :

$ sudo apt install postgresql -y

https://www.odoo.com/documentation/15.0/administration/install/install.html#prepare

Warning:

wkhtmltopdf is not installed through pip and must be installed manually in version 0.12.5 for it to support headers and footers. See our wiki for more details on the various versions.
Also you can find more info here :
https://gist.github.com/ahmadhasankhan/7fd1fcd743fdac8472f04c72289f24cf

Install Wkhtmltopdf 0.12.5–1 on Ubuntu 18.4 :

https://gist.github.com/iifast1/018ebf54d6a05362f960463114c521b5

Run the following commands ( odoo v14 on ubuntu 20.04.3 LTS ) :

# sudo apt-get purge remove wkhtmltopdf
# sudo apt autoremove
# sudo apt update

Install Wkhtmltopdf 0.12.5

Install wkhtmltopdf & wkhtmltoimage on Ubuntu / Debian

This is for higher version wkhtmltopdf version 16 but we need version 15: https://computingforgeeks.com/install-wkhtmltopdf-on-ubuntu-debian-linux/

Install WKHtmlToPDF 0.12.5 on Ubuntu 20.04 :

https://www.syntaxis.be/fr_FR/blog/notre-blog-1/post/install-wkhtmltopdf-0-12-5-on-ubuntu-20-04-6

# wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb# sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb# sudo apt install -f
  • Identify the version wkhtmltopdf --version
https://gist.github.com/iifast1/018ebf54d6a05362f960463114c521b5

___________________________________________________________________

sudo -u postgres createuser --superuser $(whoami)sudo -u postgres createuser --superuser bitnami
sudo -u postgres createuser --superuser root

Configure Git :

apt install git 
git config --global user.name Yourgithubusername
git config --global user.email YourEmailAddress@gmail.com

Clone the Odoo codebase :

mkdir ~/odoo-dev
cd ~/odoo-dev
git clone -b 14.0 --single-branch --depth 1 https://github.com/odoo/odoo.git

Create an odoo-14.0 virtual environment and activate it :

https://linuxize.com/post/how-to-install-odoo-14-on-ubuntu-20-04/

Create an odoo-14.0 virtual environment and activate it :

cd ~/odoo-dev/odoo/python3 -m venv ~/venv-odoo-14.0apt install python3.8-venvpython3 -m venv ~/venv-odoo-14.0source ~/venv-odoo-14.0/bin/activate

Install all required Python modules with pip3 :

(venv)$ pip3 install wheel
(venv)$ pip3 install -r odoo/requirements.txt

Once done, deactivate the environment by typing:

(venv)$ deactivate

then :

#STEP 1 :  cd ~/odoo-dev/odoo/  #STEP 2 :  # open new terminal window in here to execute these line as root ( bitnami ) , so you don't get error you should get off the previous step (venv-odoo-14.0) then you will get no error !!! cd ~/odoo-dev/odoo/#execute this if command 'pip3' not found ! 
apt install python3-pip
pip3 install -r requirements.txt
#Step 6 : Install Python PIP Dependencies
sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev
sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/master/requirements.txt
# finally : pip3 install -r requirements.txt

..

To run odoo :

# cd ~/odoo-dev/odoo
# python3 odoo-bin

find out your Ip address :

method 1 — how to find out your id address on ubuntu 20.04 (from settings)
# apt install net-tools
# ifconfig

After running the app, open your browser then go to the following link :

https://localhost:8069/

method 2 — how to find out your id address on ubuntu 20.04 (from CLI)

Before creating the DataBase, just make sure you have the superuser already :

sudo -u postgres createuser --superuser $(whoami)sudo -u postgres createuser --superuser bitnami
sudo -u postgres createuser --superuser root

to create the odoo-testDataBase, Open new terminal then type the following commands :

Create and start your first Odoo instances :

To create odoo-test database : $ createdb odoo-testTo start your first Odoo instances:# cd ~/odoo-dev/odoo# python3 odoo-bin -d odoo-test -i base --addons-path=addons --db-filter=odoo-test$

Postgre SQL DB database manipulations :

https://www.odoo.com/documentation/15.0/fr/developer/howtos/rdtraining/02_setup.html#install-postgresql
$ sudo apt install postgresql postgresql-client
$ sudo -u postgres createuser -s $USER
$ createdb $DB_NAME #Create a database
$ dropdb $DB_NAME #Drop a database
$ psql $DB_NAME #Connect to a database

\l
#List all the available databases
\dt
#List all the tables of the $DB_NAME database
\d $TABLE_NAME
#Show the structure of the table $TABLE_NAME
\q #Quit the psql environment (ctrl + d)

As follows you will be to see your odoo-test database in the databases list :

Install Python Dependencies :

$ sudo -s $ sudo apt-get update$ 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 libpng12-0 libjpeg-dev gdebi -y

If you get the following error :

E:Package ‘libpng12–0’ has no installation candidate

Then execute this command :

$ sudo add-apt-repository ppa:linuxuprising/libpng12$ sudo apt update$ sudo apt install libpng12-0

and It will be fixed

You can find more info about it here :

Fix libpng12–0 Missing In Ubuntu 18.04, 19.10, 20.04 Or 20.10 : https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html

Steps To Install Odoo 14 In Ubuntu 18.04: https://www.candidroot.com/blog/our-candidroot-blog-1/post/how-to-install-odoo-14-on-ubuntu-18-04-66

HOW TO INSTALL ODOO 14 ON UBUNTU 20.04: https://technostore360.com/how-to-install-odoo-14-on-ubuntu-20-04/

https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html
https://www.linuxuprising.com/2018/05/fix-libpng12-0-missing-in-ubuntu-1804.html

Install Python PIP Dependencies :

$ cd ~/odoo-dev/odoo$ sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev
$ sudo -H pip3 install -r https://raw.githubusercontent.com/odoo/odoo/master/requirements.txt
$ pip3 install -r requirements.txt

.

https://www.candidroot.com/blog/our-candidroot-blog-1/post/how-to-install-odoo-14-on-ubuntu-20-04-lts-67
$ cd ~/odoo-dev/odoo$ python3 odoo-bin -d odoo-test -i base --addons-path=addons --db-filter=odoo-test$

After running odoo and not seeing anything on the https://localhost:8069/

if you get this error then it means you forgot to create a superuser

If you need RTL support, please install node and rtlcss via the following command:

$ sudo apt-get install nodejs npm -y$ sudo npm install -g rtlcss
open firefox or any browser then go to http://localhost:8069/

Helpful Links :

https://www.youtube.com/watch?v=OJTX7pJxpLI

https://medium.com/pythoneers/9-different-ways-to-embedded-code-in-medium-9213cb4c0a2e

https://techtutorguro.com/how-to-install-odoo-14-on-ubuntu-20-04/#6_Odoo_14_installation_and_configuration

https://linuxize.com/post/how-to-install-odoo-14-on-ubuntu-20-04/

Errors (VMWare 16 pro):

The capacity error I encounter

To avoid getting errors consider taking snapshots of your virtual machine using VMWare. so when an error occurs and you can’t figure it out, you can go back to the previous snapshot (version).

_____________________________

How to Execute :

sudo -s
cd ~/odoo-dev/odoo
python3 odoo-bin -i base -d odoo-test
How to execute your odoo on ubuntu

_____________________________

https://codepen.io/iifaster/pen/BamdgJP

--

--