Odoo 18 has been officially released, bringing a host of significant functional and technical enhancements. This new version is designed to further improve user experience and streamline business operations.
In this guide, we will walk you through the process of installing Odoo 18 on an Ubuntu 24.04 LTS server.
Step 1: Update the Server
Before proceeding with the installation of Odoo 18, verify that your Ubuntu 24.04 server is current. This will ensure you have the latest security fixes and software improvements.
1. Update the package list:
sudo apt-get update
2. Upgrade installed packages:
sudo apt-get upgrade
This operation might take several minutes, depending on how many updates are needed. After it is done, your server will be fully updated and set for the next procedures.
Step 2: Install Packages and Libraries
To make sure Odoo 18 runs effectively, you must install several important packages and libraries. Please follow these guidelines:
1. Install Python 3 Pip
Pip is the package installer for Python, required to manage Python libraries:
sudo apt-get install -y python3-pip
2. Install Development Libraries and Dependencies
These libraries are necessary for building and running Odoo and its dependencies:
sudo apt-get install -y python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev
3. Install Node.js and NPM
Node.js is required for front-end tasks:
sudo apt-get install -y npm
Create a symlink for Node.js to ensure compatibility with some applications:
sudo ln -s /usr/bin/nodejs /usr/bin/node
4. Install Less and Clean CSS Plugin
Less is a CSS pre-processor, and clean CSS helps minify CSS files:
sudo npm install -g less less-plugin-clean-css
sudo apt-get install -y node-less
Step 3: Set Up the Database Server
Odoo 18 operates with PostgreSQL as its database management system.
Use the following guidelines to install and configure PostgreSQL:
1. Install PostgreSQL:
sudo apt-get install -y postgresql
2. Switch to the PostgreSQL user:
sudo su - postgres
3. Create a new database user for Odoo:
createuser --createdb --username postgres --no-createrole --superuser --pwprompt odoo18
odoo18: This is the name of the PostgreSQL user.
4. Exit the PostgreSQL session:
exit
Step 4: Create a System User for Odoo
Having a specific system user for Odoo allows the application to function with the necessary permissions while preventing conflicts with other system operations.
Add a New System User: Set up a system user and designate a home directory for the installation of Odoo.
1. Create a system user with its home directory:
sudo adduser --system --home=/opt/odoo18 --group odoo18
--system: Sets up a system user with a lower user ID.
--home=/opt/odoo18: Designates the home directory for the new user.
--group odoo18: Establishes a group with the same name and associates the user with it.
This arrangement provides Odoo with a dedicated user and database, ensuring secure management of its operations. You are now prepared to move forward with the installation and configuration of Odoo.
Step 5: Get Odoo 18 Community Edition from GitHub
To install Odoo 18, clone the official repository from GitHub:
1. Install Git:
sudo apt-get install -y git
2. Switch to the Odoo system user:
sudo su - odoo18 -s /bin/bash
3. Clone the Odoo repository:
git clone https://www.github.com/odoo/odoo --depth 1 --branch master --single-branch .
4. Exit the Odoo user session:
exit
Step 6: Install Required Python Packages
Set up a Python virtual environment and install the required dependencies for Odoo 18:
1. Install the Python virtual environment package:
sudo apt install -y python3-venv
2. Create a virtual environment in the Odoo directory:
sudo python3 -m venv /opt/odoo18/venv
3. Activate the virtual environment:
sudo -s
cd /opt/odoo18/
source venv/bin/activate
4. Install Python dependencies:
pip install -r requirements.txt
5. Install wkhtmltopdf to generate PDF reports:
sudo 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
6. Deactivate the virtual environment:
deactivate
Step 7: Set Up the Configuration File
To configure Odoo, create and modify the configuration file:
1. Copy the default configuration file:
sudo cp /opt/odoo18/debian/odoo.conf /etc/odoo18.conf
2. Edit the configuration file:
sudo nano /etc/odoo18.conf
3. Set the necessary configuration options:
[options]
db_host = localhost
db_port = 5432
db_user = odoo18
db_password = 123456
addons_path = /opt/odoo18/addons
logfile = /var/log/odoo/odoo18.log
4. Set file permissions:
sudo chown odoo18: /etc/odoo18.conf
sudo chmod 640 /etc/odoo18.conf
sudo mkdir /var/log/odoo
sudo chown odoo18:root /var/log/odoo
Step 8: Create the System Service File
To manage Odoo as a service, create a systemd service file:
1. Create a new service file:
sudo nano /etc/systemd/system/odoo18.service
2. Add the following content:
[Unit]
Description=Odoo18
Documentation=http://www.odoo.com
[Service] Type=simple
User=odoo18
ExecStart=/opt/odoo18/venv/bin/python3.12 /opt/odoo18/odoo-bin -c /etc/odoo18.conf
[Install]
WantedBy=default.target
3. Set file permissions:
sudo chmod 755 /etc/systemd/system/odoo18.service
sudo chown root: /etc/systemd/system/odoo18.service
4. Start the Odoo service:
sudo systemctl start odoo18.service
Step 9: Access Odoo in the Browser
To access Odoo 18, open your browser and navigate to:
http://<your_domain_or_IP_address>:8069
Replace `<your_domain_or_IP_address>` with your server’s domain or IP address. Odoo uses port 8069 by default.
Step 10: Enable Odoo Service at Boot
To ensure Odoo starts automatically when the server boots:
sudo systemctl enable odoo18.service
Congratulations! Odoo 18 is now successfully installed on your Ubuntu 24.04 server, fully equipped for your business needs. By completing these steps, you have configured Odoo 18 to harness its robust ERP capabilities, allowing you to enhance your operational efficiency.