How to Install Odoo 19 on Ubuntu 24.04
How to Install Odoo 19 on Ubuntu 24.0
Prerequisites
Before diving into the installation process, make sure you have:
A clean installation of Ubuntu 24.04 (or any version of Ubuntu compatible with Odoo).
Root or sudo privileges on the server.
A Python environment (as Odoo is built on Python).
Step 1: Update Your System
Initial update to ensure your system packages are compatible. Run the following commands to update:
sudo apt updatesudo apt upgrade -y
Step 2: Install Dependencies
Odoo requires several dependencies to run smoothly.
Install the necessary packages using the following command:
sudo apt install -y python3-dev python3-pip python3-venv libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libmysqlclient-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-devThese packages will ensure that Odoo has all the libraries it needs for smooth operation.
Step 3: Install PostgreSQL
Odoo uses PostgreSQL as its database backend. Install it with the following commands:
sudo apt install -y postgresqlNext, create a PostgreSQL user for Odoo:
sudo -u postgres createuser --createdb --pwprompt --interactive --pwprompt odooOnce you create the user, set the user to have administrative privileges:
sudo -u postgres psqlALTER USER odoo WITH SUPERUSER;\q
Step 4: Install Odoo 19
Now, let's install Odoo. We'll use a Python virtual environment to keep dependencies isolated.
First, create a directory where Odoo will be installed:
mkdir /opt/odoocd /opt/odooNext, create a Python virtual environment:
python3 -m venv odoo-venvsource odoo-venv/bin/activateInstall Odoo's required Python packages:
pip install wheelpip install -r https://github.com/odoo/odoo/raw/19.0/requirements.txtDownload Odoo 19 from GitHub:
git clone --depth 1 --branch 19.0 https://github.com/odoo/odoo.git .
Step 5: Create a System User for Odoo
For security reasons, it's best to run Odoo as a non-root user. Create a new user dedicated to running
Odoo
sudo useradd --system --home /opt/odoo --create-home --shell /bin/bash --comment "Odoo User" odoosudo chown -R odoo:odoo /opt/odoo
Step 6: Configure Odoo
You’ll need to configure Odoo before running it. Create a configuration file for Odoo:
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.confsudo nano /etc/odoo.conf
In the odoo.conf file, make the following changes:
[options]; This is the password that allows database operations:admin_passwd = admindb_host = Falsedb_port = Falsedb_user = odoodb_password = Falseaddons_path = /opt/odoo/addonslogfile = /var/log/odoo/odoo.log
Make sure to replace admin_passwd with a secure password of your choice.
Step 7: Create a Systemd Service File
To run Odoo as a service and automatically start it on boot, create a systemd service file:
Create the service file:
sudo nano /etc/systemd/system/odoo.servicePaste the following content into the file:
[Unit]Description=OdooDocumentation=http://www.odoo.comAfter=network.target[Service]Type=simpleUser=odooExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo-bin --config=/etc/odoo.confWorkingDirectory=/opt/odooStandardOutput=journalStandardError=journalRestart=always[Install]WantedBy=default.targetReload the systemd services and enable Odoo to start on boot:
sudo systemctl daemon-reloadsudo systemctl enable odoo
Step 8: Start Odoo
You’re now ready to start the Odoo service. To start Odoo, run:
sudo systemctl start odooYou can check the status of the Odoo service:
sudo systemctl status odooIf everything is set up correctly, you should see Odoo running.
Step 9: Access Odoo via Browser
Open your web browser and navigate to:
http://<your-server-ip>:8069You should be greeted with the Odoo setup screen. Follow the on-screen instructions to set up your database and start using Odoo!
Comments