Skip to content

grazrib/docker-compose-odoo18

Repository files navigation

Quick install

Installing Odoo 18 with one command.

(Supports multiple Odoo instances on one server)

Install docker and docker-compose yourself, then run:

curl -s https://raw.githubusercontent.com/grazrib/docker-compose-odoo18/master/run.sh | sudo bash -s odoo18-one 10018 20018

to set up first Odoo instance @ localhost:10015 (default master password: do_be_modified)

and

curl -s https://raw.githubusercontent.com/grazrib/docker-compose-odoo18/master/run.sh | sudo bash -s odoo18-two 11018 21018

to set up another Odoo instance @ localhost:11015 (default master password: to_be_modified)

Some arguments:

  • First argument (odoo-one): Odoo deploy folder
  • Second argument (10018): Odoo port
  • Third argument (20018): live chat port

If curl is not found, install it:

$ sudo apt-get install curl
# or
$ sudo yum install curl

Usage

Start the container:

docker-compose up
  • Then open localhost:10018 to access Odoo 18.0. If you want to start the server with a different port, change 10018 to another value in docker-compose.yml:
ports:
 - "10018:8069"

Run Odoo container in detached mode (be able to close terminal without stopping Odoo):

docker-compose up -d

If you get the permission issue, change the folder permission to make sure that the container is able to access the directory:

$ git clone https://github.com/grazrib/docker-compose-odoo18.git
$ sudo chmod -R 777 addons
$ sudo chmod -R 777 etc
$ mkdir -p postgresql
$ sudo chmod -R 777 postgresql
$ sudo chown -R 5051:5051 pgadmin-data

Increase maximum number of files watching from 8192 (default) to 524288. In order to avoid error when we run multiple Odoo instances. This is an optional step. These commands are for Ubuntu user:

$ if grep -qF "fs.inotify.max_user_watches" /etc/sysctl.conf; then echo $(grep -F "fs.inotify.max_user_watches" /etc/sysctl.conf); else echo "fs.inotify.max_user_watches = 524288" | sudo tee -a /etc/sysctl.conf; fi
$ sudo sysctl -p    # apply new config immediately

Custom addons

The addons/ folder contains custom addons. Just put your custom addons if you have any.

Odoo configuration & log

  • To change Odoo configuration, edit file: etc/odoo.conf.
  • Log file: etc/odoo-server.log
  • Default database password (admin_passwd) is to_be_modified, please change it @ etc/odoo.conf#L60

Odoo container management

Run Odoo:

docker-compose up -d

Restart Odoo:

docker-compose restart

Rebuild Odoo:

docker-compose build

Stop Odoo:

docker-compose down

Stop Odoo:

docker-compose down

For import db:

chmod +x regenerate_static.sh optimize_database.sh
./regenerate_static.sh
./optimize_database.sh

Live chat

In docker-compose.yml#L21, we exposed port 20015 for live-chat on host.

Configuring nginx to activate live chat feature (in production):

#...
server {
    #...
    location /longpolling/ {
        proxy_pass http://0.0.0.0:20018/longpolling/;
    }
    #...
}
#...

docker-compose.yml

  • odoo:18.0
  • postgres:18

Odoo 18 screenshots

<

About

Fast set-up Odoo 18 for dev/production with Docker Compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •