Install Odoo12 On Ubuntu20.04
💡 This post is insightful for the following scenarios.
- Odoo Installation
Background
To avoid Odoo corrupting my noble macOS 🤫, I’ve decided to install Odoo on Ubuntu.
Step
0. Preparation
Of course, you need to have Ubuntu which is 20.04 (X86) and it need to be able to connect the Internet.
The system I use is build from my previous post.
1. Install Git
1 | sudo apt-get update |
2. Install PostgreSQL
1 | # the version I downloaded is postgresql12 |
3. Create PostgreSQL user and database
1 | # start postgresql service |
You may meet some error when you run the last command
1 | FATAL: Peer authentication failed for user "odoo" |
If so, you should change your pg_hba.conf configuration
1 | vim /etc/postgresql/12/main/pg_hba.conf |
1 | # then restare postgresql service |
4. Install curl
1 | sudo apt-get install curl |
5. Install node.js and less
Install nodejs version manager
1 | curl -L http://git.io/n-install | bash |
Reopen your terminal and check current version
Install less
1 | npm install -g less |
6. Clone Odoo source code
1 | git clone https://github.com/odoo/odoo.git -b 12.0 --depth=1 ./odoo12 |
7. Install specific python version (optional)
Choose one of these two options that you like
7.1 Install pyenv to manage python version
1 | # install pyenv |
7.2 Use original python3 from ubunutu
Here I use original python 3.8 from ubunutu (which not include pip3)
8. Install odoo dependencies by pip3
1 | # install pip3 |
You may meet some difficulties when you want to install the following package:
8.1 lxml: install it without specific version.
You need to modify requirements.txt
8.2 Pillow: install it without specific version
You need to modify requirements.txt
8.3 psycopg2: lack of specific library
You need to install some package. You don’t need to modify requirements.txt.
1 | sudo apt-get install libpq-dev |
8.4 pyldap: lack of specific library
You need to install some package. You don’t need to modify requirements.txt.
1 | # If you follow the approach "Install pyenv to manage python version" in this article, you may not meet this error because you already install these libraries before |
9. Start odoo
1 | # enter odoo folder (which is odoo12 as I wrote above) |
Then turn on your browser and go to this url -> localhost:8069, and you may find some error now.
Front end:
Back end:
This is because you have not configure your odoo.
1 | # run this command and then exit it |
You can see there is odoo configuration now.
1 | # modify your .odoorc configuration file |
You should update these three configuration: “db_name”, “db_user”, “db_password”.
Start the odoo again, and it show the error message like these.
1 | # well let's initialize our database as there is nothing in the database |
And this time everything is fine.
10. Enjoy your odoo 12
If you want to customize you odoo addon, maybe you can check this link.