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.
Read: Project Management Software: How Does It Aid Decision Making
Step 1:
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
Step 2:
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
Step 3:
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.
Step 4:
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.
Read: How to create a Sudo user on Ubuntu
Step 5:
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.
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
sudo apt install ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb
Step 6:
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
Read: How to install Python on Ubuntu 22.04
Step 7:
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:
[options]
; 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
Step 8:
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:
[Unit]
Description=Odoo 17.0 Service
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo17
Group=odoo17
ExecStart=/opt/odoo17/odoo/venv/bin/python3 /opt/odoo17/odoo/odoo-bin -c /etc/odoo17.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
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.
Step 9:
Odoo usually runs on port 8069. Go to your web browser and enter your Odoo server’s address on this port:
http://server-ip-host:8069
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.
The post How To Install Odoo 17 on Ubuntu 22.04 appeared first on net2.
Discover more from Ubuntu-Server.com
Subscribe to get the latest posts sent to your email.