X
    Categories: Tutorials

Install Odoo 8 on a CentOS 7 VPS

Odoo is a suite of business applications, organized in 6 groups: front-end applications, sales management applications, business operations applications, marketing applications, human resources and productivity applications.
The installation of Odoo 8 on a CentOS 7 VPS should take about ten minutes if you follow the very easy steps described below.

Remove MariaDB from your server:

yum remove mariadb mariadb-server

Ensure that your yum package repository is up to date and all installed packages have been upgraded with the latest bug fixes and security patches using the following commands:

yum clean all
yum update

Install PostgreSQL and PHP PostgreSQL extension:

yum install postgresql-libs postgresql-server postgresql php-pgsql php-gd

Install all prerequisite packages using the following command:

yum install babel python-devel libxslt-python pyparsing python-dateutil python-decorator python-imaging python-jinja2 python-ldap python-lxml python-mako python-psycopg2 python-reportlab python-requests python-werkzeug python-yaml python-docutils  python-matplotlib python-unittest2.noarch python-babel python-gevent pygtk2 glade3 pytz libxslt-devel bzr automake gcc gcc-c++ byacc kernel-headers

Restart the Apache web server:

systemctl restart httpd.service

Initialize the PostgreSQL database cluster:

postgresql-setup initdb

Configure the PostgreSQL service to start automatically on server boot:

systemctl enable postgresql.service

Start PostgreSQL service and set a password for the ‘postgres’ user:

systemctl start postgresql.service
su - postgres
psql
\password postgres
(Enter new password twice)
\q
exit

Create new system user named ‘odoo’:

adduser odoo
passwd odoo

Create ‘odoo’ user in PostgreSQL using the following command:

su - postgres -c "createuser --pwprompt --createdb --no-createrole --no-superuser odoo"
(Enter new 'odoo' user password twice)

Download the latest version of Odoo and extract it to the ‘/opt’ directory on your virtual server:

cd /opt 
wget http://nightly.odoo.com/8.0/nightly/src/odoo_8.0.latest.tar.gz
tar -xvzf /root/odoo_8.0.latest.tar.gz
mv odoo-8.* odoo
cd odoo

Install Odoo 8:

python setup.py install
cp openerp-server /usr/local/bin/odoo-server
mkdir -p /var/log/odoo/
touch /var/log/odoo/odoo-server.log
chown odoo /var/log/odoo/odoo-server.log
chmod 644 /var/log/odoo/odoo-server.log

Give the ‘odoo’ user permission to install new modules:

chown odoo -R /usr/lib/python2.7/site-packages/odoo-8*/openerp/addons/

Run the following commands:

vi ~odoo/.bashrc
export LD_LIBRARY_PATH; LD_LIBRARY_PATH=/usr/local/lib
source ~odoo/.bashrc

Edit the ‘/etc/odoo-server.conf’ configuration file and add the following lines:

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo
db_password = False
addons_path = /usr/lib/python2.7/site-packages/odoo-8.0_20150306-py2.7.egg/openerp/addons/
#do not forget to change 'odoo-8.0_20150306-py2.7.egg' with the actual directory on your server
logfile = /var/log/odoo/odoo-server.log
log_level = error

Edit the ‘/var/lib/pgsql/data/pg_hba.conf’ configuration file and allow local access to PostgreSQL databases:

vi /var/lib/pgsql/data/pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust # changed from 'peer'
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust # changed from 'ident'
# IPv6 local connections:
host    all             all             ::1/128                 trust # changed from 'ident'

Optionally, if you want to allow remote access to PostgreSQL databases, add the following line to ‘/var/lib/pgsql/data/pg_hba.conf’ configuration file:

host    all             all             0.0.0.0/0               md5

Check the PostgreSQL server encoding:

su - postgres
psql
postgres=# \l
                             List of databases
   Name    |  Owner   | Encoding  | Collate | Ctype |   Access privileges
-----------+----------+-----------+---------+-------+-----------------------
 postgres  | postgres | SQL_ASCII | C       | C     |
 template0 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres
 template1 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres

To change the template1 encoding to UTF8, run the following commands:

update pg_database set datallowconn = TRUE where datname = 'template0';
\c template0
update pg_database set datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UTF8';
update pg_database set datistemplate = TRUE where datname = 'template1';
\c template1
update pg_database set datallowconn = FALSE where datname = 'template0';
\q

Restart the PostgreSQL server:

systemctl restart postgresql.service

To start Odoo automatically when the server is booted, add a systemd unit file with the following content:

vi /usr/lib/systemd/system/odoo.service
[Unit]
Description=Advanced OpenSource ERP and CRM server
Requires=postgresql.service
After=postgresql.service
[Install]
Alias=odoo.service
[Service]
Type=simple
PermissionsStartOnly=true
EnvironmentFile=-/etc/conf.d/odoo-server
User=odoo
Group=odoo
SyslogIdentifier=odoo-server
PIDFile=/run/odoo/odoo-server.pid
ExecStartPre=/usr/bin/install -d -m755 -o odoo -g odoo /run/odoo
ExecStart=/usr/local/bin/odoo-server -c /etc/odoo-server.conf --pid=/run/odoo/odoo-server.pid --syslog $OPENERP_ARGS
ExecStop=/bin/kill $MAINPID
[Install]
WantedBy=multi-user.target

The last thing left to do is enabling and starting up the service:

systemctl enable odoo.service

Start Odoo:

systemctl start odoo.service

Open http://your-server-IP:8069/web/database/manager and create a new database.

Then, you should be able to log in to the administrator back-end at http://server_IP:8069 using ‘admin’ as username and your newly created password. To reset your ‘admin’ password, navigate to:

Administrator -> Preferences -> Change password

That is it. Odoo 8 has been successfully installed on your CentOS 7 VPS.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install Odoo for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

View Comments

  • Can you help me to solve this problem? [root@localhost odoo]# systemctl status odoo.service odoo.service - Advanced OpenSource ERP and CRM server Loaded: loaded (/usr/lib/systemd/system/odoo.service; enabled) Active: failed (Result: exit-code) since mar 2015-11-17 00:23:10 CET; 6s ago Process: 5441 ExecStop=/bin/kill $MAINPID (code=exited, status=1/FAILURE) Process: 5438 ExecStart=/usr/local/bin/odoo-server -c /etc/odoo-server.conf --pid=/run/odoo/odoo-server.pid --syslog $OPENERP_ARGS (code=exited, status=1/FAILURE) Process: 5437 ExecStartPre=/usr/bin/install -d -m755 -o odoo -g odoo /run/odoo (code=exited, status=0/SUCCESS) Main PID: 5438 (code=exited, status=1/FAILURE) nov 17 00:23:10 localhost.localdomain odoo-server[5441]: -s, --signal send specifie...l nov 17 00:23:10 localhost.localdomain odoo-server[5441]: -q, --queue use sigqueue(...) nov 17 00:23:10 localhost.localdomain odoo-server[5441]: -p, --pid print pids wi...m nov 17 00:23:10 localhost.localdomain odoo-server[5441]: -l, --list [=] list signal n...e nov 17 00:23:10 localhost.localdomain odoo-server[5441]: -L, --table list signal n...s nov 17 00:23:10 localhost.localdomain odoo-server[5441]: -h, --help display this help and...t nov 17 00:23:10 localhost.localdomain odoo-server[5441]: -V, --version output version inform...t nov 17 00:23:10 localhost.localdomain odoo-server[5441]: For more details see kill(1). nov 17 00:23:10 localhost.localdomain systemd[1]: odoo.service: control process exited, code...=1 nov 17 00:23:10 localhost.localdomain systemd[1]: Unit odoo.service entered failed state. Hint: Some lines were ellipsized, use -l to show in full. [root@localhost odoo]#

  • New error during new install, I didn't have this one before: After this line: python setup.py install ....error: Installed distribution six 1.3.0 conflicts with requirement six>=1.4 What can I do?

    • I had similar problem on CENTOS 7 to solve I upgraded several python module, here's what I did to complete setup.py without error yum install epel-release yum install -y python-pip pip install —-upgrade six pip install --upgrade setuptools pip install --upgrade pytz

      • I had similar problem on CENTOS 7 to solve I upgraded several python module, here's what I did to complete setup.py without error yum install epel-release yum install -y python-pip pip install —-upgrade six pip install --upgrade setuptools pip install --upgrade pytz

    • Please run the following commands: yum clean all yum update yum install postgresql-libs postgresql-server postgresql php-pgsql php-gd babel python-devel libxslt-python pyparsing python-dateutil python-decorator python-imaging python-jinja2 python-ldap python-lxml python-mako python-psycopg2 python-reportlab python-requests python-werkzeug python-yaml python-docutils python-matplotlib python-unittest2.noarch python-babel python-gevent pygtk2 glade3 pytz libxslt-devel bzr automake gcc gcc-c++ byacc kernel-headers

      • Please run the following commands: yum clean all yum update yum install postgresql-libs postgresql-server postgresql php-pgsql php-gd babel python-devel libxslt-python pyparsing python-dateutil python-decorator python-imaging python-jinja2 python-ldap python-lxml python-mako python-psycopg2 python-reportlab python-requests python-werkzeug python-yaml python-docutils python-matplotlib python-unittest2.noarch python-babel python-gevent pygtk2 glade3 pytz libxslt-devel bzr automake gcc gcc-c++ byacc kernel-headers

      • Hello, I've the same error "Installed distribution six 1.3.0 conflicts with requirement six>=1.4". Done the commands above (yum clean all, yum update, ...), but the problem occur again. Please how can I solve it? Thanks

        • Hello, I've the same error "Installed distribution six 1.3.0 conflicts with requirement six>=1.4". Done the commands above (yum clean all, yum update, ...), but the problem occur again. Please how can I solve it? Thanks

          • Problem is: Installed /tmp/easy_install-sRGEyY/unittest2-1.1.0/traceback2-1.4.0-py2.7.egg error: Installed distribution six 1.3.0 conflicts with requirement six>=1.4 I found that there is no package python-six-1.4 for centos 7. Latest is python-six-1.3.0-4.el7.noarch for python 2.7 The requirement for six>=1.4 is from unittest2 since version 1.0.1. So I put unittest2 < 1.0.1 on setup.py and then I had the ImportError: cannot import name range

            • Problem is: Installed /tmp/easy_install-sRGEyY/unittest2-1.1.0/traceback2-1.4.0-py2.7.egg error: Installed distribution six 1.3.0 conflicts with requirement six>=1.4 I found that there is no package python-six-1.4 for centos 7. Latest is python-six-1.3.0-4.el7.noarch for python 2.7 The requirement for six>=1.4 is from unittest2 since version 1.0.1. So I put unittest2 < 1.0.1 on setup.py and then I had the ImportError: cannot import name range

  • You can put this instrucción for make easy your tutorial firewall-cmd --zone=public --add-port=8069/tcp --permanent firewall-cmd --reload thanks

  • i have same issue. it will be nice if the server specification can be stated. Judging from everyone experience

  • Thank you, I have successfully installed, but the log is empty, openerp-server.log is 0 bytes, I've set log_level = info, in odoo operation, the log file is always empty, ask admin for help?

  • hello i did all the steps on new fresh vps but after i finished and try to open the ip:port not work this is the result for the status systemctl status odoo.service odoo.service - Advanced OpenSource ERP and CRM server Loaded: loaded (/usr/lib/systemd/system/odoo.service; enabled) Active: failed (Result: exit-code) since Mon 2015-04-06 11:43:15 EDT; 46s ago Process: 10839 ExecStop=/bin/kill $MAINPID (code=exited, status=1/FAILURE) Process: 10836 ExecStart=/usr/local/bin/odoo-server -c /etc/odoo-server.conf --pid=/run/odoo/odoo-server.pid --syslog $OPENERP_ARGS (code=exited, status=1/FAILURE) Process: 10835 ExecStartPre=/usr/bin/install -d -m755 -o odoo -g odoo /run/odoo (code=exited, status=0/SUCCESS) Main PID: 10836 (code=exited, status=1/FAILURE) Apr 06 11:43:15 pm odoo-server[10839]: -s, --signal send specified signal Apr 06 11:43:15 pm odoo-server[10839]: -q, --queue use sigqueue(2) rather than kill(2) Apr 06 11:43:15 pm odoo-server[10839]: -p, --pid print pids without signaling them Apr 06 11:43:15 pm odoo-server[10839]: -l, --list [=] list signal names, or convert one to a name Apr 06 11:43:15 pm odoo-server[10839]: -L, --table list signal names and numbers Apr 06 11:43:15 pm odoo-server[10839]: -h, --help display this help and exit Apr 06 11:43:15 pm odoo-server[10839]: -V, --version output version information and exit Apr 06 11:43:15 pm odoo-server[10839]: For more details see kill(1). Apr 06 11:43:15 pm systemd[1]: odoo.service: control process exited, code=exited status=1 Apr 06 11:43:15 pm systemd[1]: Unit odoo.service entered failed state.

  • It seems Ilkka Seittenranta is right. Odoo install fails if his steps are not done on Centos minimal install. Then you end up with the same error as everyone are writing about in here. After his step, you can install Odoo, and you will end up with "Finished processing dependencies for odoo==8.0-20150405" Now I am left struggling with the error that Cornelio is facing. And there is no logs indicating any error. odoo-server.log i 0 bytes. Have no idea on how to continue. Why not install from the RPM on odoo site? Regards, Lars.

  • Hi there. The instructions say: Run the following commands: vi ~odoo/.bashrc export LD_LIBRARY_PATH; LD_LIBRARY_PATH=/usr/local/lib source ~odoo/.bashrc This just opens VI. Does it want me to insert the second line somewhere in the text document and then save it?

  • Hello great tut i have gone trough step by step but now i am stuck I am getting following error please help openerp.service - Advanced ERP and CRM server Loaded: loaded (/usr/lib/systemd/system/openerp.service; enabled) Active: failed (Result: exit-code) since Thu 2015-02-19 03:57:32 EST; 7min ago Process: 1036 ExecStop=/bin/kill $MAINPID (code=exited, status=1/FAILURE) Process: 1029 ExecStart=/usr/local/bin/openerp-server -c /etc/openerp-server.conf --pid=/run/openerp/openerp-server.pid --syslog $OPENERP_ARGS (code=exited, status=1/FAILURE) Process: 1026 ExecStartPre=/usr/bin/install -d -m755 -o openerp -g openerp /run/openerp (code=exited, status=0/SUCCESS) Main PID: 1029 (code=exited, status=1/FAILURE) Feb 19 03:57:32 sohaib openerp-server[1036]: -s, --signal send spe...l Feb 19 03:57:32 sohaib openerp-server[1036]: -q, --queue use sigq...) Feb 19 03:57:32 sohaib openerp-server[1036]: -p, --pid print pi...m Feb 19 03:57:32 sohaib openerp-server[1036]: -l, --list [=] list sig...e Feb 19 03:57:32 sohaib openerp-server[1036]: -L, --table list sig...s Feb 19 03:57:32 sohaib openerp-server[1036]: -h, --help display this hel...t Feb 19 03:57:32 sohaib openerp-server[1036]: -V, --version output version i...t Feb 19 03:57:32 sohaib openerp-server[1036]: For more details see kill(1). Feb 19 03:57:32 sohaib systemd[1]: openerp.service: control process exited,...=1 Feb 19 03:57:32 sohaib systemd[1]: Unit openerp.service entered failed state. Hint: Some lines were ellipsized, use -l to show in full.

  • Missing wget packages from "Install all prerequisite packages...". It helps a lot install setuptools and pip before odoo: cd wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz tar xzf setuptools-1.4.2.tar.gz cd setuptools-1.4.2 python setup.py install cd curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python2.7 - Now you can install all packets what are listed in odoo/requirements.txt: pip install Babel pip install Jinja2 pip install Mako pip install MarkupSafe pip install Pillow pip install PyYAML pip install Werkzeug pip install argparse pip install decorator pip install docutils pip install feedparser pip install gdata pip install gevent pip install greenlet pip install jcconv pip install lxml pip install mock pip install passlib pip install psutil pip install psycogreen pip install psycopg2 pip install pyPdf pip install pydot pip install pyparsing pip install pyserial pip install python-dateutil pip install python-ldap pip install python-openid pip install pytz pip install pyusb pip install qrcode pip install reportlab pip install requests pip install simplejson pip install six pip install unittest2 pip install vatnumber pip install vobject pip install wsgiref pip install xlwt One packet need to install by hand: cd wget http://download.gna.org/pychart/PyChart-1.39.tar.gz tar xzf PyChart-1.39.tar.gz cd PyChart-1.39 python setup.py install The continue "Install Odoo 8:"

    • If you follow the instructions closely and install all prerequisite packages, there is no need to install setuptools and pip. We tested the tutorial and it works as expected.

      • If you follow the instructions closely and install all prerequisite packages, there is no need to install setuptools and pip. We tested the tutorial and it works as expected.