Step 1. Log as root user and update system
Open Terminal
Window
2. Enter below
command for root access, and after
entering it ask for root password.
sudo
/bin/bash
[sudo] password for user : (Enter your root password)
3. Now make
sure your server has all the latest versions & patches by
doing an update:
sudo apt-get update
Now we’re ready to start the Odoo install.
Step 2. Create the Odoo user that will own and run the application
- Create odoo user and installation directory by below command
sudo adduser --system
--home=/opt/odoo --group odoo
/opt/odoo, this is where the OpenERP
server code will reside and is created automatically by the command above
Now we check odoo user
by below command
sudo su - odoo -s /bin/bash
When
you have done what you need you can leave the odoo user’s shell by typing below
command and back to root shell.
Exit
Step 3. Install and configure the database server, PostgreSQL
- Install Postgresql by below command
sudo apt-get install postgresql
- For configure the Odoo user on postgres, We require postgres shell by below command
sudo su - postgres
- Now create a new database user. This is so Odoo has access rights to connect to PostgreSQL and to create and drop databases.
[Remember what your choice of password is
here; you will need it later on]
createuser --createdb --username
postgres --no-createrole --no-superuser --pwprompt odooEnter password for new role: ********Enter it
again: ********- Finally exit from the postgres user account by below command and return to root shell.
Exit
Step 4. Install the necessary Python libraries for the server
1. Give below command one by one to install
python libraries
pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd
pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrdStep 5. Install the Odoo server from git
1. First we require to install Git by below command
sudo apt-get install git
2. Now For clone odoo from git we require Odoo shell access so we
switch to odoo user by below command.
sudo su - odoo -s /bin/bash
3.
Now Grab a copy of the most current Odoo 8 branch
[Note the “.” at the end of this
command!]
git clone
https://www.github.com/odoo/odoo --depth 1 --branch 11.0 --single-branch .
(This might take a little while depending on
the speed of your Internet connection.)
4.
Once
it’s finished exit from the odoo user by below command and return to root
shell.
Exit
Exit
Step 6. Configure the Openerp application.
The
default configuration file for the server (/opt/odoo/debian/odoo.conf) is actually very minimal
and will, with only a small change work fine so we’ll copy that file to where
we need it and change its ownership and permissions:
sudo cp /opt/odoo/debian/odoo.conf
/etc/odoo-server.confsudo
chown odoo: /etc/odoo-server.confsudo
chmod 640 /etc/odoo-server.conf
The
above commands make the file owned and writeable only by the odoo user and
group and only readable by odoo and root.
- To allow the
odoo server to run initially, you should only need to change two lines in this
file. Toward to the top of the file change the line(For Edit
configuration File use sudo nano /etc/odoo-server.conf)
db_password = False(Replace False with the same password you used back in step 3)
addons_path
= /usr/lib/python2.7/dist-packages/openerp/addons replace this with addons_path
= /opt/odoo/addons instead.
One other line we have to add in the
configuration file at last.
logfile = /var/log/odoo/odoo-server.log
(Save Configuration File by Ctrl + X and it ask for save then Press Y and Enter)
- Now we can start odoo server using odoo user
Change root shell to odoo shell by below
commandsudo su - odoo -s
/bin/bashstart odoo server/opt/odoo/openerp-server
If you end up with a few lines
eventually saying OpenERP then you are all set.
If
there are errors, you’ll need to go back and find out where the problem is.
- Now enter
CTL+Cto stop the server and thenexit
Step 7. Installing the boot script
1. Script file from
/opt/odoo/debian/odoo.service to /etc/systemd/system/odoo.service
2.
Change
permission and ownership of script file by below command.
sudo chmod 755 /etc/systemd/system/odoo.service sudo chown root: /etc/systemd/system/odoo.service
3.
In the configuration file there’s an entry
for the server’s log file. We need to create that directory first so that the
server has somewhere to log to and also we must make it writeable by the
openerp user:
sudo mkdir /var/log/odoosudo chown odoo:root /var/log/odooStep 8. Testing Odoo Server
1.
To start the Odoo server type:
systemctl start odoo.service
or
service odoo start
2.
We
can check odoo server log by below command
tail
/var/log/odoo/odoo-server.log