Skip to content

Instantly share code, notes, and snippets.

@kngvamxx
Created November 30, 2020 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kngvamxx/ea59ef840857e0ade965bc951d7e5a8d to your computer and use it in GitHub Desktop.
Save kngvamxx/ea59ef840857e0ade965bc951d7e5a8d to your computer and use it in GitHub Desktop.
how to install odoo on linux
Step 1: Create Odoo User
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo
###Install PostgreSQL
sudo apt install postgresql postgresql-contrib
sudo su - postgres -c "createuser -s odoouser"
sudo su - postgres -c "createdb odoodb"
sudo -u postgres psql
grant all privileges on database odoodb to odoouser;
\q
####Installing Wkhtmltopdf
wge https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb
#####$$The first thing you’ll want to do is switch to the Odoo user account we created above by running the commands below:
sudo su - odoo
git clone https://www.github.com/odoo/odoo --branch 13.0 /opt/odoo/odoo13
cd /opt/odoo
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip3 install wheel
pip3 install -r odoo13/requirements.txt
deactivate
mkdir /opt/odoo/odoo13-custom-addons
exit
sudo nano /etc/odoo13.conf
[options]
; This is the password that allows database operations:
admin_passwd = type_new_password_here
db_host = False
db_port = False
db_user = odoouser
db_password = 123
addons_path = /opt/odoo/odoo13/addons,/opt/odoo/odoo13-custom-addons
Save your changes and exit
Step 6: Creating a Systemd Unit File
At this point, all should be set.. What you need to do now is to create a systemd unit file to control startup, restart and shutdown Odoo services…
sudo nano /etc/systemd/system/odoo13.service
Then copy and pastes the lines below into the file, save and exit
[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo13/odoo-bin -c /etc/odoo13.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now odoo13
sudo systemctl status odoo13
sudo journalctl -u odoo13
Testing the Installation
Open your browser and type: http://<your_domain_or_IP_address>:8069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment