How to Install Odoo 18 CE on Ubuntu 24.04 LTS with Ngnix web server and SSL, Step-by-Step Guide

Odoo is a powerful and versatile open-source ERP (Enterprise Resource Planning) platform that offers a wide range of business applications, from CRM and inventory management to accounting and human resources. With the release of Odoo 18, users can expect improved features, performance enhancements, and new tools to streamline business operations.

In this guide, we’ll walk you through the step-by-step process of installing Odoo 18 Community Edition (CE) on Ubuntu 24.04 LTS. Ubuntu’s Long-Term Support (LTS) version ensures a stable and secure foundation for hosting your ERP system. We’ll also show you how to configure Odoo with Nginx as a reverse proxy and SSL encryption via Let's Encrypt to secure your platform for production use.

Whether you’re setting up Odoo for your internal business needs or deploying it for a client, this guide will help you with every step—from preparing your server to troubleshooting common issues.

By the end of this guide, you will have a fully functional Odoo 18 CE instance running on Ubuntu, accessible via a secure HTTPS connection. This ensures a modern, scalable, and efficient environment that can grow with your business. Let’s get started!/

Prerequisites

Before starting the installation of Odoo 18 CE on Ubuntu 24.04 LTS, make sure you have the following prerequisites in place:

Server Requirements

  • Operating System: Ubuntu 24.04 LTS (64-bit)
  • CPU: At least 2 vCPUs (4+ vCPUs recommended for production)
  • RAM: Minimum 2 GB (4-8 GB recommended for smooth performance)
  • Storage: At least 20 GB free disk space

User Access

  • A non-root user with sudo privileges.
  • SSH access to the server if working remotely.
Domain Name (Optional but Recommended)
  • A domain/subdomain if you want to access your Odoo instance via the web.
  • Point the domain/subdomain to your server’s IP address (A or CNAME DNS record).
Dependencies and Required Software
  • Python 3.10+
  • PostgreSQL (version 15 or higher) as the database backend.
  • Nginx as the reverse proxy (for production setup).
  • pip and Python virtual environment tools.
  • Certbot (for obtaining SSL certificates from Let's Encrypt).
  • Git for pulling Odoo source code.

SSL Certificate (for HTTPS)

  • Use Let’s Encrypt SSL certificates (free) or purchase an SSL certificate from a trusted provider for your domain.
  • Ensure port 80 (HTTP) and 443 (HTTPS) are open for SSL setup.
Ports Required
  • Port 8069: Default Odoo web interface port.
  • Port 80: HTTP (for Let’s Encrypt SSL challenge).
  • Port 443: HTTPS (for secure access).
Basic Knowledge
  • Familiarity with the Linux command line.
  • Basic understanding of PostgreSQL for database management.
  • Knowledge of web servers (Nginx) and SSL configuration.
With these prerequisites fulfilled, you’re ready to proceed with the installation of Odoo 18. Let’s move to the next section, where we will prepare the server and install the necessary dependencies. 

Step 1: Update the Package List and Upgrade Installed Packages

Ensure you have the latest packages installed.

sudo apt-get update && sudo apt-get upgrade -y


Step 2: Install Python 3 and Required Development Libraries

Odoo is a Python-based application, and its installation requires certain Python libraries and development tools to ensure it functions properly. This step focuses on installing Python 3, the package manager pip, and the essential libraries required for Odoo.

sudo apt-get install -y python3-pip
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 liblcms2-dev libblas-dev libatlas-base-dev


Step 3: Install Node.js and Less Plugins
Odoo uses Node.js for managing assets and stylesheets, which are essential for the front-end of the application. This step ensures that Node.js and the necessary Less plugins are installed and properly configured.

Some software may expect Node.js to be accessible via the command node. This command ensures that when the software calls node, it points to the correct executable.

sudo ln -s /usr/bin/nodejs /usr/bin/node

Before running this command, it is recommended to check if npm is already installed by running npm -v. If npm is not found, proceed to install it.

sudo apt-get install npm

Installing Less and its plugins allows Odoo to compile and optimize stylesheets, which enhances the front-end performance and appearance of the application:

sudo npm install -g less less-plugin-clean-css

The node-less package allows Odoo to process Less files during the asset management phase, ensuring that the styles are correctly applied to the web interface.

sudo apt-get install -y node-less


Step 4: Install PostgreSQL and Create a Database User
In this step, we will install PostgreSQL, the relational database management system (RDBMS) required by Odoo to store and manage data. We’ll also create a new database user that Odoo will use to connect to PostgreSQL.

First, we need to install PostgreSQL using the package manager. Run the following command:

sudo apt-get install -y postgresql

To manage PostgreSQL databases and users, we need to switch to the dedicated system user, postgres. This user is automatically created during PostgreSQL installation.

sudo su - postgres

We need to create a new PostgreSQL user specifically for Odoo. This user will be used by Odoo to connect to the database. Use the following command to create the user:

createuser --createdb --username postgres --no-createrole --superuser --pwprompt odoo18

Once you run this command, you will be prompted to enter and confirm a password for the odoo18 user. Ensure you remember the password, as it will be required when configuring Odoo later in step 8.

After creating the new PostgreSQL user, exit the postgres session and return to your regular user by typing:

exit


Step 5: Create a System User and Install Git
We’ll create a user to manage Odoo and install Git to download the source code.

This command establishes a dedicated user account to manage Odoo. Using a separate user for applications enhances security and ensures that the application has the appropriate permissions to access its files.

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

Git is essential for downloading the Odoo source code from its GitHub repository. It allows for easy updates and version management.

sudo apt-get install -y git

Switching to the odoo18 user allows us to perform operations with the permissions and environment settings associated with that user, which is necessary for managing Odoo.

sudo su - odoo18 -s /bin/bash

This command downloads the latest version of Odoo's source code, which is necessary for installation and setup.

git clone https://www.github.com/odoo/odoo --depth 1 --branch master --single-branch

After cloning the repository, this command exits the odoo18 user shell, returning to the previous user session.

exit


Step 6: Set up a Python Virtual Environment for Odoo

This command installs the python3-venv package, which is necessary for creating virtual environments in Python 3. By isolating dependencies, we can prevent conflicts with other Python projects or system packages.

Installing the Python Virtual Environment Package:

sudo apt install -y python3-venv

Creating a Python Virtual Environment:

sudo python3 -m venv /opt/odoo18/venv

Activate the virtual environment and install the required dependencies.

Switching to Root User

sudo -s

Changing to the Odoo Directory: Navigating to the Odoo directory ensures that the next commands are executed in the correct context, particularly for activating the virtual environment.

cd /opt/odoo18/

Activating the Virtual Environment: Activating the virtual environment modifies the shell's prompt and sets the Python interpreter to the one in the virtual environment. This means that any Python packages installed while this environment is active will only affect this environment.

source venv/bin/activate

Installing Required Python Packages: This command installs all the necessary dependencies required for Odoo to function correctly, as specified in the requirements.txt file. This file typically contains a list of libraries that Odoo depends on. Make sure you have the requirements.txt file in the /opt/odoo18/ folder. If not you can change the directory and run the command: 

pip install -r requirements.txt

Deactivating the Virtual Environment

deactivate


Step 7: Install wkhtmltopdf for PDF Reports

In this step, we will install wkhtmltopdf, a tool that allows Odoo to generate PDF reports. This is essential for generating printable documents like invoices, quotations, and other reports within Odoo. The installation involves downloading necessary packages and resolving dependencies.

Download wkhtmltopdf Package: This command downloads the wkhtmltopdf package, which is required for generating PDF reports in Odoo.

sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb

Download OpenSSL Dependency: This command downloads the OpenSSL library package, which is a necessary dependency for wkhtmltopdf to function correctly.

sudo wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb

Install OpenSSL Dependency: This command installs the OpenSSL library, resolving the dependency required by wkhtmltopdf.

sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

Install Additional Font Packages: This command installs the xfonts-75dpi package to ensure that wkhtmltopdf has access to the necessary font resources for rendering PDFs properly.

sudo apt-get install -y xfonts-75dpi

Install wkhtmltopdf Package: This command installs the wkhtmltopdf package, enabling Odoo to generate PDF reports.

sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

Fix Missing Dependencies: This command resolves any missing dependencies that may not have been installed during the previous steps. It ensures that all necessary packages are properly configured, allowing wkhtmltopdf to function as intended.

sudo apt install -f


Step 8: Configure Odoo 18

In this step, we will configure Odoo by creating a configuration file that specifies various settings needed for the application to run correctly. Proper configuration ensures that Odoo can connect to the database, manage add-ons, and log activity.

Copy the Default Configuration File: This command copies the default Odoo configuration file to a new location where Odoo will read its settings.

sudo cp /opt/odoo18/odoo/debian/odoo.conf /etc/odoo18.conf

Edit the Configuration File: This command opens the copied configuration file for editing, allowing you to customize the settings based on your requirements.

sudo nano /etc/odoo18.conf

Sample Configuration Settings
This section configures Odoo to connect to the PostgreSQL database with the specified user and password, manages add-ons, and sets up logging.


After opening the file in Nano, you will add the following configuration options: 

Do not forget to change the db_password to your password that you selected in the step 4.

[options]
admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo18
db_password = (Change it to your db password)
addons_path = /opt/odoo18/addons
logfile = /var/log/odoo/odoo18.log

Set Correct Permissions on the Configuration File: This command ensures that only the odoo18 user has ownership of the configuration file, enhancing security.

sudo chown odoo18: /etc/odoo18.conf

Restrict Access to the Configuration File: This command secures the configuration file by restricting access to only the odoo18 user and the group, preventing unauthorized access.

sudo chmod 640 /etc/odoo18.conf

Create a Directory for Odoo Logs: This command creates a dedicated directory for Odoo log files, helping to organize logs and maintain system clarity.

sudo mkdir /var/log/odoo

Set Ownership of the Log Directory: This command ensures that the odoo18 user has ownership of the log directory, allowing Odoo to write logs without permission issues.

sudo chown odoo18:root /var/log/odoo


Step 9: Create a Systemd Service for Odoo 18 CE
In this step, we will create a Systemd service file for Odoo 18. This service file allows Odoo to run as a service on the system, making it easier to manage its lifecycle, such as starting, stopping, and enabling the service to start on boot.

Create and open the service file in nano editor: This command creates a new service configuration file for Odoo, which will define how the Odoo application is managed as a service.

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

In the opened Nano editor, you will enter the following configuration: This configuration defines how Odoo will run as a service, including the user under which it runs, the command to start it, and the context in which it operates.

[Unit]
Description=Odoo18
Documentation=https://www.odoo.com
[Service]
Type=simple
User=odoo18
ExecStart=/opt/odoo18/venv/bin/python3.12 /opt/odoo18/odoo/odoo-bin -c /etc/odoo18.conf
[Install]
WantedBy=default.target
Set Permissions on the Service File: This command ensures that the service file is executable and readable by necessary users, while preventing unauthorized modifications.
sudo chmod 755 /etc/systemd/system/odoo18.service
Change Ownership of the Service File: This command secures the service file by ensuring that only the root user can modify it, which is standard practice for service files.
sudo chown root: /etc/systemd/system/odoo18.service
Reload the Systemd Daemon
sudo systemctl daemon-reload
Start the Odoo Service: This command starts the Odoo service, allowing it to run in the background.
sudo systemctl start odoo18.service
Enable the Odoo Service to Start on Boot: This command ensures that the Odoo service will start automatically whenever the server boots up, allowing for continuous operation without manual intervention.
sudo systemctl enable odoo18.service

Step 10: Verify Odoo Service

In this step, we will confirm that the Odoo service we configured and started in the previous steps is running correctly. This verification ensures that Odoo is operational and accessible through the web interface.


Check if Odoo is running correctly.

sudo systemctl status odoo18.service

Output Information

When you run the command, you will see output similar to the following:

● odoo18.service - Odoo 18
   Loaded: loaded (/etc/systemd/system/odoo18.service; enabled; vendor preset: enabled)
   Active: active (running) since [date and time]; [duration]
 Main PID: [PID number] (python3.12)
    Tasks: [number of tasks] (limit: [number])
   Memory: [memory usage]
   CGroup: /system.slice/odoo18.service
           └─[PID number] /opt/odoo18/venv/bin/python3.12 /opt/odoo18/odoo/odoo-bin -c /etc/odoo18.conf


After verifying that the service is running, you can access Odoo through your web browser at: http://your_IP_address:8069

Accessing Odoo

  1. Open a Web Browser: Use any web browser (e.g., Chrome, Firefox).
  2. Enter the URL: Type the full URL (e.g., http://192.168.1.100:8069) into the browser's address bar and press Enter.
  3. Odoo Login Page: If everything is configured correctly, you should see the Odoo login page. Here, you can enter your credentials (such as the admin password specified in the configuration) to access the Odoo interface.

Troubleshooting Tips

If the Odoo service is not running or you cannot access the web interface, consider the following steps:

  • Check Logs: Review the Odoo log file specified in the configuration (/var/log/odoo/odoo18.log) for error messages or warnings that may indicate what went wrong.
sudo less /var/log/odoo/odoo18.log

Restart the Service: If the service is inactive or not running, you can try restarting it:

sudo systemctl restart odoo18.service

Recheck Configuration: Ensure that the configuration file (/etc/odoo18.conf) contains the correct settings and that the database user has the necessary permissions.

Firewall Settings: If you cannot access the web interface, check the server's firewall settings to ensure that port 8069 is open:

sudo ufw allow 8069

Step 11: Install and Configure Nginx

In this step, we will install and configure Nginx as a reverse proxy for Odoo. This setup allows Nginx to manage incoming web requests, route them to the Odoo application, and handle various web server functionalities like SSL termination and load balancing.


This command installs Nginx, which will serve as a web server and reverse proxy for Odoo.

sudo apt -y install nginx

Allow Nginx through the Firewall: This command configures the firewall to allow traffic to and from the Nginx web server, enabling users to access Odoo over the internet.

sudo ufw allow "Nginx Full"

Create a server block for your domain: This command creates a new Nginx configuration file for your specific domain, allowing you to set up a server block.

/etc/nginx/sites-available/yourdomain.com: The path where configuration files for different Nginx server blocks are stored. Replace yourdomain.com with your actual domain name.

sudo nano /etc/nginx/sites-available/yourdomain.com

Nginx Configuration: Once you have the configuration file open, you will need to add the following code:

This configuration allows Nginx to act as a reverse proxy, directing traffic from your domain to the Odoo application while maintaining important header information.

server_name your_domain_here;: Replace your_domain_here with your actual domain name. This tells Nginx which domain this configuration applies to.

server {
    listen 80;
    server_name your_domain_here;

    access_log /var/log/nginx/odoo.access.log;
    error_log /var/log/nginx/odoo.error.log;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_pass http://localhost:8069;
    }
}

Enable the configuration and test Nginx: This command enables the server block by linking it from the available sites directory to the enabled sites directory, making it active.

sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/

Test Nginx Configuration: This command checks the Nginx configuration to ensure there are no syntax errors or issues before reloading the server.

sudo nginx -t

Output

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful


Restart Nginx:

sudo systemctl restart nginx

Secure Nginx with SSL (Optional): For production environments, it is highly recommended to secure your Nginx server with SSL certificates. You can use tools like Let's Encrypt to obtain free SSL certificates for your domain.

Check Logs: After setting up and restarting Nginx, you can check the access and error logs to verify that requests are being processed correctly:

sudo less /var/log/nginx/odoo.access.log
sudo less /var/log/nginx/odoo.error.log


Step 12: Set Up SSL with Certbot

In this step, we will secure your Odoo instance by installing an SSL certificate using Certbot. SSL encrypts the connection between the user’s browser and your server, making it safe to transmit sensitive data. Certbot is a free and open-source tool that automates the process of obtaining and installing SSL certificates from Let's Encrypt.


Install Certbot and its Nginx plugin: This command installs Certbot along with the Nginx plugin, which simplifies the process of applying SSL certificates to websites hosted by Nginx.

sudo apt install certbot python3-certbot-nginx

Obtain and install the SSL certificate: This command requests a new SSL certificate from Let's Encrypt for your domain and automatically configures Nginx to use it.

Replace your_domain_here with your actual domain name (e.g., example.com). You can also list multiple domains if needed (e.g., -d example.com -d www.example.com).

sudo certbot --nginx -d your_domain_here

Follow the Prompts

During the Certbot process, you will be prompted to:

  1. Agree to the Terms of Service: Certbot will ask if you accept Let's Encrypt’s terms.
  2. Provide a Contact Email: Certbot uses this email to send reminders when your certificate is about to expire.
  3. Enable HTTPS Redirection: You will be asked whether you want to redirect all HTTP traffic to HTTPS.
    • Choosing Yes ensures that any user accessing your site via http:// will be automatically redirected to https://.

Additional Steps

Renewal of Certificates:

Let's Encrypt certificates are valid for 90 days. Certbot installs a renewal cron job by default, which checks for renewal twice daily. You can also manually test the renewal process:

sudo certbot renew --dry-run

View Certificate Information:
You can see the installed certificates with:

sudo certbot certificates


Step 13: Access Odoo via Domain

You can now access your Odoo instance via: https://your_domain_here

If you come till here then Congratulations! You’ve successfully installed Odoo 18 Community Edition on Ubuntu 24.04 LTS with a web server and SSL. You are now ready to configure your Odoo instance, create databases, and start managing your business with Odoo’s powerful ERP features.

Feel free to contact us if you face any issue with the installation process. We help business to successfully implement Odoo ERP and customize it for their business needs. 


In Ariyes Online, we implement Odoo ERP and streamline your business processes with customized solutions, seamless integrations, and ongoing support to ensure your success. 

Contact us for a personalized meeting

Sign in to leave a comment
How to Choose the Right ERP System for Your Business
A Comprehensive Guide to Selecting the Ideal ERP System for Your Business Growth