Method 1: Install Odoo via the .deb package

  1. Install dependencies: Open a terminal and run the following command to get the necessary libraries. This includes Python packages, PostgreSQL, and wkhtmltopdf (which is required for PDF reports).

sudo apt-get update && sudo apt-get install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools nodejs npm -y

  1. Download the Odoo package: Download the nightly .deb package for the latest stable Odoo version. For Odoo 18, for example, use the following command:

wget https://nightly.odoo.com/18.0/nightly/deb/odoo_18.0.latest_all.deb

  1. Install Odoo: Install the downloaded .deb package.

`sudo apt install ./odoo_18.0.latest_all.deb

If dependency errors occur, run sudo apt install -f to fix them.`

  1. Configure PostgreSQL: Odoo uses a PostgreSQL database. The .deb package handles most of this, but you can create a dedicated user for Odoo for security.

`sudo su - postgres createuser —createdb —username postgres —no-createrole —no-superuser —pwprompt odoo exit

  1. Check the service status: Odoo installs as a systemd service. Check if it is running correctly.

sudo systemctl status odoo

    1. Access Odoo: Open a web browser and navigate to http://localhost:8069. On the first visit, you will be prompted to create your initial database and set up an administrator account.

Method 2: Install Odoo from source

  1. Install dependencies: First, ensure the system is up-to-date and install the necessary packages.

`sudo apt update sudo apt install git python3-pip python3-dev build-essential libxml2-dev libxslt1-dev libzip-dev libldap2-dev libsasl2-dev libjpeg8-dev libpq-dev wget libfreetype6-dev -y

  1. Install and configure PostgreSQL: `sudo apt install postgresql -y sudo su - postgres -c “createuser -s odoo”

  2. Create a system user: Create a dedicated, non-root user to run the Odoo service.

`sudo adduser —system —home=/opt/odoo —group odoo

  1. Download Odoo from Git: Clone the Odoo repository into the /opt/odoo directory. You will need to specify the branch for the version you want (e.g., 18.0).

sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 18.0 /opt/odoo/odoo-server

  1. Create and activate a Python virtual environment:

sudo python3 -m venv /opt/odoo/venv sudo -u odoo /opt/odoo/venv/bin/pip install -r /opt/odoo/odoo-server/requirements.txt

  1. Install wkhtmltopdf: Download and install the version of wkhtmltopdf required for your version of Odoo. For Ubuntu/Mint, you may need a specific version, such as the one from the Bionic repository.

cd /tmp wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb sudo apt install -f

  1. Create an Odoo configuration file: Create /etc/odoo.conf and paste the following content, adjusting the paths and database settings as necessary.

`[options] admin_passwd = your_secure_admin_password db_host = False db_port = False db_user = odoo db_password = False xmlrpc_port = 8069 addons_path = /opt/odoo/odoo-server/addons

Remember to replace your_secure_admin_password with a secure password.

  1. Create a systemd service: Create /etc/systemd/system/odoo.service with the following content to run Odoo as a service.

[Unit] Description=Odoo Requires=postgresql.service After=network.target postgresql.service

[Service] Type=simple User=odoo Group=odoo ExecStart=/opt/odoo/venv/bin/python3 /opt/odoo/odoo-server/odoo-bin -c /etc/odoo.conf StandardOutput=journal+console

[Install] WantedBy=multi-user.target

  1. Start and enable the Odoo service: sudo systemctl daemon-reload sudo systemctl enable --now odoo

  2. Access Odoo: Navigate to http://localhost:8069 in your web browser to complete the setup.