Odoo is a suite of open-source business applications covering various needs such as CRM (Customer Relationship Management), e-commerce, accounting, inventory management, and project management. It is designed to be customizable and modular, allowing businesses to tailor it to their specific requirements.
Odoo is built on a modular architecture, meaning users can start with the basic modules and add more functionalities as needed. It offers both an open-source and free-to-use community edition and an enterprise edition with additional features and support, which requires a subscription fee.
In this tutorial, we will show you how to install Odoo 17 on Ubuntu 22.04.
Step 1 – Install Required Dependencies
Odoo is a Python-based software. Therefore, you will need to install Python and some additional dependencies on your server. You can install all of them using the following command:
apt-get install -y python3-pip python3-dev python3-venv 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 -y
Next, install the NPM package manager.
apt-get install -y npm
Then, install other dependencies using NPM.
npm install -g less less-plugin-clean-css
Next, install the node-less package.
apt-get install -y node-less
Next, download wkhtmltopdf package and install it using the following command:
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
apt install -f
Step 2 – Install PostgreSQL
Odoo uses PostgreSQL as a database backend. You can install it using the following command:
apt-get install postgresql -y
After the successful installation, verify the PostgreSQL status using the following command:
systemctl status postgresql
Output:
● postgresql.service - PostgreSQL RDBMS Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled) Active: active (exited) since Sat 2024-03-23 04:13:39 UTC; 9s ago Process: 16418 ExecStart=/bin/true (code=exited, status=0/SUCCESS) Main PID: 16418 (code=exited, status=0/SUCCESS) CPU: 1ms Mar 23 04:13:39 ubuntu22 systemd[1]: Starting PostgreSQL RDBMS... Mar 23 04:13:39 ubuntu22 systemd[1]: Finished PostgreSQL RDBMS.
Next, create a user for Odoo using the following command:
useradd -m -U -r -d /opt/odoo17 -s /bin/bash odoo17
Also, create the same user for PostgreSQL.
su - postgres -c "createuser -s odoo17"
Step 3 – Install and Configure Odoo
First, log in as an Odoo user and download the Odoo 17 using the following command:
su - odoo17 git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo17/odoo17
Next, create a Python virtual environment for Odoo.
cd /opt/odoo17 python3 -m venv odoo17-venv
Next, activate the virtual environment.
source odoo17-venv/bin/activate
Next, update the pip to the latest version.
pip install --upgrade pip
Next, install the Weel package.
pip3 install wheel
Next, install additional Python dependencies.
pip3 install -r odoo17/requirements.txt
Finally, deactivate from the Python virtual environment.
deactivate
Also, log out of the Odoo user.
exit
Next, create a directory to store Odoo addons and give it proper ownership.
mkdir /opt/odoo17/odoo17-custom-addons chown -R odoo17:odoo17 /opt/odoo17/odoo17-custom-addons
Next, create a log directory and file for Odoo and set proper permissions.
mkdir -p /var/log/odoo17 touch /var/log/odoo17/odoo17.log chown -R odoo17:odoo17 /var/log/odoo17
Next, create an Odoo configuration file.
nano /etc/odoo17.conf
Add the following lines:
[options] admin_passwd = master-password db_host = False db_port = False db_user = odoo17 db_password = False xmlrpc_port = 8069 logfile = /var/log/odoo17/odoo17.log addons_path = /opt/odoo17/odoo17/addons,/opt/odoo17/odoo17-custom-addons
Step 4 – Create a Systemd File for Odoo
You will also need to create a system file to manage the Odoo service.
nano /etc/systemd/system/odoo17.service
Add the following lines:
[Unit] Description=odoo17 After=network.target [email protected] [Service] Type=simple SyslogIdentifier=odoo17 PermissionsStartOnly=true User=odoo17 Group=odoo17 ExecStart=/opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin -c /etc/odoo17.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Save the file, then reload the systemd daemon.
systemctl daemon-reload
Now, start and enable the Odoo service.
systemctl start odoo17 systemctl enable odoo17
You can now check the Odoo status using the following command:
systemctl status odoo17
Output:
● odoo17.service - odoo17 Loaded: loaded (/etc/systemd/system/odoo17.service; disabled; vendor preset: enabled) Active: active (running) since Sat 2024-03-23 04:22:14 UTC; 8s ago Main PID: 34534 (python3) Tasks: 4 (limit: 9410) Memory: 73.7M CPU: 1.075s CGroup: /system.slice/odoo17.service └─34534 /opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin -c /etc/odoo17.conf Mar 23 04:22:14 ubuntu22 systemd[1]: Started odoo17.
Step 5 – Access Odoo Web Interface
At this point, Odoo has started listening on port 8069. You can now access it using the URL http://your-server-ip:8069. You will see the following screen.
Provide your master password and Odoo database and click on Create Database. You will see the Odoo 17 login page.
Provide your admin username and password and click on Log in. The Odoo dashboard will appear on the following screen.
Conclusion
Odoo offers a powerful platform for managing various aspects of your business, from CRM to accounting to project management and beyond. By following the steps outlined in this guide, you can successfully set up Odoo 17 on your Ubuntu 22.04 system. Now try to deploy Odoo 17 on dedicated server hosting from Atlantic.Net!