How to Install Odoo (Open Source ERP and CRM) in Ubuntu

Install Odoo

In today's fast-paced business landscape, enterprises are constantly seeking ways to optimize their operations and gain a competitive edge. One such solution that has been gaining widespread adoption is Odoo, the all-in-one business management software. Odoo offers a comprehensive suite of applications that seamlessly integrate various aspects of your business, from customer relationship management (CRM) to inventory control and accounting.

Introducing Odoo 17 on Ubuntu

In this step-by-step guide, we'll walk you through the process of installing Odoo 17 on the Ubuntu 24.04 and 22.04 operating systems. Odoo 17 is the latest version of this powerful software, packed with a range of new features and enhancements designed to streamline your business processes.

Preparing Your Ubuntu Environment

Before we dive into the installation process, let's ensure that your Ubuntu system is ready to accommodate Odoo 17. We'll start by updating the package list to ensure that we have the latest software versions available.

Updating the Package List

To update the package list, run the following commands:

sudo apt-get update
sudo apt-get upgrade

Installing Python Dependencies

Odoo 17 requires a number of Python dependencies to function properly. You can install these dependencies by running the following commands:

sudo apt-get install -y python3-pip python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev libssl-dev

sudo -H pip3 install --upgrade pip

Setting up the Odoo User and Database

Next, we'll create a dedicated system user for Odoo and set up the PostgreSQL database that Odoo requires.

Installing PostgreSQL

Odoo relies on PostgreSQL as its database backend. Install PostgreSQL using the following command:

sudo apt-get install -y postgresql

Creating a System User for Odoo

Create a new system user for Odoo with the following command:

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

Installing Odoo 17

Now that we have the necessary dependencies and user setup, let's proceed with the installation of Odoo 17.

Installing wkhtmltopdf

Odoo requires the wkhtmltopdf tool to convert HTML content into PDF format. Install it using the following command:

sudo apt-get install -y wkhtmltopdf

Installing Odoo 17

Switch to the Odoo user and download the Odoo 17 files from the GitHub repository:

sudo -u odoo -H git clone https://github.com/odoo/odoo.git -b 17.0 /opt/odoo/

sudo -u odoo -H /opt/odoo/odoo-bin -c /etc/odoo.conf --init=base

Now that Odoo 17 is installed, let's create a directory to store our custom Odoo add-ons:

sudo -u odoo -H mkdir /opt/odoo/addons

Configuring Odoo 17

Now that Odoo 17 is installed, let's set up the configuration file and create a system service to manage the Odoo process.Creating the Odoo Configuration File

To complete the installation, we need to create an Odoo configuration file. This file will contain the necessary settings, including the PostgreSQL user credentials. Let's create the file and add the following lines, replacing the password with a strong, secure password:

sudo nano /etc/odoo.conf
[options]
; This is the password that allows database operations:
admin_passwd = strong_password
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
; longpolling_port = 8072
logfile = /var/log/odoo13/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo13/addons,/opt/odoo/odoo13-custom-addons

Be sure to replace the strong_password with your preferred password.

Enabling and Starting the Odoo Service

Enable and start the Odoo service with the following commands:

sudo systemctl enable odoo

sudo systemctl start odoo

Accessing Odoo 17

With Odoo 17 now installed and configured, you can access the Odoo web interface by navigating to your server's IP address or domain name, followed by the port number 8069.

https://yourip:8069

https://yourdomain:8069

Logging in to Odoo

When prompted, enter the master password you specified in the Odoo configuration file to log in to the Odoo dashboard.

Setting up a Reverse Proxy with Nginx

To make your Odoo 17 instance accessible using a domain name, you can set up a reverse proxy with Nginx. This will allow you to access your Odoo website using a custom domain name instead of the server's IP address.

Installing Nginx

Install Nginx using the following command:

  1. sudo apt-get install -y nginx

Configuring the Nginx Reverse Proxy

Create a new Nginx server block with the following content:

sudo vi /etc/nginx/conf.d/odoo.conf
server {
listen 80;
server_name yourdomain.com;
access_log /var/log/nginx/odoo_access.log;
error_log /var/log/nginx/odoo_error.log;
proxy_buffers 16 64k;
proxy_buffer_size 128k;

location / {
proxy_pass http://127.0.0.1:8069;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}

location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://127.0.0.1:8069;
}

gzip on;
gzip_min_length 1000;
}

Restarting Nginx

Restart Nginx to apply the changes:

  1. sudo systemctl restart nginx

Conclusion

By following this step-by-step guide, you have successfully installed Odoo 17 on your Ubuntu 24.04 or 22.04 server. Odoo's comprehensive suite of applications can now be leveraged to streamline your business operations, from customer relationship management to inventory control and accounting.

If you found this tutorial helpful, be sure to share it with your colleagues and peers who may also benefit from the power of Odoo 17. Remember, the key to unlocking the full potential of Odoo lies in understanding its features and integrating it seamlessly into your business processes. Happy optimizing!

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply Cancel reply