Odoo 17 Accounting Book - How to install Odoo in a Linux-based(Ubuntu) system?

Odoo can be used with Linux if properly configured based on the operating system and version of Odoo. You can set up Odoo on your Linux-based computer using the methods below.

Step 1: First, update your server and system to the latest available feature version.

                        sudo apt-get update
                        
                        sudo apt-get upgrade
                        

Step 2: The next step is to set up and secure a dedicated server for operations after the servers are upgraded.

                        sudo apt-get install openssh-server fail2ban
                        

Step 3: After the server is configured, you need to create a new Odoo user to act as an administrator and monitor operations.

                        sudo adduser --system --home=/opt/odoo --group odoo
                        

Step 4: You can configure the Odoo platform on your Linux-based system using PostgreSQL. First, install Postgres with the following Python code:

                        sudo apt-get install -y python3-pip
                        

You should now switch from PostgreSQL to Postgres, which will allow you to create and further manage your Odoo database:

                        sudo apt-get install postgresql 
                        

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 17 to install, you should create an Odoo 17 user:

                        createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt
                            odoo17 
                        

To gain access to advanced optional features, the newly created user in Odoo 17 should be configured as the root user, giving them system administrators:


                        psql
                        
                        

ALTER USER odoo17 WITH SUPERUSER;

Finally, exit out from the psql and Postgres:

                        
 \q
                        
                        
                        
exit
                        
                        

Step 5: Next, we need to install the Odoo dependencies on the dependencies specified for the platform.

                        sudo apt-get install -y python3-pip 
                        

Install Odoo platform dependency packages and libraries:

                        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

Finally, you should verify the installation with the newly installed 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

Step 6: Next, Github should be cloned:

Initially install the Github in the server and then clone it:

                        sudo apt-get install git 
                         

Don't forget to edit the system user before cloning, because according to Odoo it can't be done afterwards:

                        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 17.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 required Python packages: First, you need to install and configure the packages with pip3:

                        sudo pip3 install -r /opt/odoo/requirements.txt 
                        

Next, you need to download and install wkhtmltopdf for Odoo platform to support PDF report function:

                        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: Last but not least, you need to configure Odoo and related services.

Create a configuration file for platform features in the Odoo folder that can be copied to a specific 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 = odoo17
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
sudo chmod 640 /etc/odoo.conf

Next, create a directory of logs for the operations in Odoo:

                        sudo mkdir /var/log/odoo 
                        

Define and configure Odoo user access to the specified folder:

                        sudo chown odoo:root /var/log/odoo 
                        

Next, configure the required Odoo services:

                        sudo nano /etc/systemd/system/odoo.service 
                        

Now you need to put the snippet defined below in 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 need to assign the root user to the file you created:

                        sudo chmod 755 /etc/systemd/system/odoo.service
sudo chown root: /etc/systemd/system/odoo.service
whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message