Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Odoo Docker Setup - How To?

Odoberať

Get notified when there's activity on this post

This question has been flagged
ubuntuodoodocker
2 Replies
15564 Zobrazenia
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
Zrušiť
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
Zrušiť
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
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
How to clear cache after change data_dir path
odoo docker
Avatar
Avatar
1
jún 25
11981
Unable to update app list in dockerized odoo
odoo docker
Avatar
Avatar
1
nov 22
4892
How to install addon modules using Odoo doodba
odoo docker
Avatar
Avatar
1
nov 20
7036
ERROR: couldn't create the logfile directory. Logging to the standard output.
odoo docker
Avatar
Avatar
6
jún 20
23852
Problem with my odoo installation on ubuntu server
ubuntu odoo
Avatar
Avatar
1
júl 19
20636
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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