How to quickly deploy the Odoo ERP solution with Docker


If you’re looking to get a powerful ERP solution up and running, Jack Wallen has the solution by way of Odoo and Docker.

Image: Jack Wallen

Within the world of open source, there are plenty of enterprise resource planning (ERP) tools available to deploy for free that will help bring your business’s resource planning to new levels of efficiency and reliability. One such platform is Odoo, which happens to be one of the most popular open-source ERP solutions on the market.

With Odoo you can:

  • Boost your sales
  • Integrate services
  • Streamline operations
  • Build websites
  • Manage finances
  • Amplify marketing
  • Manage inventory
  • Supercharge your marketing
  • Improve your business productivity
  • Manage point of sale (PoS)

One thing that helps make Odoo stand out above the crowd is the modules that can be installed to extend the feature set of the platform. As of this writing, 61 modules can be added from within the Odoo marketplace.

For those that might think Odoo is a challenge to deploy, I give you Docker. By containerizing your Odoo deployment, you can get this platform up and running in minutes.

SEE: Ethics policy: Vendor relationships (TechRepublic Premium)

What you’ll need

The only thing you’ll need to deploy Odoo is a running server (or desktop) that supports Docker. I’ll be demonstrating on Ubuntu Server 22.04, but as long as your system can support Docker (be it Linux, macOS or Windows), you’re good to go.

How to install Docker on Ubuntu Server

On the off-chance you don’t already have Docker installed on Ubuntu Server, let’s make that happen now.

The first thing we’ll do is add the necessary Docker repository (to install the latest version of Docker-CE). Log into your server, and add the GPG key with:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Next, add the repository:

echo “deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install the required dependencies with:

sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y

Update apt and install Docker (and the required components) with the commands:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y

Add your user to the Docker group with:

sudo usermod -aG docker $USER

Log out and log back in for the changes to take effect.

How to deploy Odoo as a Docker container

The first thing we’ll do is pull the latest versions of Odoo and PostgreSQL with the commands:

docker pull odoo:latest
docker pull postgres:latest

We’re going to deploy the database with persistent storage. In the event something happens to the Odoo container, this will ensure the data will remain. The command to deploy the PostgreSQL container is:

docker run -d -v odoo-db:/var/lib/postgresql/data -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres –name db postgres

Our persistent data volume will be located in /var/lib/postgresql/data.

Next, deploy the Odoo container with:

docker run -v odoo-data:/var/lib/odoo -d -p 8069:8069 –name odoo –link db:db -t odoo:latest

Give the container a minute or so to deploy before continuing.

How to open the firewall

If you’re using a firewall (which you should), you’ll need to open port 8069. With Uncomplicated Firewall, that command would be:

sudo ufw allow 8069

If you’re using an RHEL-based distribution, the commands would be:

sudo firewall-cmd –zone=public –add-port=8069/tcp –permanent
sudo firewall-cmd –reload

Now, you’re ready to deploy Odoo.

How to access the Odoo interface

Open a web browser and type http://SERVER:8069 (where SERVER is the IP address of the hosting server). You should be greeted by the database/admin setup page (Figure A).

database admin setup for Odoo
Figure A: Here you must configure a new database and an admin user.

You should also see a database master password in the greeting. Make sure to copy that down, as you’ll need it to work with the database at a later time.

Give the database a new name  that is not the same name used in the Docker command earlier, fill out an email address (that will be used for the admin login) and a password, and finish up the rest of the required information. When finished, click Create database. This process will take some time, especially if you opt to include the demo data.

Once the database creation completes, you’ll be presented with the Odoo main page (Figure B), where you can start installing all of the modules you need to serve your business ERP functionality.

list of applications that can be added on Odoo
Figure B: The Odoo marketplace has plenty of apps you can add.

Congratulations, you just deployed a powerful ERP solution in minutes. Do note that some of the apps listed in the Marketplace do have an associated cost. Any app you see listed with an Upgrade icon most likely comes with a required fee. However, any app with an Install icon should be free. Enjoy your new enterprise resource planning platform.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.



Source link