Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Odoo Docker Setup - How To?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
ubuntuodoodocker
2 Respostes
16958 Vistes
Avatar
Roshan

I am using Ubuntu 22.04, current OS user is 'odoo'.

I want to install Odoo using Docker for development. I will create all Docker Containers for different versions of Odoo (like 15,16,17...) after successfully created one, I want to keep versions separate in their Containers.

I searched Internet for same but yet failed to find about is there any need to install Python3 and Pycharm within Docker Container or Not?

if Not then how I can install and done development tasks using Python3, PostgreSQL and Pycharm? how to configure Pycharm for all installed versions and anything else too?

it's humble request to the community members to please help.

with regards


0
Avatar
Descartar
Roshan
Autor

any hope to get help ???

Roshan
Autor

thank you very much @Gracious Joseph for reply and detailed guidance, very few people can do it. i will check it and reply here.

with kind regards


Avatar
Roshan
Autor Best Answer

hi @Gracious Joseph

i tried to follow as per your instructions as below, just made one change in your ~/odoo_docker/odoo16/docker-compose.yml file, I used image: postgres:16 instead of postgres:13:


odoo@odoo-VirtualBox:~$ pwd

/home/odoo

sudo apt install -y docker(dot)io docker-compose

sudo systemctl start docker

sudo systemctl enable docker

odoo@odoo-VirtualBox:~$ mkdir odoo-docker

odoo@odoo-VirtualBox:~$ cd odoo-docker

odoo@odoo-VirtualBox:~$ mkdir odoo15

odoo@odoo-VirtualBox:~$ mkdir odoo16

odoo@odoo-VirtualBox:~$ mkdir odoo17

odoo@odoo-VirtualBox:~$ cd ~/odoo-docker/odoo16

doo@odoo-VirtualBox:~/odoo-docker/odoo16$ sudo docker-compose up -d

[sudo] password for odoo:

Creating network "odoo16_default" with the default driver

Pulling odoo (odoo:16)...

16: Pulling from library/odoo

Digest: sha256:2ec9878811bc973198e1683c03e758344c4232ee88fcd8409ed444b9179a13ca

Status: Downloaded newer image for odoo:16

Creating odoo16-db ... done

Creating odoo16    ... done


odoo@odoo-VirtualBox:~/odoo-docker/odoo16$ ls -la

total 24

drwxrwxr-x  5 odoo             odoo 4096 Dec  9 10:59 .

drwxrwxr-x  5 odoo             odoo 4096 Dec  9 10:43 ..

-rw-rw-r--  1 odoo             odoo  565 Dec  9 10:53 docker-compose.yml

drwxr-xr-x  2 root             root 4096 Dec  9 10:57 odoo_addons

drwxr-xr-x  2 root             root 4096 Dec  9 10:57 odoo_data

drwx------ 19 systemd-coredump root 4096 Dec  9 10:57 postgres_data

odoo@odoo-VirtualBox:~/odoo-docker/odoo16$ sudo chown -R odoo:odoo odoo_addons

odoo@odoo-VirtualBox:~/odoo-docker/odoo16$ sudo chown -R odoo:odoo odoo_data

odoo@odoo-VirtualBox:~/odoo-docker/odoo16$ ls postgres_data/

ls: cannot open directory 'postgres_data/': Permission denied

odoo@odoo-VirtualBox:~/odoo-docker/odoo16$ sudo chown -R odoo:odoo cd

[sudo] password for odoo:

odoo@odoo-VirtualBox:~/odoo-docker/odoo16$

odoo@odoo-VirtualBox:~/odoo-docker/odoo16$  docker-compose up -d

ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.


when running with: 

doo@odoo-VirtualBox:~/odoo-docker/odoo16$ sudo docker-compose up -d

odoo16-db is up-to-date

odoo16 is up-to-date

and trying to access in web browser http://localhost:8069 it is not showing odoo initial page instead below errors.

Unable to connect

Firefox can’t establish a connection to the server at localhost:8015.


here i stuck for the above and also for last folder postgres_data, can't change owner:group and permission, how i can test things will work fine or not.

please advise

with kind regards

0
Avatar
Descartar
Avatar
Gracious Joseph
Best Answer

Setting up Odoo with Docker for development on Ubuntu 22.04 is a practical approach, especially when working with multiple Odoo versions like 15, 16, and 17. Here’s a comprehensive guide tailored to your requirements:

1. Prerequisites

Before starting, ensure you have the following installed on your Ubuntu system:

  • Docker and Docker Compose:
    bashCopy codesudo apt update
    sudo apt install -y docker.io docker-compose
    sudo systemctl start docker
    sudo systemctl enable docker
    
  • Python 3.x (for development outside Docker if needed):
    bashCopy codesudo apt install python3 python3-pip
    

2. Set Up Directory Structure

Organize your project for multiple Odoo versions. For example:

javascriptCopy code~/odoo_docker/
├── odoo15/
├── odoo16/
└── odoo17/

Each version will have its Docker Compose file, configuration, and optional custom modules directory.

3. Create Docker Compose File

Create a docker-compose.yml file for each version in its respective folder.

Example for Odoo 16 (~/odoo_docker/odoo16/docker-compose.yml):

yamlCopy codeversion: '3.1'

services:
  db:
    image: postgres:13
    container_name: odoo16-db
    environment:
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_DB=postgres
    volumes:
      - ./postgres_data:/var/lib/postgresql/data
    restart: always

  odoo:
    image: odoo:16
    container_name: odoo16
    depends_on:
      - db
    ports:
      - "8069:8069"
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD=odoo
    volumes:
      - ./odoo_addons:/mnt/extra-addons
      - ./odoo_data:/var/lib/odoo
    restart: always

4. Start Docker Containers

Navigate to the folder for the desired version and start the containers:

bashCopy codecd ~/odoo_docker/odoo16
docker-compose up -d
  • The database will persist in the postgres_data volume.
  • Additional custom modules can be added to the odoo_addons directory.

Repeat for other versions (15, 17) by creating separate configurations.

5. Configure Pycharm for Development

To use PyCharm for Odoo development:

  1. Install PyCharm: Download and install PyCharm Professional or Community edition from JetBrains.
  2. Configure PyCharm with Docker Interpreter:
    • Open PyCharm and go to Settings > Project > Python Interpreter.
    • Add a new interpreter and choose Docker.
    • Select the Odoo Docker container (e.g., odoo16) as the interpreter.
    • This allows PyCharm to use the Python environment inside the Docker container for development.
  3. Set Up Project Folder:
    • Add the Odoo source code (if available) and the odoo_addons directory to your project in PyCharm.
    • Configure Odoo's addons path in the container to include mnt/extra-addons.

6. Development Workflow

  • Modify or create custom modules in odoo_addons.
  • Restart the Odoo container to apply changes:
    bashCopy codedocker-compose restart odoo
    
  • Access Odoo at http://localhost:8069 for testing.

7. Managing Multiple Versions

Each version runs independently in its Docker container with its database. To avoid port conflicts:

  • Change the exposed port for each version in the docker-compose.yml:
    yamlCopy codeports:
      - "8070:8069"  # For Odoo 15
      - "8071:8069"  # For Odoo 17
    

8. Best Practices

  • Use Docker volumes to persist data and avoid losing work.
  • Use the same PostgreSQL user/password for consistency across containers.
  • If you need to test Python dependencies, install them directly in the container or on the host system.

9. Advanced Setup

  • Enable Debugging in PyCharm:
    • Set breakpoints in your custom module.
    • Configure the Docker container to run in debug mode.
  • Use VSCode as an Alternative:
    • Install the Remote - Containers extension for developing inside Docker.

Example Commands

  • Stop a specific container:
    bashCopy codedocker-compose down
    
  • View container logs:
    bashCopy codedocker logs odoo16
    
  • Remove all containers and volumes:
    bashCopy codedocker-compose down -v
    

Summary

With this setup:

  • Each Odoo version is isolated in its Docker container.
  • Development can be done using PyCharm or other tools with Docker integration.
  • PostgreSQL and custom modules are managed separately for each version.

Feel free to ask if you need further clarification or assistance with specific configurations!

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
How to clear cache after change data_dir path
odoo docker
Avatar
Avatar
1
de juny 25
12108
Unable to update app list in dockerized odoo
odoo docker
Avatar
Avatar
1
de nov. 22
4987
How to install addon modules using Odoo doodba
odoo docker
Avatar
Avatar
1
de nov. 20
7140
ERROR: couldn't create the logfile directory. Logging to the standard output.
odoo docker
Avatar
Avatar
6
de juny 20
23967
Problem with my odoo installation on ubuntu server
ubuntu odoo
Avatar
Avatar
1
de jul. 19
20776
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now