How to Install Odoo on Mac OS using Homebrew

In this tutorial we will look into how to install Odoo on Mac OS using the package manager Homebrew.

Install Homebrew:

If you do not already have Homebrew set up on your system, you can install it by running the command below in the terminal:

To check that Homebrew is installed, run the command:

This should return something like:

Now that Homebrew is set up, let’s start installing the different packages we need to run Odoo.

Installing Python:

Odoo was written in Python so we need to install it. There is a version of Python that comes set up with every macOS installation but it is not supported by Odoo. So we need to install a new one. Run the command:

Installing Postgresql:

Odoo will need a database management system to store its data, we are going to use PostgreSQL.

Start the Postgres server:

This will start Postgres at port 5432. To make sure that it is running you can run the commands lsof -I:5432  or pg_ctl -D /usr/local/var/postgres status

Installing Less:

Less (which stands for Leaner Style Sheets) is a backwards-compatible language extension for CSS. We will be using npm (node package manager) to install it.

The node package manager is set up while installing node.js. We are going to use nvm (node version manager) to install node.js. So here are the steps:

  • Install nvm:  brew install nvm
  • Install node: nvm install node  (to install the latest stable version of node) or nvm install version_number  (to install a specific version of node)
  • Install less globally:  npm install -g less

Installing freetype:

Next, we need to install Freetype and other libraries

Installing the Xcode command line tools:

Installing Odoo:

Clone Odoo from the GitHub Repository.

Next, change directory into the odoo directory ( cd odoo ) and install the dependencies included in the requirements.txt file.

Tip: When working with Python dependencies, it is recommended to use virtualenv to avoid conflicts between different versions. 

Running the Odoo server:

After installing the dependencies, we can now run the Odoo server. Run the command below:

This will start Odoo at port 8069. Open the browser and go to localhost:8069.

You will be presented with this screen:

Setting up the database:

The final step is to create a database by filling out the form. If this is your first time installing Odoo, make sure you check the button “Load demonstration data” to get some sample data to work with.

If everything went right, you should have the screen below:

That’s it! You are all good to go. 

Troubleshooting:

Error 1: ValueError: unknown locale: UTF-8

You might get the error ValueError: unknown locale: UTF-8  when you run the command ./odoo-bin . To fix this issue, add the code below to your ~/.bash_profile

This will these environment variables LC_ALL and LANG.

Error 2: Internal Server Error

The Odoo server is running but when you open localhost:8069 in the browser you get an Internal Server Error. Chances that PostgreSQL is not running. Make sure it’s running with the command  lsof -I:5432  and if it is not you can start it with the command  pg_ctl -D /usr/local/var/postgres status

I hope you found this tutorial useful and please leave a comment below if you have any question.

Leave a Reply

Your email address will not be published. Required fields are marked *