Please read the following article to build your PostgreSQL database environment properly:
In this article, we will walk through the process of setting up Odoo 17 in a Docker environment. Docker simplifies the process of deploying Odoo by encapsulating it in a container, ensuring that your Odoo instance is portable, scalable, and consistent across various environments. Whether you're running Odoo for development, production, or testing, Docker allows you to isolate the application, along with its dependencies, in a controlled environment.
Step 1: Upload Odoo Docker Files
Upload the odoo17_docker.zip
file to the /root
directory of your Ubuntu server.
You can use another directory if preferred.
Then navigate to the directory and extract it:
cd /root
unzip odoo17_docker.zip
After extracting, you will see a directory structure like this:
Step 2: Configure odoo17.conf
Edit the file located at ./config/odoo17.conf
and set the database username and password.
Here's an example configuration:
[options]
admin_passwd = your_password_admin
logfile = /var/log/odoo/odoo.log
db_host = postgres_db
db_port = 5432
db_user = odoo
db_password = your_password_db
; Addons path
addons_path = /opt/odoo16/odoo/addons,/opt/odoo16/custom-addons
db_template = template0
server_wide_modules = base,web
Note: if you set workers, you must enable proxy = True and using nginx as reverse proxy
workers = 4
max_cron_threads = 2
proxy = True
Step 3: Set Permissions for Logs and Custom Addons
Navigate to the project directory and set the appropriate permissions:
cd /root/odoo16_docker
chmod -R 777 logs
chmod -R 777 odoo-data/
chmod -R 777 lib
chmod -R 777 bin
# chmod -R 755 custom-addons
Step 4: Build and Run Docker Containers
Finally, start the containers using Docker Compose:
docker compose up -d
This will launch the Odoo 17 server along with the PostgreSQL database based on your Docker configuration.
If You see error
network internal_shared_net declared as external, but could not be found
Please create new or check your external network docker and input into docker-compose.yml and try again
Notes
-
Ensure that the
db_user
anddb_password
match with your PostgreSQL service configuration inside the Docker Compose file. -
Restart Server odoo: docker restart <container_odoo>
-
Install Python libraries by using docker exec -it <container_odoo> /bin/bash to access the container, and then running pip install
inside it.
Check git Odoo15 Docker
Like
Reply