DEV Community

Alfadil mustafa
Alfadil mustafa

Posted on • Edited on

Run Odoo in docker for local development

anyone who is new to Odoo or even experienced developers may have a problem in install odoo in there local devices,So I'm going to show few tips to run odoo using docker.

đź”” first this technique assume that you are running a linux distribution like (ubuntu, debian, redhat, ...).

now let's do it.

  • we are going to install Docker CE using https://get.docker.com/ if you already have it installed skip this step to check if you have docker install run
docker info
Enter fullscreen mode Exit fullscreen mode

it's going to show details of the current version of docker installed if not run :

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
Enter fullscreen mode Exit fullscreen mode

after that add the your user to the docker group

sudo usermod -aG docker $USER
Enter fullscreen mode Exit fullscreen mode
where $USER is the name of the user
  • we are going to create a new postgres database server container(don't worry if you don't understand the meaning of the container you can check at docker )
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name postgres_db postgres:10
Enter fullscreen mode Exit fullscreen mode
  • Now we can start an odoo server
docker run -p 8070:8069 --name odoo --link postgres_db:db -t odoo
Enter fullscreen mode Exit fullscreen mode
this is going to start latest odoo version which is 13 (in the day the post written)

now in your browser go to http://localhost:8070 and 🎉

and to stop it run

docker stop odoo
Enter fullscreen mode Exit fullscreen mode

to start it run

docker start odoo
Enter fullscreen mode Exit fullscreen mode

to run other versions of odoo just change the tag to odoo:11.0, or odoo:12.0
like

docker run -p 8071:8069 --name odoo --link postgres_db:db -t odoo:11.0
Enter fullscreen mode Exit fullscreen mode

🤔 now what about custom addons ❓

đź’ˇ we have volumes to add modules to the server.

docker run -v /path/to/addons:/mnt/extra-addons -p 8069:8069 --name odoo
--link postgres_db:db -t odoo
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
afromonkey profile image
Moisés Alejandro Navarro Presas

What version of Postgres do you recommend for Odoo 13.0 docker image?
I normally use 11.5 but i'm not that is the best option.

Collapse
 
alfadil profile image
Alfadil mustafa • Edited

any version from 10 and upper would be good.