Odoo is a suite of applications to help you manage any business from anywhere. Learn how to deploy using Compose and IBM Bluemix so you'll have your own cloud of enterprise tools.
Marketing, sales pipelines, distribution, point-of-sale; sometimes it can be overwhelming trying to find the right tools to help you manage your business. Odoo, formerly called OpenERP, is an open source platform for building business applications that comes with a set of pre-built modules covering many business needs. You can enable only the modules you need and can extend the system by building your own modules, or by connecting to existing modules through an XML-RPC interface.
In this article, we'll introduce you to Odoo and show you how to deploy the Odoo stack on IBM Bluemix Container Service with Compose PostgreSQL providing the data layer.
Introduction to Odoo
Odoo is an open source ERP system, which is really a suite of tools to help you manage every facet of a business. Odoo allows you to install the tools they need right away while enabling you to expand as future needs arise.
Odoo applications also have the ability to coordinate with each other, so adding an invoice to a customer in the sales pipeline can be automatically added to sales reports.
Odoo also includes a surprisingly complete content management system. The templating system can access data models from other modules, making it useful for creating internal-facing team sites, and has an extensive palette of common page elements for creating customer-facing sites.
There are many more features, and the system is deeply customizable and extensible so it can fit the needs of many businesses. The best way to explore Odoo is to experiment with it, so let's get a copy running and try it out.
You can download and install Odoo for Windows and Linux using the installer for each, available on the Odoo website. Or, if you're more inclined to tinker with the inner workings of things, you can download the source code on Github and build Odoo manually.
However, the easiest way to get started is to deploy the official Docker container which contains the entire application pre-configured and ready to deploy. Configuration takes place through environment variables, which are set when we launch the container.
For this article, we'll use the Docker container and create a production-ready deployment. We'll back it with Compose PostgreSQL and host the Odoo application itself in the IBM Bluemix Container Service.
Create the Compose PostgreSQL Deployment
Odoo uses PostgreSQL to store your business data, and the default container needs to have access to the PostgreSQL deployment. By default, it is linked to Odoo as a service called
db and which can be deployed along with Odoo using
Let's start with the data layer by spinning up a Compose PostgreSQL deployment. You can do so by creating a new database through the Compose UI or by creating a new deployment through the Compose API.
Once you have PostgreSQL set up, make sure you have your username and password available so we can configure the Odoo container with them; you can find them by clicking the reveal your credentials link on the overview page of your PostgreSQL deployment.
Deploy Odoo on Bluemix
Since we aren't modifying the original Docker image, we'll have Bluemix pull the Odoo container directly from Docker Hub. We'll also need to configure Odoo to use our Compose PosgreSQL deployment using the
HOST environment variable, and set the
PASSWORD environment variables to those of our PostgreSQL deployment.
First things' first, let's spin up the Blumix Container Service. If you haven't already, you can check out the procedure to install the Bluemix CLI on the Bluemix Container Service docs page. Once you have the
bx CLI tool installed and have logged in using
bx login, you'll need to pull the Docker image from Docker Hub into your IBM Bluemix registry:
bx ic cpi odoo registry.ng.bluemix.net/<your_namespace>/odoo
This will copy the image directly from Docker Hub and make it available in your Bluemix registry.
Once you have the container copied, creating a new container looks a lot like deploying a new container with Docker:
bx ic run -p 8069:8069 -e HOST=path_to_your_compose_postgresql -e USER=your_postgres_username -e PASSWORD=your_postgres_password registry.ng.bluemix.net/<your_namespace>/odoo
Let's break this down:
bx ic runuses the container service plugin of the bluemix tool, which uses the same command to run containers as the
dockercommand line tool does.
-p 8069:8069tells the bluemix to expose port 8069, which is what Odoo listens on by default, as port 8069 at our container URL.
-e HOST=path_to_your_compose_postgresqldefines an environment variable that Odoo uses to determine where your PostgreSQL deployment is hosted.
-e USER=your_postgres_usernamedefines an environment variable with the username you use to connect to PostgreSQL; you can find that in the connection strings section of the deployment in Compose.
-e PASSWORD=your_postgres_passworddefines an environment variable with the password you use to connect to PostgreSQL; you can also find this in the connection strings section of the deployment in Compose.
registry.ng.bluemix.net/<your_namespace>/odoois the name of the container we're going to run. Since the image is hosted on Docker Hub, we copied it into our local private Bluemix repository.
If all goes well, you should see the container ID output to the console:
bx ic ps to see the status of your container:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 88ce0f99-e14 registry.ng.bluemix.net/johnwoconnor_compose/odoo:latest "" 48 seconds ago Building 8069/tcp kickass_kilby
bx ic ps command shows a status of
Running you are good to go.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 88ce0f99-e14 registry.ng.bluemix.net/johnwoconnor_compose/odoo:latest "" 2 minutes ago Running 8069/tcp kickass_kilby
To access the container on the Internet, we'll need to assign an IP address to it. You can see the available IP addresses using the following command:
$ bx ic ips Number of allocated public IP addresses: 0 IP Address Container ID
If you don't have any available, use the following command to get one:
$ bx ic ip-request OK IP address "22.214.171.124" was obtained.
Now that you have an IP address available, use the bind command to bind the IP address to your container.
$ bx ic ip-bind <your_ip> <your_container_id> OK The IP address was bound successfully.
You should now be able to access your Odoo installation from the following url:
Summing Things Up
Now that you've seen how to deploy Odoo with Bluemix and Compose, give it a test drive, explore the modules, and see what options are the best fit for your business. If you like what you see, you can continue to use it knowing that your sensitive business data is safe and secure.
If you have any feedback about this or any other Compose article, drop the Compose Articles team a line at email@example.com. We're happy to hear from you.