The Odoo can be used in Linux after configuring it successfully based on the version
of both the operating system as well as Odoo. Using the following steps, you can
install and start using Odoo in your Linux-based system.
Step 1:
First things first update the server and the system to the latest version of operations
that is available.
sudo apt-get update
sudo apt-get upgrade
Step 2:
Once the servers are updated the next aspect is to configure and secure a distinctive
server for the operations.
sudo apt-get install openssh-server fail2ban
Step 3:
Once the server is configured you need to create a new Odoo user to manage the operations
and this user will act as the admin.
sudo adduser--system--home=/opt/odoo--group odoo
Step 4:
By using PostgreSQL you can define the Odoo platform in your Linux-based system.
Initially, install the postgres using the following Python code:
sudo apt-get install -y python3-pip
Initially, install the postgres using the following Python code:
sudo apt-get install -y python3-pip
Now you should switch from PostgreSQL to Postgres allowing you to create an Odoo
database and further manage it:
sudo apt-get install postgres
Once Postgres is installed log in to postgres to create a new user for our instance.
sudo su -postgres
Now if you are using Odoo 16 to be installed you should create an Odoo 16 user:
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo16
To attain advanced optional privileges of operations the newly created user in
Odoo 16 should be assigned as the Superuser giving them the admin privileges
of operation:
psql
ALTER USER odoo16 WITH SUPERUSER;
Finally, exit out from the psql and postgres:
\q
exit
Step 5:
Next, we have to install the Odoo dependencies to the configured in the platform.
sudo apt-get install -y python3-pip
Install the dependency packages and libraries for the Odoo platform:
sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev
zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev
libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev
At last, you should verify the installation which has been done along with new dependencies which are being configured:
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
Step 6:
Next, Github should be cloned
Initially install the Github in the server and then clone it:
sudo apt-get install git
Do not forget to change the system user to Odoo before as it cannot be changed after cloning is done:
sudo su - odoo -s /bin/bash
You should perform the cloning form repository and respective branch of Github:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 16.0
--single-branch.
At last exit from the cloning and continue with the installation of Odoo:
exit
Step 7:
The next step is to install all the required python packages:
Initially using pip3 you need to install and configure the packages:
sudo pip3 install -r /opt/odoo/requirements.txt
Next, you need to download and install wkhtmltopdf for the Odoo platform to support the operation of PDF reports:
Sudo 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
Step 8:
Finally, you need to configure Odoo and its aligned services:
In the Odoo folder you need to create a configuration file for the operations of the platform which can be copied to a specified location:
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
Add all the required details to the file:
sudo nano /etc/odoo.conf
Update the configuration file:
[options]
; This is the password that allows database operations:
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo16
db_password = False
addons_path = /opt/odoo/addons
logfile = /var/log/odoo/odoo.log
Define and set up the access rights to files:
sudo chown odoo: /etc/odoo.conf
ssudo chmod 640 /etc/odoo.conf
Next, create a directory of logs for the operations in Odoo:
sudo mkdir /var/log/odoo
Set and configure the Odoo user permission to the defined directory:
sudo chown odoo:root /var/log/odoo
Next, configure the required Odoo services:
sudo nano /etc/systemd/system/odoo.service
Now you gave to place the snippet defined below into the 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
Next, you have to set up a root user for the file that you have created:
sudo chmod 755 /etc/systemd/system/odoo.service
sudo chown root: /etc/systemd/system/odoo.service
Step 8: Finally, you have to run Odoo.
Initially start the Odoo platform with the help of the following command:
sudo systemctl start odoo.service
Next, you have to check the status of the platform:
sudo systemctl status odoo.service
If the status indicates its active use the following URL to enter the platform.
“http://:8069”
Further, the log file can be inspected with the command:
sudo tail -f /var/log/odoo/odoo.log
To start the Odoo services once the system is booted the following command can be used:
sudo systemctl enable odoo.service
Following the entire steps mentioned above will ensure that your Odoo platform is successfully implemented and ready to run in the Linux-based system. Let's now move on to understanding the aspect of installing the Odoo platform in Windows-based systems or devices.