Hi guys,
1. Introduction
In this tutorial I will teach you how to install Odoo 9 on Ubuntu 16.04. The script that you will use is based on the code from André Schenkels but has been updated and improved.
2. Downloading the script
The first step is to download my script from Github and to add the code in a new .sh file on your Ubuntu machine, wherever you’d like this.
For example right under /home. Open up an Ubuntu terminal and cd to the directory where you’d like to keep the script and then create the file:
1 |
sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/All/odoo_install.sh |
If you’re curious about how the whole code looks and works you can find it on my Github account.
Now open up the file and edit the parameters to your liking:
1 |
sudo nano odoo_install.sh |
There are some things you can configure/change to your likings at the top of the script. You can choose if you wish to install Wkhtmltopdf or not, which version you’d like, where the location is and most importantly what the master admin password is.
Tip: always modify this for every Odoo you install!
3. Making the Odoo installation file executable
The next step is to make this file executable. After you’ve made it executable you can execute it and everything will be installed automatically.
do this with the following command:
1 |
sudo chmod +x odoo_install.sh |
4.Running the script
Now that the code is in your file and the file is executable you simply have to execute it with the following command:
1 |
./odoo_install.sh |
You will see that the script automatically starts updates, downloads required packages, creates the user, downloads the code from Github, …
Give the script a few minutes to configure and install everything and eventually you will see something like this:
You now have a fully functional Odoo V9 on your Ubuntu 16.04! Congratulations.
5. Extra information
In the script you saw there was an option to change the Odoo port (OE_PORT). When you’d change this port number to 8070 in the install script it would be applied to /etc/your-config-file.conf and this would give you the ability to change the default port.
To apply these changes you should do the following:
The -c will change the configuration and memorize what you’ve changed under /etc/your-config-file.conf. Because my port was set to 8070 this is telling the Odoo that it should run on port 8070. When you would now open up your browser and navigate to http://localhost:8070/ you will see it is running there:
Has this tutorial helped you, do you have any feedback or questions? Post away!
Hello,
Nice and good tutorial and is working fine. After creating a database the first screen that comes up gives out an error.
TypeError: CleanCSS is not a function.
How do we install this into the lessc?
Hi Armand,
This is a confirmed issue by Odoo and a possible fix is listed. Have a look at this: https://github.com/odoo/odoo/issues/9113
Hey Thank you very much for your Tutorial.
The installation worked pretty well but after it i can’t access to the server.
i tried to access directly and with adding the port. As well i tried to access the web/database/manager directory.
i always get “Failed to open page”
Do i’ve to installe some other packages?
Thank you in advanced
Starting the server would be the best option 😛 thank’s anyway 😀
I had to create a database first, when trying to access the server on port 8069. Then I get 500 Internal Server Error when trying to access the page.
Any pointers on where to look etc?
I checked the log file in /var/log and the last few lines says
2016-05-03 15:11:57,444 8015 WARNING eyenetworks openerp.addons.base.ir.ir_cron: Skipping database eyenetworks as its base version is not 9.0.1.3.
And there my knowledge stops
Hi JPT,
Looks like you’re trying to import a database from somewhere else in this Odoo, which is ahead of your local Odoo.
Hi JPT,
At this point there is a known issue for Odoo 9, see https://github.com/odoo/odoo/issues/9113#issuecomment-216150521 otherwise check out the logfile. (/var/log/odoo)
A bit of follow-up information after further investigation: my ~/.cache directory do belong to me, but it doesn’t contain any pip/ subdirectory.
I modified the script as:
#sudo pip install gdata psycogreen
sudo -H pip install gdata psycogreen
And ran it again.
Previous message disappeared.
Still don’t know how to launch odoo …
Hi Damien,
The -H pip install seems to be thrown up sometimes, but I only had problems with -H for other libraries (lessc). Check if you have a running process on the port you wanted to install Odoo on, if not you should probably run the script again. This means it ran stuck / missed a part after the sudo -H pip install gdata psycogreen.
When i try install 1 apps i take the below error and now i can fix the problem…..
“Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. ”
I try :
– delete the module
-restart, reboot, start, stop, clean the history ……
how i can fix this problem…..any ideas???
PS: when i check i find the file /etc/odoo-server.conf and have only the below this is right???
[options]
; This is the password that allows database operations:
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /usr/lib/python2.7/dist-packages/openerp/addons
logfile = /var/log/odoo/odoo-server.log
addons_path=/odoo/odoo-server/addons,/odoo/custom/addons
xmlrpc_port = 8069
Hi Antreas,
Your odoo-server.conf is looking just fine. Check out the logfile (/var/log/odoo/odoo-server.log) in order to know what the true issue is. It’ll be printed there.
hello, Thanks for your help…….
the bottom of the logs file i have this :
2016-05-15 10:22:13,294 569 INFO ? openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2016-05-15 10:22:13,296 569 INFO ? openerp.sql_db: Connection to the database failed
2016-05-15 10:22:13,296 569 ERROR ? openerp.addons.bus.models.bus: Bus.loop error, sleep and retry
Traceback (most recent call last):
File “/odoo/odoo-server/addons/bus/models/bus.py”, line 168, in run
self.loop()
File “/odoo/odoo-server/addons/bus/models/bus.py”, line 146, in loop
with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
File “/odoo/odoo-server/openerp/sql_db.py”, line 630, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File “/odoo/odoo-server/openerp/sql_db.py”, line 164, in __init__
self._cnx = pool.borrow(dsn)
File “/odoo/odoo-server/openerp/sql_db.py”, line 513, in _locked
return fun(self, *args, **kwargs)
File “/odoo/odoo-server/openerp/sql_db.py”, line 581, in borrow
**connection_info)
File “/usr/lib/python2.7/dist-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
2016-05-15 10:23:03,347 569 INFO ? openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2016-05-15 10:23:03,349 569 INFO ? openerp.sql_db: Connection to the database failed
2016-05-15 10:23:03,349 569 ERROR ? openerp.addons.bus.models.bus: Bus.loop error, sleep and retry
Traceback (most recent call last):
File “/odoo/odoo-server/addons/bus/models/bus.py”, line 168, in run
self.loop()
File “/odoo/odoo-server/addons/bus/models/bus.py”, line 146, in loop
with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
File “/odoo/odoo-server/openerp/sql_db.py”, line 630, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File “/odoo/odoo-server/openerp/sql_db.py”, line 164, in __init__
self._cnx = pool.borrow(dsn)
File “/odoo/odoo-server/openerp/sql_db.py”, line 513, in _locked
return fun(self, *args, **kwargs)
File “/odoo/odoo-server/openerp/sql_db.py”, line 581, in borrow
**connection_info)
File “/usr/lib/python2.7/dist-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
2016-05-15 10:23:53,400 569 INFO ? openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2016-05-15 10:23:53,402 569 INFO ? openerp.sql_db: Connection to the database failed
2016-05-15 10:23:53,402 569 ERROR ? openerp.addons.bus.models.bus: Bus.loop error, sleep and retry
Traceback (most recent call last):
File “/odoo/odoo-server/addons/bus/models/bus.py”, line 168, in run
self.loop()
File “/odoo/odoo-server/addons/bus/models/bus.py”, line 146, in loop
with openerp.sql_db.db_connect(‘postgres’).cursor() as cr:
File “/odoo/odoo-server/openerp/sql_db.py”, line 630, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File “/odoo/odoo-server/openerp/sql_db.py”, line 164, in __init__
self._cnx = pool.borrow(dsn)
File “/odoo/odoo-server/openerp/sql_db.py”, line 513, in _locked
return fun(self, *args, **kwargs)
File “/odoo/odoo-server/openerp/sql_db.py”, line 581, in borrow
**connection_info)
File “/usr/lib/python2.7/dist-packages/psycopg2/__init__.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
2016-05-15 10:26:12,936 584 INFO ? openerp: OpenERP version 9.0c
2016-05-15 10:26:12,943 584 INFO ? openerp: addons paths: [‘/odoo/.local/share/Odoo/addons/9.0′, u’/odoo/odoo-server/addons’, u’/odoo/custom/addons’, ‘/odoo/odoo-server/openerp/addons’]
2016-05-15 10:26:12,943 584 INFO ? openerp: database: odoo@default:default
2016-05-15 10:26:13,745 584 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
Thanks Again!!!
Hi Anteas,
Your real issue is this: “OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “.
This issue is coming from the fact that Odoo cannot find / connect to your postgreSQL. This might be because the installation went wrong or that the postgreSQL server is not running. Have a look around the internet for possible causes, since there can be many reasons.
Hi Yenthevg,
I really liked the script you did and wanted to know if I can show you an example of the changes to be made in the script to install another installation of Odoo, which is in another port and connect to another scheme database .
Hi Rafael,
The port can be easily changed in the script itself. Another scheme is not possible, since postgreSQL only allows one scheme at this point. (unless you’re talking about connecting it to another user).
I want to have multiple URLs of the independent application that connect to different users in the database postgress, this in order to have more than one installation for different clients pointing to the database postgress but to different users. What advice can you give me?
Hi Rafael,
I’m not sure why you would want to do this and how to handle this.. Why not different installations / users?
Hello,
Install in Odoo 9 in ubuntu 16.04 in virtualbox virtual machine and after installation, create the database and enter I get an error in the application:
content: “TypeError: CleanCSS is not a function\A at Object.toCSS (/usr/lib/nodejs/less/lib/less/parser.js:620:32)\A at /usr/lib/nodejs/less/bin/lessc:357:32\A at Object.finish [as _finish] (/usr/lib/nodejs/less/lib/less/parser.js:669:28)\A at Object.tree.importVisitor.run (/usr/lib/nodejs/less/lib/less/import-visitor.js:25:22)\A at Object.Parser.parser.parse [as parse] (/usr/lib/nodejs/less/lib/less/parser.js:675:22)\A at parseLessFile (/usr/lib/nodejs/less/bin/lessc:345:12)\A at Socket. (/usr/lib/nodejs/less/bin/lessc:407:9)\A at emitNone (events.js:72:20)\A at Socket.emit (events.js:166:7)\A at endReadableNT (_stream_readable.js:905:12)\A This error occured while compiling the bundle ‘web.assets_common’ containing:\A – /web/static/src/less/mimetypes.less\A – /web/static/src/less/animation.less\A – /web_planner/static/src/less/web_planner_common.less\A – /web_editor/static/src/less/web_editor.less”;
The buttons of the application modules are not visible to load modules, you could help me telling me how I fix it?
Hi Rafael,
Looks like one of less packages did not install correctly or is pointing to the incorrect location. This might be related to this issue: https://github.com/odoo/odoo/issues/8676
Yenthe,
did you update your script after the issue about lessc (9113 on github) or do I need to edit it again?
F.
Hi Federico,
I haven’t had much problems with this yet. If you should face the problem just run the command again. 🙂
Thanks for this great post!
When installing I got this error, that I found in some foruns:
/var/lib/dpkg/info/odoo.postinst: 28: /var/lib/dpkg/info/odoo.postinst: update-python-modules: not found
dpkg: erro ao processar o pacote odoo (–install):
sub-processo script post-installation instalado retornou estado de saída de erro 127
It seems that odoo uses “update-python-modules”, that is included in “python-support” package, but this package is not available in Ubuntu 16.04. anymore.
I could install “python-support” package in Ubuntu 16.04 using the “llxdev” team package available at
https://launchpad.net/~llxdev/+archive/ubuntu/xenial/
copying the following line and adding it to my system’s software sources:
deb http://ppa.launchpad.net/llxdev/xenial/ubuntu xenial main
Before reinstalling odoo, I had to (re)create the directory /var/lib/odoo (“sudo” not necessary if you are logged as root):
sudo mkdir /var/lib/odoo
sudo chown odoo:odoo /var/lib/odoo
And then:
sudo apt-get update
sudo apt-get install python-support
After that, odoo was installed automatically and successfully to me!
But maybe you need also:
sudo apt-get install odoo
I hope it helps if someone got the same error.
Hi Gustavo,
Thank you for writing this out in detail and I’m sorry it didn’t work out of the box for you!
The installation is successfully completed using the given instructions. However, I tried to changed the port by updating in /etc/odoo-server.conf and restarting the service “service odoo-server restart -c /etc/odoo-server.conf”. Unfortunately, the port doesn’t change. Could you advise me, please?
Hi Amt,
This should really work though. Make sure you’re referencing to the correct .conf file and that the port is correct in there. You could also add –xmlrpc-port=8080 in the terminal command though.
After installing many servers via terminal I can say that this has been an amazing time saver. Thank you so much!
Hi, I need to increase max upload size to be able to import addons. I started this on a clean digital ocean 16.04 64bit.
I cannot find any PHP at all….
What am I missing? How do I after using this script I can change this?
Hi Alexander,
The max upload size should be limited by the ir_module.py file in Odoo. See this line: https://github.com/odoo/odoo/blob/9.0/addons/base_import_module/models/ir_module.py#L16
Hi,
great script.
what do i need so i can access via hostname (myhost:8069) and usind the databasename (mydatabase:8069 / mydatabase)?
Hi Fernando,
Thank you! You’ll need to forward your Odoo instance to An URL with Nginx or Apache and a Cname record. The database part can be done with a db_filter configuration (see the official documentation)
Works in first time!!!!
Good job… and many thanks!!!
For development in Odoo V8 and V9 simultaneously, you need to change in configuration file of V9 the data_dir. Exemple :
– For V8 instance :
data_dir = /home/captivea/.local/share/Odoo
– For V9 instance :
data_dir = /home/captivea/.local/share/Odoo9
Hi. Odoo have rename the binary from openerp-server to odoo-bin for v10.
Can you update your script for V10 installs?
Happy to make a donation. 🙂
Thanks!
Hi David,
I’m in the progress of expanding the script for V10 and also creating a new blogpost for it, I hope to get things done by the end of this week. Just figuring out why the service doesn’t start automatically with V10. If you would donate: thank you! 🙂
Change the /etc/init.d/odoo-server file
from
DAEMON=/odoo/odoo-server/openerp-server
to
DAEMON=/odoo/odoo-server/odoo-bin
Thanks a lot for the tip David! The whole script is now available for V10, both community and Enterprise. See https://github.com/Yenthe666/InstallScript/blob/10.0/odoo_install.sh
one questions username for https://github.com where found?
Hi Ivan,
This should be your own Github account, if you do not have one you should create one and make sure you have access to the Odoo Enterprise repository.
Found a quick fix for v10. You have to add [options] line in odoo-server.conf in /etc/ folder, and rename DEAMON to DEAMON=/odoo/odoo-server/odoo-bin in odoo-server file in etc/init.d folder.
yenthevg
please i have odoo 8 on my system but also want to have keep odoo9 without it disrupting my odoo8.
the issue now is that i created another directory for my odoo 9 thinking it will download from the scratch and i will be able to run it without issues. but it blow my mind. it did not work. though i specified the port to 8070. for odoo 9 but it is not starting
what do i do?.
Hi Samuel,
If you create two different postgresql users, with two different Odoo codebases and system users it’ll work fine out of the box.
Hi, i add my custom addon inside the folder, but when i load, i get 404 erro in browser.
Hi Bruno,
Have a look at the Odoo logfile. I’m sure you can find more info there!
after install on ubuntu 16.04 on a virtualbox machine. finish install and its working, but when i reset de machine doesnt start anymore ubuntu. says low grapichs mode
Hi nicoas,
This has nothing to do with the Odoo but with the Linux itself. The problem can be with the graphics cards, with memory and so many more. Please do try to google around – there are quite a lot of answers!
Regards,
Yenthe