How To Install Odoo 15 Steps On A Ubuntu 20.04 LTS System Installation
How To Install Odoo 15 Steps On A Ubuntu 20.04 LTS System Installation
Make sure that all of the packages have been installed correctly
and that there are no issues. Some web dependencies must be
installed after the Python packages have been successfully
installed.
sudo apt-get install -y npm
Next, we'll make an Odoo15 database user. When you run the
following command, it will prompt you for a password, which you
must re-enter. Keep this in mind for future reference:
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo15
exit
The files will be added to the user's home directory after switching the
system user to 'odoo':
sudo su - odoo -s /bin/bash
The following command will clone the source directory, and the
operator dot(.) at the end of the command will clone the files to the
current user's home directory, which is /opt/odoo, which is the same
home directory specified when the user was created:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 --single-branch .
To operate Odoo smoothly, you must ensure that all of the packages
are installed correctly.
Step 8: Download and install Wkhtmltopdf.
Odoo allows you to print reports as PDF files. Wkhtmltopdf aids in the
creation of PDF reports from HTML data. Furthermore, the report
engine converts the Qweb template reports to HTML format, and
Wkhtmltopdf generates the PDF report:
sudo wget
https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5
-1.bionic_amd64.deb
This file contains sample values, and you should edit the file with
proper values:
sudo nano /etc/odoo.conf
db_host = False
db_port = False
db_user = odoo15
db_password = False
addons_path = /opt/odoo/addons
logfile = /var/log/odoo/odoo.log
The following aspects should be configured before the operations are
conducted:
db_user: the database user name.
db_password: provide db user password which is given while
creating the db user.
admin_passwd: This is the master password of Odoo which is used
to perform database operations in the database manager like create,
delete, duplicate, and many more.
db_host: the database host.
db_port: the database port.
addons_path: provide the path of directories that contain the Odoo
addons directories. You can mention multiple directories separated by
commas:
Eg: addons_path = /opt/odoo/addons, /opt/odoo/enterprise,
/opt/odoo/custom
logfile: the log file path.
Finally, you should set access rights of the conf file for the system
user odoo:
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
Also, as we did before, establish a log directory to store the odoo log
file, which will aid you in locating Odoo-related issues, and configure
rights for the user odoo:
sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo
Step 10: Odoo service file
Finally, we have to create a service to run Odoo. Let’s create a service file
‘odoo.service’ in /etc/systemd/system:
sudo nano /etc/systemd/system/odoo.service
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 set the permissions for the root user to this service file:
sudo chmod 755 /etc/systemd/system/odoo.service
Now all the steps of installation are completed. Let's test the Odoo instance
with the following command:
sudo systemctl start odoo.service
Then check the status of the service using the following command. And if it
depicts as active, the installation of Odoo was successful:
sudo systemctl status odoo.service
You can also check the logs of Odoo platform that you have set up if you
are facing any issues related to the installation or any other reasons with
the following command. This command will show you the live logs in the
terminal:
sudo tail -f /var/log/odoo/odoo.log
At last, if you want to start the Odoo service automatically after rebooting
the server, use the following command:
sudo systemctl enable odoo.service
If you have made any changes in the addons, restart the Odoo service to
reflect the updates on your instance using the following command:
sudo systemctl restart odoo.service