Setting up Odoo on a Linux server involves several steps, including preparing your server, installing the necessary dependencies, configuring the Odoo application, and setting up the database. Here’s a step-by-step guide to help you through the process.
Choose Your Linux Distribution: This guide assumes you are using Ubuntu. If you are using another distribution, commands may vary slightly.
Update Your System:
sudo apt update && sudo apt upgrade -y
Install Required Packages:
Odoo requires several packages, including Python, PostgreSQL, and others. Run the following commands:
sudo apt install -y git wget python3-pip build-essential \
libssl-dev libffi-dev python3-dev \
libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev \
libsasl2-dev libldap2-dev libpq-dev \
npm
Install and Configure PostgreSQL:
sudo apt install -y postgresql
sudo -u postgres createuser --createdb --username postgres --pwprompt odoo_user
Download Odoo:
You can download Odoo directly from the GitHub repository. You can specify the version you want; here’s an example for Odoo 16.0:
cd /opt
sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 16.0 --single-branch odoo
Create a Python Virtual Environment:
cd /opt/odoo
python3 -m venv odoo-venv
source odoo-venv/bin/activate
Install Python Dependencies:
pip install wheel
pip install -r requirements.txt
Create Odoo Configuration File:
Create a new configuration file:
sudo nano /etc/odoo.conf
Add the following configuration (make sure to change the admin password and database user):
[options]
; This is the password that allows database operations:
admin_passwd = YOUR_ADMIN_PASSWORD
db_host = False
db_port = False
db_user = odoo_user
db_password = YOUR_DATABASE_PASSWORD
addons_path = /opt/odoo/addons
logfile = /var/log/odoo/odoo.log
Save and exit (CTRL + X, then Y, then ENTER).
Create a Log Directory:
sudo mkdir /var/log/odoo
sudo chown www-data:www-data /var/log/odoo
Create a Service File:
sudo nano /etc/systemd/system/odoo.service
Add the following content:
[Unit]
Description=Odoo
Documentation=http://www.odoo.com
After=postgresql.service
Requires=postgresql.service
[Service]
User=www-data
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
Restart=always
[Install]
WantedBy=default.target
Enable and Start Odoo:
sudo systemctl daemon-reload
sudo systemctl enable odoo
sudo systemctl start odoo
Open Your Web Browser and go to:
http://your_server_ip:8069
Replace your_server_ip with the actual IP address of your server.
Create a New Database:
/var/log/odoo/odoo.log for any errors.This guide provides a basic setup of Odoo on a Linux server. Depending on your specific requirements or configurations, additional steps may be necessary. If you encounter any issues or have specific questions, feel free to contact us!