Installing Odoo 16 with one command.
(Supports multiple Odoo instances on one server)
Install docker and docker-compose yourself, then run:
sudo apt update && apt upgrade
sudo apt install docker docker-compose -yUpgrade docker-compose
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
docker compose versionThen
curl -s https://raw.githubusercontent.com/thaichikma/docker-odoo/16.0/run.sh | sudo bash -s odoo-one 10012 20012to set up first Odoo instance @ localhost:10012 (default master password: Masterpass)
and
curl -s https://raw.githubusercontent.com/thaichikma/docker-odoo/16.0/run.sh | sudo bash -s odoo-two 11012 21012to set up another Odoo instance @ localhost:11012 (default master password: Masterpass)
Some arguments:
- First argument (odoo-one): Odoo deploy folder
- Second argument (10012): Odoo port
- Third argument (20012): live chat port
If curl is not found, install it:
$ sudo apt-get install curl
# or
$ sudo yum install curlStart the container:
docker-compose up- Then open
localhost:10012to access Odoo 12.0. If you want to start the server with a different port, change 10012 to another value in docker-compose.yml:
ports:
- "10012: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/thaichikma/docker-odoo/$version
$ sudo chmod -R 777 addons
$ sudo chmod -R 777 etc
$ mkdir -p postgresql
$ sudo chmod -R 777 postgresqlIncrease 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
The addons/ folder contains custom addons. Just put your custom addons if you have any.
- To change Odoo configuration, edit file: etc/odoo.conf.
- Log file: etc/odoo-server.log
- Default database password (admin_passwd) is
Masterpass, please change it @ etc/odoo.conf#L55
Run Odoo:
docker-compose up -dRestart Odoo:
docker-compose restartStop Odoo:
docker-compose downUpgrade pip and install lib paramiko:
pip install --upgrade pip
#install setuptools.
pip install setuptools==39.1.0
#install pyparser.
pip install pyparser==1.0
pip install pyparsing==2.1.0
#install cffi.
pip install cffi==1.11.5
#install cryptography.
pip install cryptography==2.2.2
pip install paramiko
Docker commit:
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]Docker push:
docker push [OPTIONS] NAME[:TAG]
docker docker push thaichikma/imageDocker save:
docker save [OPTIONS] IMAGE [IMAGE...]
docker save image > image.zipDocker Load:
docker load [OPTIONS]
docker load < image.zipMore info: https://docs.docker.com/engine/reference/commandline/inspect/
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamiltondocker commit c3f279d17e0a svendowideit/testimage:version3
f5283438590d$ docker images
REPOSITORY TAG ID CREATED SIZE
svendowideit/testimage version3 f5283438590d 16 seconds ago 335.7 MBIn docker-compose.yml#L21, we exposed port 20012 for live-chat on host.
Configuring nginx to activate live chat feature (in production):
#...
server {
#...
location /longpolling/ {
proxy_pass http://0.0.0.0:20012/longpolling/;
}
#...
}
#...
- Install
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest- odoo:16.0
- postgres:15