Setting up Odoo 13 on Digital Ocean's ubuntu

Create a new VPS server in Digital Ocean.

 Login using Any SSH Client (Eg: Putty or Bitwise Client)

===============================================

Open a terminal and run the following commands


These steps are specifically for Ubuntu Version 18. 

Before proceed, please check your OS version using command 

========================

lsb_release -a 


STEP 1: - Get list of updates and install them

==============================================

sudo apt update && sudo apt upgrade


STEP 2 - install PIP and other Dependencies

============================================

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 libxml2-dev


STEP 3 - Create System user odoo13 with home directory /opt/odoo13 

===============================================

sudo useradd -m -d /opt/odoo13 -U -r -s /bin/bash odoo13


And setup password for the new user

sudo passwd <username>


Check users

cut -d: -f1 /etc/passwd


Delete user if something wrong

usedel <username>


Add odoo13 to sudo group

sudo usermod -aG sudo odoo13


STEP 4 - Install and Configure PostgreSQL

=========================================

sudo apt-get install postgresql

create a PostgreSQL user with the same name as the previously created system user, in our case that is odoo13:

sudo su - postgres -c "createuser -s odoo13"


STEP 5 - Get and install Wkhtmltopdf

====================================

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb

If the above URL is giving back 404 Error, please directly get the updated version link from wkhtmltopdf.org 'Downloads'

In the Downloads page, right click and copy the latest link for 'ubuntu amd x64 version'

Then type wget [right click to paste the url]


Install Wkhtmltopdf

====================

sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb

(If you have downloaded another version, use that file name here)


Install PyPDF library

sudo apt-get install python3-pypdf2


Change to odoo13 user

========================================

sudo su odoo13


STEP 6 Install Python virtual environment

========================================

sudo apt-get install python3-venv

switch to odoo13 user:

sudo su - odoo13


Clone the Odoo 13 source code from the GitHub repository:

git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 /opt/odoo13/odoo



create a new Python virtual environment for the Odoo 13 installation:

===============================================

cd /opt/odoo13

python3 -m venv odoo-venv



activate the environment

========================

source odoo-venv/bin/activate



Install all required Python modules with pip3:

=======================================

pip3 install wheel

pip3 install -r odoo/requirements.txt



Create a new directory for the custom addons:

======================================

mkdir /opt/odoo13/odoo-custom-addons



Switch back to sudo user:

==============================

exit



create a configuration file, by copying the included sample configuration file:

===============================================

sudo cp /opt/odoo13/odoo/debian/odoo.conf /etc/odoo13.conf



Open the file and edit it as follows:

=====================================

sudo nano /etc/odoo13.conf



[options]

; This is the password that allows database operations:

; Do not forget to change to something more secure.

admin_passwd = my_admin_passwd

db_host = False

db_port = False

db_user = odoo13

db_password = False

addons_path = /opt/odoo13/odoo/addons,/opt/odoo13/odoo-custom-addons


After changing the content in Nano Editor, Press ctrl+o [enter] to save and Ctrl+x to exit



STEP 7 - Run Odoo as a service

===================================

(To run Odoo as a service create a service unit file in the /etc/systemd/system/ directory. Open your text editor and paste the following configuration:)


sudo nano /etc/systemd/system/odoo13.service


[Unit]

Description=Odoo13

Requires=postgresql.service

After=network.target postgresql.service


[Service]

Type=simple

SyslogIdentifier=odoo13

PermissionsStartOnly=true

User=odoo13

Group=odoo13

ExecStart=/opt/odoo13/odoo-venv/bin/python3 /opt/odoo13/odoo/odoo-bin -c /etc/odoo13.conf

StandardOutput=journal+console


[Install]

WantedBy=multi-user.target


After pasting this content in Nano Editor, Press ctrl+o [enter] to save and Ctrl+x to exit



Notify systemd that a new unit file exist and start the Odoo service :

===============================================

sudo systemctl daemon-reload

sudo systemctl start odoo13



Check the service status:

=========================

sudo systemctl status odoo13


(check if Odoo service is active and running.)

(press q in your keyboard to exit back to the prompt)


Enable the Odoo service to be automatically started at boot time:

===============================================

sudo systemctl enable odoo13


To see the messages logged by the Odoo service (Optional Step, Not required)

===============================================

sudo journalctl -u odoo13



STEP 8 Test the Installation

=============================

Open your browser and type: http://<your_domain_or_IP_address>:8069


Check PostgresSQL


Connect to postgresql using the user postgres

psql -U postgres


List the users

\du+


Restart

sudo service postgresql restart

sudo systemctl restart postgresql


Restart Odoo Service

sudo systemctl restart odoo


\q to exit from postgresql

exit to logout from current user


Configuring Postgresql

cd /etc/postgresql/12/main/

local   all             postgres                                peer

to

local   all             postgres                                trust
and restart the postgres service





Comments

Popular posts from this blog

Working with docker images

Install Odoo13 on ubuntu