Please read the following article to build your PostgreSQL database environment properly:
Step 1: Upload Odoo Docker Files
Upload the odoo16_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 odoo16_docker.zip
After extracting, you will see a directory structure like this:
Step 2: Configure odoo16.conf
Edit the file located at ./config/odoo16.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 16 server along with the PostgreSQL database based on your Docker configuration.
Note:
- Restart Server odoo: docker restart <container_odoo>
- Install Python libraries by using docker exec -it
Notes
- Ensure that the
db_user
anddb_password
match with your PostgreSQL service configuration inside the Docker Compose file.
Check git Odoo15 Docker
Like
Reply