{"id":8674,"date":"2024-05-22T17:13:09","date_gmt":"2024-05-22T17:13:09","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=8674"},"modified":"2024-05-22T17:13:11","modified_gmt":"2024-05-22T17:13:11","slug":"setup-odoo-docker-compose-linux-ubuntu-debian","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/","title":{"rendered":"Installing Odoo using Docker on Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en.jpg\" alt=\"Install Odoo using Docker Compose Linux ubuntu debian centos rRHEL\" class=\"wp-image-8704\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p><strong>Odoo<\/strong> is a powerful open-source suite of business applications that covers a wide range of functionalities, including Customer Relationship Management (CRM), Website Builder, eCommerce, Project Management, Accounting, and more. And While you can install Odoo directly on your Linux system, using Docker to set up Odoo provides several advantages, such as easier deployment, better resource isolation, and consistent environments across different systems.<\/p>\n\n\n\n<p>In this article, we&#8217;ll walk you through the step-by-step process of installing Odoo using Docker on a Linux system. We&#8217;ll cover the following topics:<\/p>\n\n\n\n<ol>\n<li>Prerequisites<\/li>\n\n\n\n<li>Installing Docker<\/li>\n\n\n\n<li>Pulling the Odoo Docker Image<\/li>\n\n\n\n<li>Creating a Docker Network<\/li>\n\n\n\n<li>Creating a PostgreSQL Container<\/li>\n\n\n\n<li>Creating an Odoo Container<\/li>\n\n\n\n<li>Accessing the Odoo Instance<\/li>\n\n\n\n<li>Configuring Odoo<\/li>\n\n\n\n<li>Updating Odoo<\/li>\n\n\n\n<li>Using Docker Compose for Odoo Installation<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-prerequisites\">1. Prerequisites<\/h2>\n\n\n\n<p>Before we begin, make sure you have the following prerequisites in place:<\/p>\n\n\n\n<ul>\n<li>A Linux system (this guide will use Ubuntu 20.04 LTS as an example, but the steps should be similar for other Linux distributions)<\/li>\n\n\n\n<li>A non-root user with sudo privileges<\/li>\n\n\n\n<li>A basic understanding of Docker and Linux command line<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-installing-docker\">2. Installing Docker<\/h2>\n\n\n\n<p>Docker is a popular containerization platform that allows you to package applications and their dependencies into isolated containers. If you haven&#8217;t installed Docker on your Linux system yet, follow these steps:<\/p>\n\n\n\n<ol>\n<li>Update the package index:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get update<\/code><\/pre>\n\n\n\n<ol start=\"2\">\n<li>Install the required packages to allow&nbsp;<code>apt<\/code>&nbsp;to use a repository over HTTPS:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get install -y \\\n    apt-transport-https \\\n    ca-certificates \\\n    curl \\\n    gnupg-agent \\\n    software-properties-common<\/code><\/pre>\n\n\n\n<ol start=\"3\">\n<li>Add Docker&#8217;s official GPG key:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -<\/code><\/pre>\n\n\n\n<ol start=\"4\">\n<li>Add the Docker repository to your system&#8217;s sources list:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo add-apt-repository \\\n   \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\\n   $(lsb_release -cs) \\\n   stable\"<\/code><\/pre>\n\n\n\n<ol start=\"5\">\n<li>Update the package index again:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get update<\/code><\/pre>\n\n\n\n<ol start=\"6\">\n<li>Install the latest version of Docker Engine and containerd:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get install -y docker-ce docker-ce-cli containerd.io<\/code><\/pre>\n\n\n\n<ol start=\"7\">\n<li>Verify that Docker is installed correctly by running the following command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker run hello-world<\/code><\/pre>\n\n\n\n<p>If everything is set up correctly, you should see a message indicating that the Docker installation is successful.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-pulling-the-odoo-docker-image\">3. Pulling the Odoo Docker Image<\/h2>\n\n\n\n<p>Odoo provides official Docker images that you can use to run Odoo in a containerized environment. To pull the latest Odoo image, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker pull odoo:latest<\/code><\/pre>\n\n\n\n<p>This command will download the latest version of the Odoo Docker image from the official Docker Hub repository. If you prefer to use a specific version of Odoo, you can replace&nbsp;<code>latest<\/code>&nbsp;with the desired version tag (e.g.,&nbsp;<code>odoo:14.0<\/code>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-creating-a-docker-network\">4. Creating a Docker Network<\/h2>\n\n\n\n<p>Docker networks allow containers to communicate with each other. We&#8217;ll create a new network for our Odoo and PostgreSQL containers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker network create odoo-network<\/code><\/pre>\n\n\n\n<p>This command creates a new Docker network named&nbsp;<code>odoo-network<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5-creating-a-postgresql-container\">5. Creating a PostgreSQL Container<\/h2>\n\n\n\n<p>Odoo requires a PostgreSQL database to store its data. We&#8217;ll create a PostgreSQL container and connect it to the&nbsp;<code>odoo-network<\/code>&nbsp;we just created:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=odoo --network=odoo-network --name db postgres:13<\/code><\/pre>\n\n\n\n<p>Let&#8217;s break down this command:<\/p>\n\n\n\n<ul>\n<li><code>docker run<\/code>: Runs a new container from an image<\/li>\n\n\n\n<li><code>-d<\/code>: Runs the container in detached mode (in the background)<\/li>\n\n\n\n<li><code>-e POSTGRES_USER=odoo<\/code>: Sets the PostgreSQL user to&nbsp;<code>odoo<\/code><\/li>\n\n\n\n<li><code>-e POSTGRES_PASSWORD=odoo<\/code>: Sets the PostgreSQL password to&nbsp;<code>odoo<\/code><\/li>\n\n\n\n<li><code>-e POSTGRES_DB=odoo<\/code>: Sets the name of the initial database to&nbsp;<code>odoo<\/code><\/li>\n\n\n\n<li><code>--network=odoo-network<\/code>: Connects the container to the&nbsp;<code>odoo-network<\/code><\/li>\n\n\n\n<li><code>--name db<\/code>: Assigns the name&nbsp;<code>db<\/code>&nbsp;to the container<\/li>\n\n\n\n<li><code>postgres:13<\/code>: Uses the official PostgreSQL 13 Docker image<\/li>\n<\/ul>\n\n\n\n<p>This command creates a new PostgreSQL container named&nbsp;<code>db<\/code>&nbsp;connected to the&nbsp;<code>odoo-network<\/code>&nbsp;with a database named&nbsp;<code>odoo<\/code>&nbsp;and credentials&nbsp;<code>odoo\/odoo<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6-creating-an-odoo-container\">6. Creating an Odoo Container<\/h2>\n\n\n\n<p>Now that we have a PostgreSQL container up and running, we can create an Odoo container and link it to the PostgreSQL container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker run -p 8069:8069 --name odoo --network=odoo-network -e HOST=db -e USER=odoo -e PASSWORD=odoo --link db:db -t odoo<\/code><\/pre>\n\n\n\n<p>Let&#8217;s break down this command:<\/p>\n\n\n\n<ul>\n<li><code>docker run<\/code>: Runs a new container from an image<\/li>\n\n\n\n<li><code>-p 8069:8069<\/code>: Maps the host&#8217;s port 8069 to the container&#8217;s port 8069 (Odoo&#8217;s default port)<\/li>\n\n\n\n<li><code>--name odoo<\/code>: Assigns the name&nbsp;<code>odoo<\/code>&nbsp;to the container<\/li>\n\n\n\n<li><code>--network=odoo-network<\/code>: Connects the container to the&nbsp;<code>odoo-network<\/code><\/li>\n\n\n\n<li><code>-e HOST=db<\/code>: Sets the PostgreSQL host to&nbsp;<code>db<\/code>&nbsp;(the name of our PostgreSQL container)<\/li>\n\n\n\n<li><code>-e USER=odoo<\/code>: Sets the PostgreSQL user to&nbsp;<code>odoo<\/code><\/li>\n\n\n\n<li><code>-e PASSWORD=odoo<\/code>: Sets the PostgreSQL password to&nbsp;<code>odoo<\/code><\/li>\n\n\n\n<li><code>--link db:db<\/code>: Links the&nbsp;<code>db<\/code>&nbsp;container to the&nbsp;<code>odoo<\/code>&nbsp;container with an alias&nbsp;<code>db<\/code><\/li>\n\n\n\n<li><code>-t odoo<\/code>: Specifies the Odoo Docker image to use<\/li>\n<\/ul>\n\n\n\n<p>This command creates a new Odoo container named&nbsp;<code>odoo<\/code>&nbsp;connected to the&nbsp;<code>odoo-network<\/code>&nbsp;and linked to the PostgreSQL container&nbsp;<code>db<\/code>. It also maps the host&#8217;s port 8069 to the container&#8217;s port 8069, allowing you to access the Odoo instance from your web browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"7-accessing-the-odoo-instance\">7. Accessing the Odoo Instance<\/h2>\n\n\n\n<p>Once the Odoo container is up and running, you can access the Odoo instance by opening a web browser and navigating to&nbsp;<code>http:\/\/your_server_ip:8069<\/code>. Replace&nbsp;<code>your_server_ip<\/code>&nbsp;with the IP address of your Linux server.<\/p>\n\n\n\n<p>If everything is set up correctly, you should see the Odoo welcome screen. From here, you can create a new database or use the existing&nbsp;<code>odoo<\/code>&nbsp;database we created earlier.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"8-configuring-odoo\">8. Configuring Odoo<\/h2>\n\n\n\n<p>While the default configuration is suitable for most use cases, you may want to customize certain aspects of your Odoo installation. Odoo provides a configuration file called&nbsp;<code>odoo.conf<\/code>&nbsp;that allows you to modify various settings.<\/p>\n\n\n\n<p>To access the&nbsp;<code>odoo.conf<\/code>&nbsp;file, you&#8217;ll need to create a new volume and mount it to the Odoo container. Here&#8217;s how you can do it:<\/p>\n\n\n\n<ol>\n<li>Create a new directory to store your Odoo configuration files:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo mkdir -p \/opt\/odoo\/config<\/code><\/pre>\n\n\n\n<ol start=\"2\">\n<li>Create a new&nbsp;<code>odoo.conf<\/code>&nbsp;file in the&nbsp;<code>\/opt\/odoo\/config<\/code>&nbsp;directory:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo nano \/opt\/odoo\/config\/odoo.conf<\/code><\/pre>\n\n\n\n<ol start=\"3\">\n<li>Add your desired configuration options to the&nbsp;<code>odoo.conf<\/code>&nbsp;file. For example, to change the default language and timezone:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">[options]\n; This is the password that allows database operations:\nadmin_passwd = my_admin_password\ndb_host = db\ndb_port = 5432\ndb_user = odoo\ndb_password = odoo\naddons_path = \/mnt\/extra-addons\n; Language\ndefault_lang = fr_FR\n; Timezone\ntimezone = Europe\/Paris<\/code><\/pre>\n\n\n\n<ol start=\"4\">\n<li>Save and close the&nbsp;<code>odoo.conf<\/code>&nbsp;file.<\/li>\n\n\n\n<li>Stop the existing Odoo container:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker stop odoo<\/code><\/pre>\n\n\n\n<ol start=\"6\">\n<li>Remove the existing Odoo container:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker rm odoo<\/code><\/pre>\n\n\n\n<ol start=\"7\">\n<li>Run a new Odoo container with the configuration volume mounted:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker run -p 8069:8069 --name odoo --network=odoo-network -e HOST=db -e USER=odoo -e PASSWORD=odoo --link db:db -v \/opt\/odoo\/config:\/etc\/odoo -t odoo<\/code><\/pre>\n\n\n\n<p>In this command, we&#8217;ve added the&nbsp;<code>-v \/opt\/odoo\/config:\/etc\/odoo<\/code>&nbsp;option to mount the&nbsp;<code>\/opt\/odoo\/config<\/code>&nbsp;directory from the host to the&nbsp;<code>\/etc\/odoo<\/code>&nbsp;directory inside the container. This will allow Odoo to read the&nbsp;<code>odoo.conf<\/code>&nbsp;file from the mounted volume.<\/p>\n\n\n\n<p>After running this command, your Odoo instance should now be configured with the settings specified in the&nbsp;<code>odoo.conf<\/code>&nbsp;file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"9-updating-odoo\">9. Updating Odoo<\/h2>\n\n\n\n<p>When a new version of Odoo is released, you&#8217;ll need to update your Docker image and containers to take advantage of the latest features and security updates. Here&#8217;s how you can update your Odoo installation:<\/p>\n\n\n\n<ol>\n<li>Pull the latest Odoo Docker image:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker pull odoo:latest<\/code><\/pre>\n\n\n\n<ol start=\"2\">\n<li>Stop the existing Odoo container:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker stop odoo<\/code><\/pre>\n\n\n\n<ol start=\"3\">\n<li>Remove the existing Odoo container:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker rm odoo<\/code><\/pre>\n\n\n\n<ol start=\"4\">\n<li>Run a new Odoo container with the updated image:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker run -p 8069:8069 --name odoo --network=odoo-network -e HOST=db -e USER=odoo -e PASSWORD=odoo --link db:db -v \/opt\/odoo\/config:\/etc\/odoo -t odoo:latest<\/code><\/pre>\n\n\n\n<p>This command is similar to the one we used to create the initial Odoo container, but with the&nbsp;<code>latest<\/code>&nbsp;tag at the end to specify that we want to use the latest version of the Odoo Docker image.<\/p>\n\n\n\n<p>After running this command, your Odoo instance should be updated to the latest version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"10-using-docker-compose-for-odoo-installation\">10. Using Docker Compose for Odoo Installation<\/h2>\n\n\n\n<p>While you can run the Docker commands manually to set up Odoo and its dependencies, using Docker Compose can simplify the process by defining and managing multi-container Docker applications. Docker Compose allows you to specify the configuration for all the required containers in a single YAML file, making it easier to deploy and manage your Odoo setup.<\/p>\n\n\n\n<p>Here&#8217;s how you can use Docker Compose to install Odoo:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Docker Compose<\/h3>\n\n\n\n<ol>\n<li>Install Docker Compose if you haven&#8217;t already:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get install docker-compose<\/code><\/pre>\n\n\n\n<ol start=\"2\">\n<li>Create a new directory for your Odoo project and navigate to it:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ mkdir odoo-project\n$ cd odoo-project<\/code><\/pre>\n\n\n\n<ol start=\"3\">\n<li>Create a new file named&nbsp;<code>docker-compose.yml<\/code>&nbsp;in the&nbsp;<code>odoo-project<\/code>&nbsp;directory:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ nano docker-compose.yml<\/code><\/pre>\n\n\n\n<ol start=\"4\">\n<li>Add the following content to the&nbsp;<code>docker-compose.yml<\/code>&nbsp;file:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">version: '3'\nservices:\n  web:\n    image: odoo:latest\n    depends_on:\n      - db\n    ports:\n      - \"8069:8069\"\n    volumes:\n      - .\/config:\/etc\/odoo\n    environment:\n      - HOST=db\n      - USER=odoo\n      - PASSWORD=odoo\n  db:\n    image: postgres:13\n    environment:\n      - POSTGRES_USER=odoo\n      - POSTGRES_PASSWORD=odoo\n      - POSTGRES_DB=odoo\n    volumes:\n      - odoo-db-data:\/var\/lib\/postgresql\/data\n\nvolumes:\n  odoo-db-data:<\/code><\/pre>\n\n\n\n<p>This&nbsp;<code>docker-compose.yml<\/code>&nbsp;file defines two services:&nbsp;<code>web<\/code>&nbsp;and&nbsp;<code>db<\/code>. The&nbsp;<code>web<\/code>&nbsp;service is the Odoo application, and the&nbsp;<code>db<\/code>&nbsp;service is the PostgreSQL database.<\/p>\n\n\n\n<p>The&nbsp;<code>web<\/code>&nbsp;service specifies the following:<\/p>\n\n\n\n<ul>\n<li><code>image<\/code>: Uses the latest Odoo Docker image<\/li>\n\n\n\n<li><code>depends_on<\/code>: Specifies that the&nbsp;<code>web<\/code>&nbsp;service depends on the&nbsp;<code>db<\/code>&nbsp;service<\/li>\n\n\n\n<li><code>ports<\/code>: Maps the host&#8217;s port 8069 to the container&#8217;s port 8069<\/li>\n\n\n\n<li><code>volumes<\/code>: Mounts the&nbsp;<code>.\/config<\/code>&nbsp;directory from the host to the&nbsp;<code>\/etc\/odoo<\/code>&nbsp;directory inside the container<\/li>\n\n\n\n<li><code>environment<\/code>: Sets environment variables for the Odoo container, including the database host, user, and password<\/li>\n<\/ul>\n\n\n\n<p>The&nbsp;<code>db<\/code>&nbsp;service specifies the following:<\/p>\n\n\n\n<ul>\n<li><code>image<\/code>: Uses the PostgreSQL 13 Docker image<\/li>\n\n\n\n<li><code>environment<\/code>: Sets environment variables for the PostgreSQL container, including the database user, password, and name<\/li>\n\n\n\n<li><code>volumes<\/code>: Mounts a named volume&nbsp;<code>odoo-db-data<\/code>&nbsp;to persist the PostgreSQL data<\/li>\n<\/ul>\n\n\n\n<ol start=\"5\">\n<li>Save and close the&nbsp;<code>docker-compose.yml<\/code>&nbsp;file.<\/li>\n\n\n\n<li>Create the&nbsp;<code>config<\/code>&nbsp;directory to store your Odoo configuration files:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ mkdir config<\/code><\/pre>\n\n\n\n<ol start=\"7\">\n<li>Create a new&nbsp;<code>odoo.conf<\/code>&nbsp;file in the&nbsp;<code>config<\/code>&nbsp;directory and add your desired configuration options (refer to the &#8220;Configuring Odoo&#8221; section in the main article for more details).<\/li>\n\n\n\n<li>Start the Odoo and PostgreSQL containers using Docker Compose:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker-compose up -d<\/code><\/pre>\n\n\n\n<p>This command will create and start the containers defined in the&nbsp;<code>docker-compose.yml<\/code>&nbsp;file. The&nbsp;<code>-d<\/code>&nbsp;flag runs the containers in detached mode (in the background).<\/p>\n\n\n\n<ol start=\"9\">\n<li>Access the Odoo instance by opening a web browser and navigating to&nbsp;<code>http:\/\/your_server_ip:8069<\/code>.<\/li>\n<\/ol>\n\n\n\n<p>Using Docker Compose simplifies the process of setting up and managing multiple containers for your Odoo installation. The&nbsp;<code>docker-compose.yml<\/code>&nbsp;file serves as a single source of truth for your application&#8217;s configuration, making it easier to maintain and deploy your Odoo setup across different environments.<\/p>\n\n\n\n<p>If you need to stop or remove the containers, you can use the following Docker Compose commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"><em># Stop the containers<\/em>\n$ docker-compose stop\n\n<em># Remove the containers<\/em>\n$ docker-compose down<\/code><\/pre>\n\n\n\n<p>Docker Compose provides a more structured and scalable approach to deploying and managing Odoo and its dependencies using Docker containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"troubleshooting\">Troubleshooting<\/h2>\n\n\n\n<p>If you encounter any issues during the installation or configuration process, here are some common troubleshooting tips:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"checking-container-logs\">Checking Container Logs<\/h3>\n\n\n\n<p>If your Odoo instance isn&#8217;t working as expected, you can check the container logs for more information. To view the logs for the Odoo container, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker logs odoo<\/code><\/pre>\n\n\n\n<p>This command will display the logs for the&nbsp;<code>odoo<\/code>&nbsp;container, which can help you identify and diagnose any issues.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"checking-container-status\">Checking Container Status<\/h3>\n\n\n\n<p>You can check the status of your Docker containers by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker ps -a<\/code><\/pre>\n\n\n\n<p>This command will list all the containers on your system, along with their status (running, exited, etc.). If a container is not running, you can try starting it with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker start container_name<\/code><\/pre>\n\n\n\n<p>Replace&nbsp;<code>container_name<\/code>&nbsp;with the name of the container you want to start (e.g.,&nbsp;<code>odoo<\/code>&nbsp;or&nbsp;<code>db<\/code>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"rebuilding-containers\">Rebuilding Containers<\/h3>\n\n\n\n<p>If you&#8217;ve made changes to your Odoo configuration or encountered issues with your existing containers, you may need to rebuild them. Follow these steps to rebuild your Odoo and PostgreSQL containers:<\/p>\n\n\n\n<ol>\n<li>Stop the existing containers:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker stop odoo db<\/code><\/pre>\n\n\n\n<ol start=\"2\">\n<li>Remove the existing containers:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker rm odoo db<\/code><\/pre>\n\n\n\n<ol start=\"3\">\n<li>Remove the existing Docker network:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker network rm odoo-network<\/code><\/pre>\n\n\n\n<ol start=\"4\">\n<li>Create a new Docker network:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker network create odoo-network\n<\/code><\/pre>\n\n\n\n<ol start=\"5\">\n<li>Create a new PostgreSQL container:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=odoo --network=odoo-network --name db postgres:13<\/code><\/pre>\n\n\n\n<ol start=\"6\">\n<li>Create a new Odoo container:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo docker run -p 8069:8069 --name odoo --network=odoo-network -e HOST=db -e USER=odoo -e PASSWORD=odoo --link db:db -v \/opt\/odoo\/config:\/etc\/odoo -t odoo:latest<\/code><\/pre>\n\n\n\n<p>This process will create new containers with the latest configuration and any changes you&#8217;ve made.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>After following this guide, you should now be able to successfully install and configure Odoo using Docker on your Linux system. Docker provides a convenient way to manage and deploy Odoo, ensuring consistent environments across different systems and simplifying the installation process.<\/p>\n\n\n\n<p>Remember to consult the official Odoo documentation and community forums if you encounter any issues or have specific questions about configuring or customizing your Odoo installation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Odoo is a powerful open-source suite of business applications that covers a wide range of functionalities, including Customer Relationship Management (CRM), Website Builder, eCommerce, Project Management, Accounting, and more. And While you can install Odoo directly on your Linux system, using Docker to set up Odoo provides several advantages, such as easier deployment, better resource ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[188,182],"tags":[],"yoast_head":"\n<title>Installing Odoo using Docker on Linux - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"Learn how to install and configure the powerful open-source business suite Odoo using Docker containers on your Linux system. This comprehensive guide covers prerequisites, Docker installation, pulling the Odoo image, creating a Docker network and containers, accessing the Odoo instance, configuring Odoo, updating, and troubleshooting.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing Odoo using Docker on Linux - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"Learn how to install and configure the powerful open-source business suite Odoo using Docker containers on your Linux system. This comprehensive guide covers prerequisites, Docker installation, pulling the Odoo image, creating a Docker network and containers, accessing the Odoo instance, configuring Odoo, updating, and troubleshooting.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-22T17:13:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-22T17:13:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"Installing Odoo using Docker on Linux\",\"datePublished\":\"2024-05-22T17:13:09+00:00\",\"dateModified\":\"2024-05-22T17:13:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\"},\"wordCount\":1731,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"CMS &amp; Web development\",\"Virtualization &amp; Cloud computing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\",\"name\":\"Installing Odoo using Docker on Linux - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2024-05-22T17:13:09+00:00\",\"dateModified\":\"2024-05-22T17:13:11+00:00\",\"description\":\"Learn how to install and configure the powerful open-source business suite Odoo using Docker containers on your Linux system. This comprehensive guide covers prerequisites, Docker installation, pulling the Odoo image, creating a Docker network and containers, accessing the Odoo instance, configuring Odoo, updating, and troubleshooting.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing Odoo using Docker on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"Installing Odoo using Docker on Linux - WebHi Tutorials &amp; Documentations","description":"Learn how to install and configure the powerful open-source business suite Odoo using Docker containers on your Linux system. This comprehensive guide covers prerequisites, Docker installation, pulling the Odoo image, creating a Docker network and containers, accessing the Odoo instance, configuring Odoo, updating, and troubleshooting.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/","og_locale":"en_US","og_type":"article","og_title":"Installing Odoo using Docker on Linux - WebHi Tutorials &amp; Documentations","og_description":"Learn how to install and configure the powerful open-source business suite Odoo using Docker containers on your Linux system. This comprehensive guide covers prerequisites, Docker installation, pulling the Odoo image, creating a Docker network and containers, accessing the Odoo instance, configuring Odoo, updating, and troubleshooting.","og_url":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2024-05-22T17:13:09+00:00","article_modified_time":"2024-05-22T17:13:11+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/05\/docker_odoo_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"Installing Odoo using Docker on Linux","datePublished":"2024-05-22T17:13:09+00:00","dateModified":"2024-05-22T17:13:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/"},"wordCount":1731,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["CMS &amp; Web development","Virtualization &amp; Cloud computing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/","url":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/","name":"Installing Odoo using Docker on Linux - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2024-05-22T17:13:09+00:00","dateModified":"2024-05-22T17:13:11+00:00","description":"Learn how to install and configure the powerful open-source business suite Odoo using Docker containers on your Linux system. This comprehensive guide covers prerequisites, Docker installation, pulling the Odoo image, creating a Docker network and containers, accessing the Odoo instance, configuring Odoo, updating, and troubleshooting.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/setup-odoo-docker-compose-linux-ubuntu-debian\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"Installing Odoo using Docker on Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/8674"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=8674"}],"version-history":[{"count":9,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/8674\/revisions"}],"predecessor-version":[{"id":8706,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/8674\/revisions\/8706"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=8674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=8674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=8674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}