Install ODOO 13 – FreeBSD 12

——–
Perpare
——–
Default python 3.7 installed on FreeBSD 12
ln -s /usr/local/bin/python3.7 /usr/local/bin/python
sudo pkg install py37-pip
ln -s /usr/local/bin/pip-3.7 /usr/local/bin/pip
pip install --upgrade pip
sudo pip install --upgrade pip
——–
Install PostgreSQL 12
——–
sudo pkg install postgresql12-server postgresql12-client
sudo sysrc postgresql_enable=yes
sudo vi /etc/rc.conf
postgresql_enable="YES"
sudo /usr/local/etc/rc.d/postgresql initdb
sudo service postgresql start
sudo service postgresql status
sockstat -l4 -P tcp
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
postgres postgres   13322 5  tcp4   127.0.0.1:5432        *:*
root     sendmail   2151  3  tcp4   127.0.0.1:25          *:*
root     sshd       2148  3  tcp4   *:22020               *:*
mysql    mysqld     2118  31 tcp4   127.0.0.1:3306        *:*
www      nginx      836   6  tcp4   *:80                  *:*
root     nginx      835   6  tcp4   *:80                  *:*
www      php-fpm    831   5  tcp4   127.0.0.1:9000        *:*
www      php-fpm    830   5  tcp4   127.0.0.1:9000        *:*
root     php-fpm    829   7  tcp4   127.0.0.1:9000        *:*
sudo su - postgres
psql postgres
psql (12.5)
Type "help" for help.

postgres=# create role odoo13 with login password 'odoo_v13_pass';
CREATE ROLE
postgres=# alter role odoo13 createdb;
ALTER ROLE
postgres-# create database db_odoo13;
postgres=# create user odoo13 with encrypted password 'odoo_v13_pass';
postgres=# grant all privileges on database db_odoo13 to odoo13;
postgres=# quit
exit
——–
Install ODOO 13
——–
sudo pkg install py37-odoo
sudo vi /etc/rc.conf
odoo_enable="YES"
sudo mkdir /odoo_v13
sudo chown -R odoo:odoo /odoo_v13/
sudo chmod -R 2755 /odoo_v13/
Generate odoo.conf file
sudo /usr/sbin/daemon -u odoo /usr/local/bin/odoo -sc /odoo_v13/odoo.conf
Edit odoo.conf file
sudo vi /odoo_v13/odoo.conf
[options]
addons_path = /usr/local/lib/python3.7/site-packages/odoo/addons
admin_passwd = admin
csv_internal_sep = ,
data_dir = /odoo_v13/.local/share/Odoo
db_host = False
db_maxconn = 64
db_name = False
db_password = False
db_port = False
db_sslmode = prefer
db_template = template0
db_user = odoo13
dbfilter =
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
http_enable = True
http_interface =
http_port = 8013
:::
create odoo daemon service
sudo vi /usr/local/etc/rc.d/odoo
#!/bin/sh
#
# PROVIDE: odoo
# REQUIRE: DAEMON
# KEYWORD: shutdown
#

. /etc/rc.subr

name="odoo"
user="odoo"
rcvar="odoo_enable"
odoo_command="/usr/local/bin/odoo -sc /odoo_v13/odoo.conf --without-demo=all"


pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} -u ${user} -r -f ${odoo_command}"


load_rc_config "${name}"
: "${odoo_enable:=no}"

run_rc_command "$1"
Running Daemon Odoo
sudo service odoo start
sudo service odoo stop
sudo service odoo restart
——–
Browse your ODOO
——–
http://odoo_ip_host:8013