Local Development Setup

This guide covers setting up AgriOS locally for development or evaluation using Docker.

Prerequisites

Install the following on your development machine:

  • Git: For cloning the repository

  • Docker: Version 20.10 or higher

  • Docker Compose: V2 (included with Docker Desktop)

Installing Docker

macOS/Windows

Download and install Docker Desktop.

Ubuntu/Debian

sudo apt update
sudo apt install docker.io docker-compose-plugin
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $USER
# Log out and back in for group changes to take effect

Quick Start

1. Clone the Repository

git clone https://github.com/advanceinsight/AgriOS.git
cd AgriOS

2. Configure Environment

cp .env.example .env

Review .env and adjust if needed. Default settings work for local development.

3. Start Services

docker compose up -d

This starts:

  • Odoo with AgriOS modules

  • PostgreSQL database

4. Access AgriOS

Open http://localhost:8069 in your browser.

First time setup:

  1. Click “Manage Databases”

  2. Create a new database

  3. Install AgriOS modules from Apps

Development Workflow

Viewing Logs

# All services
docker compose logs -f

# Odoo only
docker compose logs -f odoo

Restarting After Code Changes

Python changes require a restart:

docker compose restart odoo

XML/View changes require a module upgrade:

docker compose exec odoo odoo -u agrios_farmer -d your_database --stop-after-init
docker compose restart odoo

Accessing the Shell

# Odoo shell
docker compose exec odoo odoo shell -d your_database

# Bash shell
docker compose exec odoo bash

Running Tests

docker compose exec odoo odoo -i agrios_farmer --test-enable -d test_db --stop-after-init

Customizing the Setup

Using Local Module Directory

To develop modules outside the container, mount your local directory:

Edit docker-compose.yml or create docker-compose.override.yml:

services:
  odoo:
    volumes:
      - ./my_modules:/mnt/extra-addons

Update addons_path in your Odoo configuration to include /mnt/extra-addons.

Changing Ports

If port 8069 is in use, modify .env:

ODOO_PORT=8070

Database Access

Connect directly to PostgreSQL:

docker compose exec db psql -U odoo -d your_database

Or use a database client with:

  • Host: localhost

  • Port: 5432 (or as configured)

  • User: odoo

  • Password: (from .env)

Stopping and Cleaning Up

Stop Services

docker compose down

Remove All Data

To start fresh (removes database and filestore):

docker compose down -v

Remove Images

docker compose down --rmi all -v

Troubleshooting

Container won’t start

Check logs:

docker compose logs odoo

Common issues:

  • Port already in use: Change port in .env

  • Database connection: Ensure db service is running

Module not appearing

  1. Update Apps List in Odoo (Apps > Update Apps List)

  2. Check addons_path includes module directory

  3. Verify module has valid __manifest__.py

Changes not reflecting

  1. Restart Odoo: docker compose restart odoo

  2. Clear browser cache

  3. For XML changes, upgrade the module

Database errors

Reset the database:

docker compose down -v
docker compose up -d

Next Steps