{"id":745,"date":"2021-04-06T02:52:13","date_gmt":"2021-04-05T20:52:13","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=745"},"modified":"2021-04-06T02:52:13","modified_gmt":"2021-04-05T20:52:13","slug":"how-to-setup-odoo-14-in-centos-7","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-setup-odoo-14-in-centos-7.html","title":{"rendered":"How to Setup Odoo 14 in CentOS 7"},"content":{"rendered":"\n<p>Odoo is currently one of the most popular tool for business purposes. It has a community edition, that allows managing ERP at very low cost. Odoo was previously known as OpenERP. Odoo requires to be installed on a dedicated server or VPS. Odoo 14 had come out already.  I will have a straight forward how to on installing the latest Odoo 14 in CentOS 7.<\/p>\n\n\n\n<p><strong>Log in to your system and update<\/strong><\/p>\n\n\n\n<p>First step would be to login to your system and then update the system using yum.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh root@server_ip<\/pre>\n\n\n\n<p>You may check the CentOS version from the redhat release file using the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cat \/etc\/redhat-release<\/pre>\n\n\n\n<p>It should show you something like the following if you<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CentOS Linux release 7.8.2003 (Core)<\/pre>\n\n\n\n<p>Now, you may try updating the system with yum<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum update -y<\/pre>\n\n\n\n<p>Once done, now install the EPEL repository as we need it to satisfy a couple of dependecies:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install epel-release<\/pre>\n\n\n\n<p><strong>Install Python 3.6 packages and Odoo dependencies<\/strong><\/p>\n\n\n\n<p>We need Python 3.6 at least to run Odoo 14. Odoo 13 also ran on Python 3.6. We will use \u2018Software Collection (scl)\u2019 repository to install and use Python 3.6. To find the available Python versions in SCL, you may check the following:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.softwarecollections.org\/en\/scls\/user\/rhscl\/?search=python&amp;policy=&amp;repo=&amp;order_by=-create_date&amp;per_page=10\">SCL Repository for Python<\/a><\/p>\n\n\n\n<p>Now, to install Python 3.6 using SCL, we first need to install the SCL repository for Centos:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install centos-release-scl<\/pre>\n\n\n\n<p>Once the SCL is loaded, now, you may install the python 3.6 using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install rh-python36<\/pre>\n\n\n\n<p>Once the Python is installed, now we will install several tools and packages for Odoo dependencies with the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install git gcc nano wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel<\/pre>\n\n\n\n<p><strong>Create Odoo User<\/strong><\/p>\n\n\n\n<p>We now need to create a system user and group for Odoo and define a home directory to \/opt\/odoo<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">useradd -m -U -r -d  \/opt\/odoo -s \/bin\/bash odoo<\/pre>\n\n\n\n<p>You may use any username here, but remember to create the same username for the PostgreSQL as well.<\/p>\n\n\n\n<p><strong>Install PostgreSQL<\/strong><\/p>\n\n\n\n<p>CentOS base repository unfortunately, comes with Postgresql 9.2. But we want to use PostgreSQL 10 for our Odoo installation. You may check the available PostgreSQL for CentOS 7 using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum list postgresql*<\/pre>\n\n\n\n<p>As by default CentOS 7 does not provide the PostgreSQL 10, we would use PostgreSQL official repository to download and install the 10 version.<\/p>\n\n\n\n<p>First, we install the Postgres Yum Repository using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install https:\/\/download.postgresql.org\/pub\/repos\/yum\/10\/redhat\/rhel-7-x86_64\/pgdg-redhat-repo-latest.noarch.rpm<\/pre>\n\n\n\n<p>Now, you may install PostgreSQL 10 and related required packages using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install postgresql10 postgresql10-server postgresql10-contrib postgresql10-libs -y<\/pre>\n\n\n\n<p>Now, we need to initialize the postgres database and start it. You may do that using the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Initialize the DB\n\/usr\/pgsql-10\/bin\/postgresql-10-setup initdb\n\n# Start the database\nsystemctl start postgresql-10.service<\/pre>\n\n\n\n<p>If everything goes alright, now you may check the postgresql 10 status:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@docker bin]# systemctl status postgresql-10.service\n\u25cf postgresql-10.service - PostgreSQL 10 database server\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/postgresql-10.service; disabled; vendor preset: disabled)\n   Active: active (running) since Mon 2021-04-05 16:42:15 EDT; 5s ago\n     Docs: https:\/\/www.postgresql.org\/docs\/10\/static\/\n  Process: 6380 ExecStartPre=\/usr\/pgsql-10\/bin\/postgresql-10-check-db-dir ${PGDATA} (code=exited, status=0\/SUCCESS)\n Main PID: 6386 (postmaster)\n    Tasks: 8\n   Memory: 13.5M\n   CGroup: \/system.slice\/postgresql-10.service\n           \u251c\u25006386 \/usr\/pgsql-10\/bin\/postmaster -D \/var\/lib\/pgsql\/10\/data\/\n           \u251c\u25006388 postgres: logger process\n           \u251c\u25006390 postgres: checkpointer process\n           \u251c\u25006391 postgres: writer process\n           \u251c\u25006392 postgres: wal writer process\n           \u251c\u25006393 postgres: autovacuum launcher process\n           \u251c\u25006394 postgres: stats collector process\n           \u2514\u25006395 postgres: bgworker: logical replication launcher<\/pre>\n\n\n\n<p>Now you may enable Postgres to start when booting up using the systemctl enable command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl enable postgresql-10.service<\/pre>\n\n\n\n<p>Now, we need to create a database user for our Odoo installation. You may do that using the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">su - postgres -c \"createuser -s odoo\"<\/pre>\n\n\n\n<p>Note: If you have created a different user for Odoo installation other than \u2018odoo\u2019 than you should change the username here as well.<\/p>\n\n\n\n<p><strong>Install Wkhtmltopdf<\/strong><\/p>\n\n\n\n<p>Wkhtmltopdf is a open source tool to make html in pdf format so that you may print pdf reports. This tool is used by Odoo and requires to be installed as dependency. CentOS 7 repository does not provide the latest version of this tool, and Odoo requires you to use the latest version. Hence, we require to download the latest version from the Wkhtmltopdf website and install it. To do that, you may first visit the page:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/wkhtmltopdf.org\/downloads.html<\/pre>\n\n\n\n<p>The page gives you the direct rpm download link for each version of CentOS\/Ubuntu\/Mac etc. Download the stable version for CentOS 7. At the time of writing, the URL for CentOS 7 x86_64 bit is the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/github.com\/wkhtmltopdf\/packaging\/releases\/download\/0.12.6-1\/wkhtmltox-0.12.6-1.centos7.x86_64.rpm<\/pre>\n\n\n\n<p>You may install this using the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/opt\/\nwget https:\/\/github.com\/wkhtmltopdf\/packaging\/releases\/download\/0.12.6-1\/wkhtmltox-0.12.6-1.centos7.x86_64.rpm\nyum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm<\/pre>\n\n\n\n<p><strong>Install and Configure Odoo 1<\/strong>4<\/p>\n\n\n\n<p>If you have come all through here, that means you are done with the all dependency installations before starting to download Odoo 14 source code. We will download Odoo 14 from it\u2019s Github repo and use virtualenv to create an isolated python environment to install this python software.<\/p>\n\n\n\n<p>First, login as odoo from root:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">su - odoo<\/pre>\n\n\n\n<p>Clone the Odoo source code from Github repository:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git clone https:\/\/www.github.com\/odoo\/odoo --depth 1 --branch 14.0 \/opt\/odoo\/odoo14<\/pre>\n\n\n\n<p>This will bring the Odoo 14 branch from the Odoo repository and put it inside the folder \/opt\/odoo\/odoo14<\/p>\n\n\n\n<p>Now, we need to enable software collections in order to access python binaries:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">scl enable rh-python36 bash<\/pre>\n\n\n\n<p>Then we need to create a virtual environment to complete the installation:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/opt\/odoo\npython3 -m venv odoo14-venv<\/pre>\n\n\n\n<p>Now, you may activate the virtual environment you have just created:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">source odoo14-venv\/bin\/activate<\/pre>\n\n\n\n<p>Now, we upgrade the pip and install the wheel library:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install --upgrade pip\npip3 install wheel<\/pre>\n\n\n\n<p>Once done, now we can using pip3 to install all the required Python modules from the requirements.txt file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip3 install -r odoo14\/requirements.txt<\/pre>\n\n\n\n<p>Once the installation is complete, now we can deactivate the virtual environment and get back to the root user<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">deactivate &amp;&amp; exit ; exit<\/pre>\n\n\n\n<p>If you think, you will create custom modules, you may now create it and give odoo the permission accordingly:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mkdir \/opt\/odoo\/odoo14-custom-addons\nchown odoo: \/opt\/odoo\/odoo14-custom-addons<\/pre>\n\n\n\n<p>Now, we can fill up the odoo configuration file. First open the odoo.conf file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">nano \/etc\/odoo.conf<\/pre>\n\n\n\n<p>You may paste the following inside:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[options]\n; This is the password that allows database operations:\nadmin_passwd = set_the_password_to_create_odoo_database\ndb_host = False\ndb_port = False\ndb_user = odoo\ndb_password = False\naddons_path = \/opt\/odoo\/odoo14\/addons,\/opt\/odoo\/odoo14-custom-addons\n; You can enable log file with uncommenting the next line\n; logfile = \/var\/log\/odoo14\/odoo.log<\/pre>\n\n\n\n<p>Please do not forget to change the password \u2018set_the_password_to_create_odoo_database\u2019 with a new strong password. This would be used to create Odoo databases from the login screen.<\/p>\n\n\n\n<p><strong>Create the systemd service file and start Odoo 1<\/strong>4<\/p>\n\n\n\n<p>Now, we will create a service file, to be able to start, stop and restart Odoo daemon. To do that, first create a service file using the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">nano \/etc\/systemd\/system\/odoo14.service<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[Unit]\nDescription=Odoo14\nRequires=postgresql-10.service\nAfter=network.target postgresql-10.service\n[Service]\nType=simple\nSyslogIdentifier=odoo14\nPermissionsStartOnly=true\nUser=odoo\nGroup=odoo\nExecStart=\/usr\/bin\/scl enable rh-python36 -- \/opt\/odoo\/odoo14-venv\/bin\/python3 \/opt\/odoo\/odoo14\/odoo-bin -c \/etc\/odoo.conf\nStandardOutput=journal+console\n[Install]\nWantedBy=multi-user.target<\/pre>\n\n\n\n<p>Now, save the file and exit.<\/p>\n\n\n\n<p>Now, you need to reload the systemd daemon to be able to read the latest changes you have made to services. To do that, run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl daemon-reload<\/pre>\n\n\n\n<p>Finally, now we can start Odoo 14 instance using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl start odoo14<\/pre>\n\n\n\n<p>If you are interested to check the status of the instance, you may do this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status odoo14<\/pre>\n\n\n\n<p>It show green active running, if everything worked out. If you see no error, you may now enable Odoo to start during the boot:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl enable odoo14<\/pre>\n\n\n\n<p>If you would like to see the logs, you may either use the journal tools like the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">journalctl -u odoo14<\/pre>\n\n\n\n<p>or uncomment the following line to log the debugs in \/etc\/odoo.conf<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">logfile = \/var\/log\/odoo14\/odoo.log<\/pre>\n\n\n\n<p>After making any change to \/etc\/odoo.conf, do not forget the restart the Odoo14 instance using systemctl.<\/p>\n\n\n\n<p><strong>Test the Installation<\/strong><\/p>\n\n\n\n<p><br>Odoo is currently one of the most popular tool for business purposes. It has a community edition, that allows managing ERP at very low cost. Odoo was previously known as OpenERP. Odoo requires to be installed on a dedicated server or VPS. Odoo 13 had come out on October, 2019. Odoo 14 hasn\u2019t been released yet for production. I will have a straight forward how to on installing the latest Odoo 13 in CentOS 7.<\/p>\n\n\n\n<p><strong>Log in to your system and update<\/strong><\/p>\n\n\n\n<p>First step would be to login to your system and then update the system using yum.ssh root@server_ip<\/p>\n\n\n\n<p>You may check the CentOS version from the redhat release file using the following:cat \/etc\/redhat-release<\/p>\n\n\n\n<p>It should show you something like the following if youCentOS Linux release 7.8.2003 (Core)<\/p>\n\n\n\n<p>Now, you may try updating the system with yumyum update -y<\/p>\n\n\n\n<p>Once done, now install the EPEL repository as we need it to satisfy a couple of dependecies:yum install epel-release<\/p>\n\n\n\n<p><strong>Install Python 3.6 packages and Odoo dependencies<\/strong><\/p>\n\n\n\n<p>We need Python 3.6 at least to run Odoo 13. Odoo 12 had support for Python 3.5, unfortunately, Odoo 13 doesn\u2019t. We will use \u2018Software Collection (scl)\u2019 repository to install and use Python 3.6. To find the available Python versions in SCL, you may check the following:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.softwarecollections.org\/en\/scls\/user\/rhscl\/?search=python&amp;policy=&amp;repo=&amp;order_by=-create_date&amp;per_page=10\">SCL Repository for Python<\/a><\/p>\n\n\n\n<p>Now, to install Python 3.6 using SCL, we first need to install the SCL repository for Centos:yum install centos-release-scl<\/p>\n\n\n\n<p>Once the SCL is loaded, now, you may install the python 3.6 using the following command:yum install rh-python36<\/p>\n\n\n\n<p>Once the Python is installed, now we will install several tools and packages for Odoo dependencies with the following command:yum install git gcc nano wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel<\/p>\n\n\n\n<p><strong>Create Odoo User<\/strong><\/p>\n\n\n\n<p>We now need to create a system user and group for Odoo and define a home directory to \/opt\/odoouseradd -m -U -r -d \/opt\/odoo -s \/bin\/bash odoo<\/p>\n\n\n\n<p>You may use any username here, but remember to create the same username for the PostgreSQL as well.<\/p>\n\n\n\n<p><strong>Install PostgreSQL<\/strong><\/p>\n\n\n\n<p>CentOS base repository unfortunately, comes with Postgresql 9.2. But we want to use PostgreSQL 9.6 for our Odoo installation. You may check the available PostgreSQL for CentOS 7 using the following command:yum list postgresql*<\/p>\n\n\n\n<p>As by default CentOS 7 does not provide the PostgreSQL 9.6, we would use PostgreSQL official repository to download and install the 9.6 version.<\/p>\n\n\n\n<p>First, we install the Postgres Yum Repository using the following command:yum install https:\/\/download.postgresql.org\/pub\/repos\/yum\/9.6\/redhat\/rhel-7-x86_64\/pgdg-redhat-repo-latest.noarch.rpm<\/p>\n\n\n\n<p>Now, you may install PostgreSQL 9.6 and related required packages using the following command:yum install postgresql96 postgresql96-server postgresql96-contrib postgresql96-libs<\/p>\n\n\n\n<p>Now, we need to initialize the postgres database and start it. You may do that using the following:# Initialize the DB\/usr\/pgsql-9.6\/bin\/postgresql96-setup initdb# Start the databasesystemctl start postgresql-9.6.service<\/p>\n\n\n\n<p>Now you may enable Postgres to start when booting up using the systemctl enable command:systemctl enable postgresql-9.6.service<\/p>\n\n\n\n<p>Now, we need to create a database user for our Odoo installation. You may do that using the following:su &#8211; postgres -c &#8220;createuser -s odoo&#8221;<\/p>\n\n\n\n<p>Note: If you have created a different user for Odoo installation other than \u2018odoo\u2019 than you should change the username here as well.<\/p>\n\n\n\n<p><strong>Install Wkhtmltopdf<\/strong><\/p>\n\n\n\n<p>Wkhtmltopdf is a open source tool to make html in pdf format so that you may print pdf reports. This tool is used by Odoo and requires to be installed as dependency. CentOS 7 repository does not provide the latest version of this tool, and Odoo requires you to use the latest version. Hence, we require to download the latest version from the Wkhtmltopdf website and install it. To do that, you may first visit the page:https:\/\/wkhtmltopdf.org\/downloads.html<\/p>\n\n\n\n<p>The page gives you the direct rpm download link for each version of CentOS\/Ubuntu\/Mac etc. Download the stable version for CentOS 7. At the time of writing, the URL for CentOS 7 x86_64 bit is the following:https:\/\/github.com\/wkhtmltopdf\/packaging\/releases\/download\/0.12.6-1\/wkhtmltox-0.12.6-1.centos7.x86_64.rpm<\/p>\n\n\n\n<p>You may install this using the following:cd \/opt\/wget https:\/\/github.com\/wkhtmltopdf\/packaging\/releases\/download\/0.12.6-1\/wkhtmltox-0.12.6-1.centos7.x86_64.rpmyum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm<\/p>\n\n\n\n<p><strong>Install and Configure Odoo 13<\/strong><\/p>\n\n\n\n<p>If you have come all through here, that means you are done with the all dependency installations before starting to download Odoo 13 source code. We will download Odoo 13 from it\u2019s Github repo and use virtualenv to create an isolated python environment to install this python software.<\/p>\n\n\n\n<p>First, login as odoo from root:su &#8211; odoo<\/p>\n\n\n\n<p>Clone the Odoo source code from Github repository:git clone https:\/\/www.github.com\/odoo\/odoo &#8211;depth 1 &#8211;branch 13.0 \/opt\/odoo\/odoo13<\/p>\n\n\n\n<p>This will bring the Odoo 13 branch from the Odoo repository and put it inside the folder \/opt\/odoo\/odoo13<\/p>\n\n\n\n<p>Now, we need to enable software collections in order to access python binaries:scl enable rh-python36 bash<\/p>\n\n\n\n<p>Then we need to create a virtual environment to complete the installation:cd \/opt\/odoopython3 -m venv odoo13-venv<\/p>\n\n\n\n<p>Now, you may activate the virtual environment you have just created:source odoo13-venv\/bin\/activate<\/p>\n\n\n\n<p>Now, we upgrade the pip and install the wheel library:pip install &#8211;upgrade pippip3 install wheel<\/p>\n\n\n\n<p>Once done, now we can using pip3 to install all the required Python modules from the requirements.txt file:pip3 install -r odoo13\/requirements.txt<\/p>\n\n\n\n<p>Once the installation is complete, now we can deactivate the virtual environment and get back to the root userdeactivate &amp;&amp; exit ; exit<\/p>\n\n\n\n<p>If you think, you will create custom modules, you may now create it and give odoo the permission accordingly:mkdir \/opt\/odoo\/odoo13-custom-addonschown odoo: \/opt\/odoo\/odoo13-custom-addons<\/p>\n\n\n\n<p>Now, we can fill up the odoo configuration file. First open the odoo.conf file:nano \/etc\/odoo.conf<\/p>\n\n\n\n<p>You may paste the following inside:[options]; <strong>This<\/strong> is the password that allows database operations:admin_passwd = set_the_password_to_create_odoo_databasedb_host = <strong>False<\/strong>db_port = <strong>False<\/strong>db_user = odoodb_password = <strong>False<\/strong>addons_path = \/opt\/odoo\/odoo13\/addons,\/opt\/odoo\/odoo13-custom-addons; You can enable log file with uncommenting the next line; logfile = \/var\/log\/odoo13\/odoo.log<\/p>\n\n\n\n<p>Please do not forget to change the password \u2018set_the_password_to_create_odoo_database\u2019 with a new strong password. This would be used to create Odoo databases from the login screen.<\/p>\n\n\n\n<p><strong>Create the systemd service file and start Odoo 13<\/strong><\/p>\n\n\n\n<p>Now, we will create a service file, to be able to start, stop and restart Odoo daemon. To do that, first create a service file using the following:nano \/etc\/systemd\/system\/odoo13.service<\/p>\n\n\n\n<p>and paste the following:[Unit]Description=Odoo13Requires=postgresql-9.6.serviceAfter=network.target postgresql-9.6.service[Service]Type=simpleSyslogIdentifier=odoo13PermissionsStartOnly=<strong>true<\/strong>User=odooGroup=odooExecStart=\/usr\/bin\/scl enable rh-python35 &#8212; \/opt\/odoo\/odoo13-venv\/bin\/python3 \/opt\/odoo\/odoo13\/odoo-bin -c \/etc\/odoo.confStandardOutput=journal+console[Install]WantedBy=multi-user.target<\/p>\n\n\n\n<p>Now, save the file and exit.<\/p>\n\n\n\n<p>Now, you need to reload the systemd daemon to be able to read the latest changes you have made to services. To do that, run:systemctl daemon-reload<\/p>\n\n\n\n<p>Finally, now we can start Odoo 13 instance using the following command:systemctl start odoo13<\/p>\n\n\n\n<p>If you are interested to check the status of the instance, you may do this:systemctl status odoo13[root@hr ~]# systemctl status odoo13\u25cf odoo13.service &#8211; Odoo13 Loaded: loaded (\/etc\/systemd\/system\/odoo13.service; enabled; vendor preset: disabled) Active: active (running) since Sun 2020-09-13 08:26:46 EDT; 23h ago Main PID: 24502 (scl) CGroup: \/system.slice\/odoo13.service \u251c\u250024502 \/usr\/bin\/scl enable rh-python36 &#8212; \/opt\/odoo\/odoo13-venv\/bin\/python3 \/opt\/odoo\/odoo13\/odoo-bin -c \/etc\/odoo.conf \u251c\u250024503 \/bin\/bash \/var\/tmp\/sclSWH04z \u2514\u250024507 \/opt\/odoo\/odoo13-venv\/bin\/python3 \/opt\/odoo\/odoo13\/odoo-bin -c \/etc\/odoo.conf<\/p>\n\n\n\n<p>It show green active running, if everything worked out. If you see no error, you may now enable Odoo to start during the boot:systemctl enable odoo13<\/p>\n\n\n\n<p>If you would like to see the logs, you may either use the journal tools like the following:journalctl -u odoo13<\/p>\n\n\n\n<p>or uncomment the following line to log the debugs in \/etc\/odoo.conflogfile = \/var\/log\/odoo13\/odoo.log<\/p>\n\n\n\n<p>After making any change to \/etc\/odoo.conf, do not forget the restart the Odoo13 instance using systemctl.<\/p>\n\n\n\n<p><strong>Test the Installation<\/strong><\/p>\n\n\n\n<p>You may now test the installation using http:\/\/your_server_ip:8069. If everything worked, it should come up. If it doesn\u2019t, you may try stopping your \u2018firewalld\u2019 to see if firewall is blocking the port or not:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl stop firewalld<\/pre>\n\n\n\n<p>At Mellowhost, we provide Odoo installation and configuration assistance for absolute free of charge. If you are willing to try out any of our VPS for Odoo, you may do so and talk with us through the Live chat or the ticket for Odoo assistance.<\/p>\n\n\n\n<p>Furthermore, Good luck.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Odoo is currently one of the most popular tool for business purposes. It has a community edition, that allows managing ERP at very low cost. Odoo was previously known as OpenERP. Odoo requires to be installed on a dedicated server or VPS. Odoo 14 had come out already. I will have a straight forward how &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-setup-odoo-14-in-centos-7.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Setup Odoo 14 in CentOS 7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[144,292],"tags":[220,481,553,298],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/745"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=745"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/745\/revisions"}],"predecessor-version":[{"id":746,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/745\/revisions\/746"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}