Make sure you have:
-
GNU/Linux (any recent distribution)
-
Docker installed and running. You can check by running:
sudo docker --version
-
Git installed You can check by running:
sudo git --version
Follow these steps to clone the repository and run the script:
- Download the project from GitHub
git clone https://github.com/caprosoft/docker-odoo19 - Enter the project folder
cd docker-odoo19- Make the script executable
sudo chmod +x odoo19.sh- Run the script
sudo ./odoo19.shAfter running, Odoo will be available at http://localhost:8069
The script runs two Docker containers: one for the PostgreSQL database and one for Odoo.
#!/bin/sh
sudo docker run -d -v odoo-db:/var/lib/postgresql/data \
-e POSTGRES_USER=odoo \
-e POSTGRES_PASSWORD=odoo \
-e POSTGRES_DB=postgres \
--name db postgres:15
sudo docker run -d -v odoo-data:/var/lib/odoo \
-p 8069:8069 \
--name odoo \
--link db:db \
-t odooodoo-dbstores the PostgreSQL data, keeping it persistent even if the container is removed.odoo-datastores the Odoo application data, ensuring that your configurations and files are preserved.
If you need to stop or remove the containers and volumes, use:
# Stop containers
sudo docker stop odoo db
# Remove containers
sudo docker rm odoo db
# (Optional) Remove volumes
sudo docker volume rm odoo-data odoo-dbTo recreate and re-run everything after cleanup, simply execute again:
sudo ./odoo19.shThis will rebuild the containers and restart your Odoo environment from scratch.