support Click to see our new support page.
support For sales enquiry!

How to Install Odoo 18 on Ubuntu 20.04

How to Install Odoo 18 on Ubuntu 20.04
Author

Sarin T COct. 11, 2024

In this blog post, you will learn how to install Odoo 18 on Ubuntu 20.04

There are some must followed steps involved in the installation and there are also some files that are necessary to install as a prerequisites.

Prerequisites

  • Access to the command line/terminal with sudo permissions.

  • Access to a browser.

  • Git installed.

  • Pip for Python 3 installed.

After meet all the prerequisites, follow the steps below to install Odoo 18 on Ubuntu in a Python virtual environment.

Installing Odoo in a virtual environment creates an isolated system and allows testing of different versions on the same machine.

Here are the steps to follow one by one to install Odoo 18.

In this blog post, you will learn how to install Odoo 18 on Ubuntu 20.04

There are some must followed steps involved in the installation and there are also some files that are necessary to install as a prerequisites.

Prerequisites

  • Access to the command line/terminal with sudo permissions.

  • Access to a browser.

  • Git installed.

  • Pip for Python 3 installed.

After meet all the prerequisites, follow the steps below to install Odoo 18 on Ubuntu in a Python virtual environment.

Installing Odoo in a virtual environment creates an isolated system and allows testing of different versions on the same machine.

Here are the steps to follow one by one to install Odoo 18.

STEP 1:Open the terminal and update the apt repository.

Update your server and then also upgrade it using below commands.

  • sudo apt-get update
  • sudo apt-get upgrade

Odoo requires Python 3.10 or later to run.

Step 2 : Install python 3.10 0n Ubuntu 20.04

Update Ubuntu Linux Before Installing Python 3.10

  • sudo apt update && sudo apt upgrade

Import Python PPA on Ubuntu

  • sudo add-apt-repository ppa:deadsnakes/ppa -y

Refresh APT Sources List for Python PPA on Ubuntu

  • sudo apt update

Install Python 3.10

  • sudo apt install python3.10
  • sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

Verifying the Python 3.10 Installation on Ubuntu

  • python3.10 --version

To install all the extra packages in Python 3.10 on Ubuntu

  • sudo apt install python3.10-full

STEP 3 : Create odoo user and odoo group.

  • sudo adduser -system -home=/opt/odoo18 -group odoo18

STEP 4 : Install and Configure PostgreSQL

Odoo needs a PostgreSQL database server to run properly. The default configuration for the Odoo 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.

  • sudo apt-get install -y postgresql

After the installation, Use the below commands to start the postgresql database server

  • sudo service postgresql start

Then create a database user for odoo18

  • sudo su - postgres
  • createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo18

You have to give a role password for the newly created role and verify it by giving the same password again.

  • /q
  • exit

Then restart the postgresql server

  • sudo service postgresql restart

STEP 5 : Install python and depended python packages on the server.

  • sudo apt-get install -y python3-pip

Step 6 : Install various development packages.

 

  • sudo apt-get install libpq-dev -y
  • sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev -y
  • sudo apt-get install libxml2-dev libxslt-dev -y

Install Python Dependencies for Odoo 18.

Switch into odoo user by

  • sudo su odoo18 -s /bin/bash 

and then install the dependency packages.

  • pip3 install psycopg2-binary
  • pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd polib

STEP 7 : Install Odoo 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
  • sudo apt-get install -y node-less
  • sudo python3 -m pip install libsass

STEP 8 : Install odoo 18 community version from GITHUB

Below command to install GIT on your system. If it is already there, then you can ignore this.

  • sudo apt-get install -y git

Then switch to odoo user

  • sudo su - odoo18 -s /bin/bash

Clone branch 18.0 of Odoo from Github:

  • git clone https://www.github.com/odoo/odoo --depth 1 --branch=master --single-branch

change the current working directory to a directory named “odoo”.

  • cd odoo/

Install Python dependencies

  • pip3 install -r requirements.txt

And exit from the odoo user

STEP 9 : Create an odoo configuration file

  • sudo vim /etc/odoo18-server.conf

Copy the below content in configuration file.

[options]

; This is the password that allows database operations:

; admin_passwd = admin

db_host = False

db_port = False

db_user = odoo18

db_password = False

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

addons_path = /opt/odoo18/odoo/addons,/opt/odoo18/odoo/odoo/addons

Change permission and also the user ownership of configuration file as below

  • sudo chown odoo18: /etc/odoo18-server.conf
  • sudo chmod 640 /etc/odoo18-server.conf

STEP 10 : Create odoo log file

  • sudo mkdir /var/log/odoo18
  • sudo chown odoo18:root /var/log/odoo18

 

STEP 11 : You can copy and paste the script to this file.

  • sudo vim /etc/init.d/odoo18-server

Then change ownership and permission

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

STEP 12 : Test the server running as service

To start the odoo server

  • sudo /etc/init.d/odoo18-server start

Stop the odoo server

  • sudo /etc/init.d/odoo18-server stop

View the odoo log files

  • tail -f /var/log/odoo18/odoo18-server.log

STEP 13 : Run Odoo locally

  • sudo su - odoo18 -s /bin/bash
  • python3 /opt/odoo18/odoo-bin

Then go to web browser to access odoo18

http://localhost:8069

or

http://0.0.0.0:8069

 

STEP 14 : Installing WKHTMLTOPDF

To print PDF reports need to install right version of wkhtmltopdf. (0.126-1)

  • wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
  • sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
  • sudo cp /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
  • sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf

 

0

Leave a Comment

Subscribe to our Newsletter

Sign up to receive more information about our latest offers & new product announcement and more.