DevelopmentTutorials

Effortlessly Installing Odoo 13 on Ubuntu 22.04: A Step-by-Step Guide

Are you looking to streamline your business operations by implementing an effective Enterprise Resource Planning (ERP) system? Odoo 13 is a powerful and versatile open-source ERP software that can help you manage various aspects of your business, from accounting and inventory to sales and CRM. In this step-by-step guide, we’ll walk you through the process of effortlessly installing Odoo 13 on Ubuntu 22.04, so you can start reaping the benefits of this robust platform.

 Prerequisites

Before we dive into the installation process, ensure that you have the following prerequisites in place:

Ubuntu 22.04 Server: You should have a clean Ubuntu 22.04 server instance. You can set up a virtual machine or use a dedicated server.

Root Access: You’ll need root access or a user account with sudo privileges to execute some of the commands.

Domain Name: If you want to access Odoo through a domain name (recommended for production use), make sure your domain name is pointed to your server’s IP address.

Basic Knowledge: Familiarize yourself with basic Linux commands and concepts as you’ll need to use the terminal.

 Step 1: Update and Upgrade

Start by ensuring that your system is up-to-date:

sudo apt update
sudo apt upgrade

This will update the package list and upgrade the installed packages to the latest versions.

Step 2: Install Dependencies

Odoo relies on several external libraries and tools. Install the required packages:

sudo apt install python3-pip python-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev libopenjp2-7 libtiff5-dev libjpeg8-dev libjpeg-turbo8-dev libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev libjpeg8-dev libjpeg-turbo8-dev libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libxslt1-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev libopenjp2-7 libtiff5-dev libjpeg8-dev libjpeg-turbo8-dev libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev

 Step 3: Create a System User

It’s a good practice to create a system user for Odoo to enhance security. Create a system user named “odoo” and a system group named “odoo”:

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

 Step 4: Install and Configure PostgreSQL

Odoo uses PostgreSQL as its database backend. Install PostgreSQL and create a new PostgreSQL user for Odoo:

sudo apt install postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo

You’ll be prompted to set a password for the new PostgreSQL user.

Exit the PostgreSQL prompt:

exit

Step 5: Install and Configure Wkhtmltopdf

Wkhtmltopdf is a tool required for generating PDF reports in Odoo. Download and install it:

sudo apt install wkhtmltopdf

Step 6: Install and Configure Odoo Dependencies

Now, let’s install the Python libraries and other dependencies that Odoo requires:

sudo apt install python3-venv python3-wheel python3-setuptools python3-dev python3-pip
sudo pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vobject werkzeug XlsxWriter xlwt xlrd

Step 7: Download and Install Odoo

Now, it’s time to download Odoo and set up your Odoo configuration file. We will install Odoo from the official GitHub repository:

sudo su - odoo -s /bin/bash
git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 --single-branch .
exit
Step 8: Configure Odoo

Create a configuration file for Odoo in the `/etc/odoo` directory:

sudo mkdir /etc/odoo
sudo nano /etc/odoo/odoo.conf

Add the following configuration to the `odoo.conf` file:

[options]
; This is the password that allows database operations:
admin_passwd = your_admin_password
db_host = False
db_port = False
db_user = odoo
db_password = False
logfile = /var/log/odoo/odoo.log
addons_path = /opt/odoo/addons

Replace `your_admin_password` with a strong password of your choice.

Step 9: Set Up Log Directory

Create a directory for Odoo logs and give it proper permissions:

sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo

 Step 10: Create a Systemd Service

To manage Odoo as a service, create a systemd unit file:

sudo nano /etc/systemd/system/odoo.service

Add the following content to the `odoo.service` file:

[Unit]
Description=Odoo
Documentation=http://www.odoo.com
[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo
ExecStart=/opt/odoo/odoo-bin -c /etc/odoo/odoo.conf
[Install]
WantedBy=default.target

Step 11: Enable and Start Odoo Service

Enable the Odoo service to start at boot and then start it:

sudo systemctl enable odoo.service
sudo systemctl start odoo.service

Step 12: Configure Your Firewall

If you have a firewall enabled, make sure to allow traffic on the Odoo port (default is 8069):

sudo ufw allow 8069/tcp
Step 13: Access Odoo Web Interface

You should now be able to access the Odoo web interface by opening your browser and entering your server’s IP address followed by the port (e.g., `http://your_server_ip:8069`).

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button