Zalino Logo white

How to Install Odoo 18 on Ubuntu 24.04 | Step by Step Guide (Virtual Environment Setup)

How to Install Odoo 18 on Linux/Ubuntu Server Using Virtual Environment

Here’s a step-by-step guide to install Odoo 18 on Ubuntu Server – Version 24

Step 1: Create System User

sudo adduser --system --home=/opt/odoo18 --group odoo18
sudo usermod -s /bin/bash odoo18

    
Step 2: Install Required Packages

sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3 python3-pip python3-venv \
    build-essential libpq-dev libxml2-dev libxslt1-dev \
    libldap2-dev libsasl2-dev libtiff5-dev libjpeg-dev \
    libopenjp2-7-dev zlib1g-dev libfreetype6-dev \
    liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev \
    libxcb1-dev libpq5 wkhtmltopdf

    
Step 3: Install PostgreSQL and Create User

sudo apt install -y postgresql
sudo -u postgres createuser -s odoo18


    
Step 4: Get Odoo Source Code

#Switch to odoo18 user:

sudo -i -u odoo18

#Clone Odoo 18 source code:

cd /opt/odoo18
wget https://github.com/odoo/odoo/archive/refs/heads/18.0.zip -O odoo18.zip

#Unzip & remove extra content:

unzip odoo18.zip
mv odoo-18.0/* odoo-18.0/.[!.]* .
rm -rf odoo-18.0 odoo18.zip

    
Step 5: Create Python Virtual Environment

#Inside /opt/odoo18:
cd /opt/odoo18
python3 -m venv venv
source venv/bin/activate

#Upgrade pip:
pip install --upgrade pip wheel setuptools

#Install Python dependencies:
pip install -r requirements.txt

#Deactivate venv & exit from odoo18 user:
deactivate
exit

    
Step 6: Create Odoo Configuration File
Create & edit a file witn name 'odoo18.conf' inside etc:

sudo nano /etc/odoo18.conf

    
Add the following content in 'odoo18.conf':

[options]
; Database
admin_passwd = 12345
db_host = False
db_port = False
db_user = odoo18
db_password = False
xmlrpc_port = 8069

addons_path = /opt/odoo18/addons

    
Grant access to user odoo18 to the file:

sudo chown odoo18:odoo18 /etc/odoo18.conf
sudo chmod 640 /etc/odoo18.conf

    
Step 7: Verify Installation
Run the odoo server by command:

sudo -i -u odoo18
cd /opt/odoo18
source venv/bin/activate 
python3 odoo-bin -c /etc/odoo18.conf

    
Odoo should be running at:

http://localhost:8069

    
If you face an error:

- Try to read the error text
- If it is some dependancey issue than install it by using "pip install dependancy_name
- If it is port related issue, than try to kill the servic which is using the same port
- If it is permission like issue than try to grant access to 'odoo18' user
- If it is database related issue than fix it by edit postgres config file

    
Step 8: Access Odoo 18
Open your browser and navigate to http://localhost:8069.
If you are using a remote server, replace localhost with your server's IP address.
Optional: Nginx as a Reverse Proxy
If you want to serve Odoo behind a domain name, you can install and configure Nginx as a reverse proxy.

Leave a Reply

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