Amirul M.

Apr 26, 2020

3 min read

Install Customizable ERP with Odoo

Install and run locally on Ubuntu

Photo by Helloquence on Unsplash
  • Build and deploy a website and its services in their cloud (Paid).
  • Build it locally and then deploy in different service (Free).

Preparation

Install pre-built dependencies

sudo apt update && sudo apt upgrade
sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.debsudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb

Install PostgreSQL

sudo apt install postgresqlsudo su postgrescreateuser amirul -spsqlalter role amirul with password 'amirul';\qexit

Installation

Install from the source

git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 /opt/odoo12

Install requirements

cd /opt/odoo12virtualenv -p python3 odoo12envsource odoo12env/bin/activate
pip3 install wheel && pip3 install -r /opt/odoo12/odoo/requirements.txtpip3 install num2words phonenumbers psycopg2-binary watchdog xlwtdeactivate
mkdir /opt/odoo12/custom-addons

Setup Odoo config

cd /opt/odoo12sudo cp ./odoo/debian/odoo.conf ./odoo12.confsudo nano ./odoo12.conf
[options]
; This is the password that allows database operations:
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo12
db_password = False
addons_path = /opt/odoo12/odoo/addons,/opt/odoo12/custom-addons

Configure Odoo so it can be run as a service

sudo nano /etc/systemd/system/odoo12.service
[Unit]
Description=Odoo12
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo12
PermissionsStartOnly=true
User=odoo12
Group=odoo12
ExecStart=/opt/odoo12/odoo12env/bin/python3 /opt/odoo12/odoo/odoo-bin -c /etc/odoo12.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start odoo12
chmod -R o+rwx odoo12
sudo systemctl stop odoo12

Next