Odoo is a comprehensive software suite that helps businesses manage different functions, such as CRM, project management, accounting, e-commerce, billing, manufacturing, warehousing, and inventory control.
Odoo aims to offer a unified and efficient solution for various business needs. Odoo 17 has better features and usability.
This guide shows you how to install Odoo 17 on Ubuntu 22.04, a server operating system that is stable and supported. This installation is suitable for businesses that want to use Odoo in a dependable and secure environment.
To start off, update your system’s package list using the command :
sudo apt update
Then upgrade the existing packages to their latest version:
sudo apt upgrade
Odoo is a Python-based software suite that needs some other packages. To install them, use:
sudo apt install git python3-pip build-essential wget python3-dev python3-venv \
python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools \
node-less libjpeg-dev libpq-dev -y
Odoo should not run with root privileges for security reasons. You should create a specific system user, group, and home folder for Odoo:
This command will make a new user called ‘odoouser:
sudo useradd -m -d /opt/odoo17 -U -r -s /bin/bash odoouser
You can pick another username, but make sure it matches the PostgreSQL user and the information in the configuration file.
PostgreSQL is the database system that Odoo uses. In order to install it, refer to this article for detailed information.
The next step after installing is to create a Postgres user with the same name as before:
sudo su – postgres -c “createuser -s odoouser” This will make a PostgreSQL user called ‘odoouser’, who will manage the databases in Odoo.
Wkhtmltopdf is a free tool that you can use in the command line to turn HTML into PDF and different kinds of images. You need to install it to make PDF reports in Odoo.
sudo apt install ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb
Change User: Use the sudo su command to become the odoouser user:
su – odoouser
Get code: Download the Odoo17 source code from its official Github site:
sudo git clone https://www.github.com/odoo/odoo –depth 1 –branch 17.0 –single-branch
Go to Odoouser source code folder: cd /opt/odoo17/odoo
Prepare Python Environment: Make a Python virtual environment and turn it on: python3 -m venv venv && source venv/bin/activate
Install Python packages that Odoo needs: pip3 install wheel pip3 install -r requirements.txt
Next, make a configuration file for the Odoo server. This is important for customizing the Odoo app for your purposes. Start by changing the file at /etc/odoo17.conf with the text editor you like:
sudo nano /etc/odoo17.conf Add these lines to the file:
; Database operations password:
admin_passwd = PASSWORD
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo17/odoo/addons,/opt/odoo17/odoo/custom_addons
logfile = /var/log/odoo17.log
log_level = debug
Use a strong password for admin_passwd and save the file.
Next, change the owner and the rights of the configuration file to odoouser:
sudo chown odoouser:odoouser /etc/odoo17.conf
To manage your Odoo service better and make it run automatically when you start your system, you need to make a Systemd unit file. First, make and open a new file called odoo17.service:
sudo nano /etc/systemd/system/odoo17.service Then, copy and paste these lines into the file:
Description=Odoo 17.0 Service
ExecStart=/opt/odoo17/odoo/venv/bin/python3 /opt/odoo17/odoo/odoo-bin -c /etc/odoo17.conf
After saving and closing the file, you need to refresh the systemd daemon:
sudo systemctl daemon-reload
Then, turn on and run the Odoo service:
sudo systemctl enable –now odoo17.service
To see how the service is doing, use this command:
sudo systemctl status odoo17.service
The output should show that the Odoo service is working and running.
Odoo usually runs on port 8069. Go to your web browser and enter your Odoo server’s address on this port:
The first time you visit, you will see the Odoo database creation page. Enter the master password that you set in the odoo-server.conf file. Pick a name for your database, and a username and password for logging in to the Odoo dashboard later. If you need demo data, check the box for it.
Click “Create Database” to finish the setup.
After the Odoo database is created, you will be routed to the login page. Use the username and password you created to log in.
If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.