Installing Odoo on macOS
Odoo is a powerful open source platform for managing business processes. This guide will walk you through the steps required to install Odoo on macOS.
Prerequisites
Before getting started, make sure you have the following prerequisites:
- A macOS machine with administrative rights.
- Python version 3.
- Homebrew package manager installed.
Step 1: Install PostgreSQL
Odoo requires PostgreSQL as its database. PostgreSQL can be easily installed using Homebrew.
brew install postgresql
Step 2: Create PostgreSQL user
Next, create a PostgreSQL user and a database for Odoo.
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
createdb --owner=odoo odoo
exit
Step 3: Install Required Libraries
Odoo requires certain Python libraries to be installed. You can install them using pip command.
sudo pip3 install -r https://raw.githubusercontent.com/odoo/odoo/master/requirements.txt
Step 4: Download and Install Odoo
Download the latest version of Odoo from their official website. Unzip the downloaded file and move it to any directory you prefer. You may use the commands below.
cd ~
wget https://www.odoo.com/website/download/daily/channel-latest/odoo_14.0-latest.tar.gz
tar -xvzf odoo_14.0-latest.tar.gz
mv odoo-14.0/ odoo/
cd odoo
Step 5: Run Odoo
To start Odoo, execute the following command in the terminal.
python3 odoo-bin
You can now access Odoo by navigating to http://localhost:8069 in your web browser.
Step 6: Create a Systemd Service
To run Odoo as a systemd service, create a new file /etc/systemd/system/odoo.service, then add the following lines:
[Unit]
Description=Odoo
After=postgresql.service
[Service]
User=odoo
Group=odoo
ExecStart=/usr/bin/python3 /<path_to_odoo>/odoo-bin -c /<path_to_odoo_conf>/odoo.conf
Type=simple
WorkDirectory=/<path_to_odoo>/odoo
[Install]
WantedBy=multi-user.target
Replace path_to_odoo and path_to_odoo_conf with the actual paths of your Odoo installation and configuration files. Save the file and re-scan systemd with the following command.
sudo systemctl daemon-reload
sudo systemctl enable odoo.service
You can now manage the Odoo service using the following commands.
sudo systemctl start odoo.service
sudo systemctl stop odoo.service
sudo systemctl restart odoo.service