Docker allows you to use containers to to create, deploy, run and maintain the applications available as it's an application-level deployment tool. In addition, the task and operation of developers can be simplified into single instances as it will be able to integrate the following software developing packages/ tools/ environments/ libraries and many more.
This blog will provide an insight on how to Install Odoo Using Docker and how it's used to run Odoo.
As an additional note it's been derived that it's simple to use Docker to run Odoo.
Install Docker on Ubuntu 16.04 LTS Xenial. The aspect to be noted is that the docker engine is only suitable for the 64bit operating system therefore, make sure that you system is of 64-bit.
Moreover, it's to be ensured that the systems CPU supports virtualization technology and virtualization support is enabled in BIOS.
1. The initial step of installation will be to update the Ubuntu using the following code:
sudo apt update
2. Now add a key for our docker as depicted in the following code:
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
3. As the key is added to the machine, add the repository source to the apt source list using the following code:
sudo nano /etc/apt/sources.list.d/docker.list
the following line this
deb https://apt.dockerproject.org/repo ubuntu-xenial main
Now save and exit.
4. The next step is to update the apt index, which can be done by using the following code:
sudo apt update
5. Now install Linux kernel, with the help of the following command:
sudo apt-get install linux-image-extra-$(uname -r)
6. The next step is to install Docker engine, which can be done with the following command:
sudo apt-get install docker-engine
7. Further to install the latest Docker Engine you should initially install Official Docker Script, which can be done by the following command:
wget -qO- https://get.docker.com/ | sh
Moreover, if there is no wget then install wget by running the following code:
sudo apt-get install wget
8. The next step is to add a User to Docker Group
For illustration here, the user is named as cybrosys, you can use the following command to add the user:
usermod -aG docker <user>
eg: usermod -aG docker cybrosys
9. As the docker is installed and the user to the docker is set the next step is to start the docker. For that you can use the following code:
sudo systemctl start docker
10. Now run the docker using the command down below:
sudo docker run hello-world
11. You can stop the docker if its running perfectly using the following command:
sudo docker stop <processid>
Furthermore, to obtain the process id run the following command:
docker ps -a
As we have successfully installed docker on the Ubuntu system and now let's move on to setup Odoo using the docker.
Additionally for the operation we need two containers, one for database and one for Odoo.
12. Initially run the following command to pull postgres and creates user:
sudo
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10
13. Now run the following command to pull Odoo:
sudo docker run -p 0.0.0.0:8069:8069 --name odoo --link db:db -t odoo
There would be a resultant instance to it and you can view the service is running on port 8069.
Moreover, it can be viewed that the Odoo server is running on 0.0.0.0:8069.
14. Finally to stop/start Odoo service use the following code:
sudo docker start/stop odoo
Following the above mentioned steps thoroughly will help you to install and run Odoo using a docker.
Have a look at the following blog to explore more about Odoo 16 Installation Ubuntu 22.04