November 2, 2022
Quickly then, let’s get down to business and understand the 16 easy steps to install Odoo in the Ubuntu 20.04 LTS server.
As a first step, we will update our existing packages and enable a few Odoo dependency repositories.
sudo apt install software-properties-common -y sudo add-apt-repository universe # libpng12-0 dependency for wkhtmltopdf sudo add-apt-repository ppa:linuxuprising/libpng12 -y
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ xenial main" sudo apt update sudo apt upgrade -y
Odoo stores data in a PostgreSQL database. Postgresql 12 comes by default with Ubuntu 22.04, so we can install it using the following command. Odoo 16 is also compatible with Postgresql versions 13, 14, 15.
sudo apt install postgresql postgresql-server-dev-all -y #Creating the ODOO PostgreSQL User sudo su - postgres -c "createuser -s odoo16"
#Installing Python 3 + pip3 sudo apt install git python3 python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev gdebi xfonts-base xfonts-75dpi -y sudo apt install libpng12-0 -y
#Installing nodeJS NPM and rtlcss for LTR support sudo apt install nodejs npm -y sudo npm install -g rtlcss sudo npm install -g less sudo npm install -g less-plugin-clean-css
wkhtmltopdf converts html content into pdf format. Using the wkhtmltopdf package, Odoo generates the reports in html format and then converts them to pdf.
sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb sudo apt install ./wkhtmltox_0.12.5-1.focal_amd64.deb
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/odoo --gecos 'ODOO' --group odoo # The user should also be added to the sudo'ers group. sudo adduser odoo sudo
Planning to upgrade to Odoo 16?
While the globally anticipated Odoo 16 version ushers in distinctive features for different modules, it is important to interpret its practical advantages for your business. Talk to our Odoo Experts now to know all about its productive application for your business. Click here now if your company is planning to upgrade to Odoo 16.
The logs of our Odoo instance will be stored in this directory.
sudo mkdir /var/log/odoo sudo chown odoo:odoo /var/log/odoo
It’s now time to get Odoo’s source code so that we can run it on our server.
sudo git clone --depth 1 --branch 16.0 https://github.com/odoo/odoo /opt/odoo/odoo16/server-addons
To install the Python packages needed for Odoo, we will use a Python virtual environment. In order to do that, let’s create and activate a python virtual environment.
sudo pip3 install virtualenv cd /opt/odoo/odoo16 virtualenv odoo-venv or python3 -m venv odoo-venv source odoo-venv/bin/activate
pip3 install -r /opt/odoo/odoo16/server-addons/requirements.txt pip3 install psycopg2-binary pdfminer.six num2words ofxparse dbfread ebaysdk firebase_admin pyOpenSSL
sudo chown -R odoo:odoo /opt/odoo/*
sudo su odoo -c "mkdir /opt/odoo/odoo16/odoo-custom-addons"
Odoo will use the config file to determine the database, port number, logfile location, etc., during runtime.
sudo touch /etc/odoo16.conf sudo nano /etc/odoo16.conf
[options] ; Database operations password: admin_passwd = PASSWORD db_host = localhost
db_user = odoo16 db_password = False http_port = 8069 logfile = /var/log/odoo/odoo16-server.log data_dir = /opt/odoo/odoo16/.local/share/Odoo addons_path = /opt/odoo/odoo16/server-addons/addons,/opt/odoo/odoo16/odoo-custom-addons
sudo chown odoo:odoo /etc/odoo16.conf sudo chmod 640 /etc/odoo16.conf
This service file will ensure that our Odoo system is up and running after every server restart.
sudo nano /etc/systemd/system/odoo16.service [Unit] Description=Odoo Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo PermissionsStartOnly=true User=odoo Group=odoo ExecStart=/opt/odoo/odoo16/odoo-venv/bin/python3 /opt/odoo/odoo16/server-addons/odoo-bin -c /etc/odoo16.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
sudo chmod 755 /etc/systemd/system/odoo16.service sudo chown root: /etc/systemd/system/odoo16.service
sudo systemctl start odoo16.service sudo systemctl status odoo16.service sudo systemctl restart odoo16.service sudo systemctl daemon-reload
sudo systemctl enable odoo16.service
Following these steps with the precise instructions provided should be good to help you set up Odoo in the Ubuntu 20.04 LTS server. For any queries, do reach out to us via the comments/reply section below. We always look forward to interacting with Odoo users to simplify any complexities pertaining to Odoo ERP.
Pragmatic Techsoft has many years of experience providing Odoo ERP software for a diverse range of industries. We have helped our clients with customized Odoo ERP systems to achieve their specific business goals right from the earlier versions of Odoo. Our software solutions have propelled the business capabilities of numerous organizations across 50+ countries for over a decade. With a vast range of custom modules to accommodate different business functions, you can optimize operations to their fullest potential. You can automate routine tasks and focus more on the things that need your immediate attention.
If you are planning to upgrade to Odoo 16 from any previous versions of Odoo, click here now to Talk to our Odoo experts.