Requirements & Local Installation ​
AgriReg is a cloud-agnostic application designed to be self-hosted. This section details the hardware requirements and step-by-step instructions to get the application running using Docker on a local machine or dedicated VPS.
If you wish to host the application easily in the cloud, please check the Cloud Deployment on Render.com guide.
Prerequisites ​
Before starting, make sure your server or local computer meets the following requirements:
Minimum Hardware Requirements ​
- CPU: 1 vCPU (2 vCPUs recommended for handling GIS spatial data)
- RAM: 1 GB free RAM (2 GB recommended)
- Disk Space: 2 GB for the application and initial database. If you import the full national pesticide databases and cadastral maps, up to 10 GB may be required.
Software Prerequisites ​
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
Quick Installation with Docker Compose ​
The easiest way to start AgriReg is using Docker Compose. This automatically spins up the API server (Go backend), the user interface (Vue 3 frontend), and the relational database (PostgreSQL + PostGIS).
- Create a project directory and create a file named
docker-compose.ymlwith the following content:
version: '3.8'
services:
db:
image: postgis/postgis:15-3.3
container_name: agrireg_db
environment:
POSTGRES_DB: agrireg
POSTGRES_USER: agriuser
POSTGRES_PASSWORD: agripassword
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
restart: always
backend:
image: agrireg/backend:latest
container_name: agrireg_backend
ports:
- "8080:8080"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=agriuser
- DB_PASSWORD=agripassword
- DB_NAME=agrireg
depends_on:
- db
restart: always
frontend:
image: agrireg/frontend:latest
container_name: agrireg_frontend
ports:
- "80:80"
depends_on:
- backend
restart: always
volumes:
pgdata:- Start the services in the background:
docker compose up -d- Open your web browser and navigate to
http://localhost(or your server's IP address) to access the AgriReg user interface.
Initial Configuration ​
On the first startup, the application will prompt you to set up an administrator account and import the authorized pesticide database for your country.
Importing the Pesticide Database ​
AgriReg includes a built-in scraper/parser that connects directly to official open data channels (such as Ministry of Agriculture APIs) to fetch the latest authorized plant protection products. To start:
- Log in as an administrator.
- Go to Settings > Data Sync.
- Select your country database and click Start Sychronization.
The import process takes about 2-3 minutes and populates your database with commercial product names, active ingredients, maximum dosages, and safety intervals (pre-harvest intervals).
S3 Storage Configuration (Optional) ​
By default, AgriReg saves local uploads and attachments (such as photos of physical logs, disposal receipts, or exported maps) to the container's local filesystem. If you require a high-availability production setup or want to link external S3-compatible persistent storage, you can connect any AWS S3-compatible object storage provider (e.g., AWS S3, Cloudflare R2, Backblaze B2, or MinIO).
Add the following environment variables to the backend service in your docker-compose.yml:
- STORAGE_S3_ENDPOINT=https://your-s3-endpoint.com
- STORAGE_S3_REGION=us-east-1
- STORAGE_S3_BUCKET=your-bucket-name
- STORAGE_S3_ACCESS_KEY_ID=your-access-key-id
- STORAGE_S3_SECRET_ACCESS_KEY=your-secret-access-key
- STORAGE_S3_PUBLIC_URL=https://cdn.yourdomain.com
- STORAGE_S3_FORCE_PATH_STYLE=trueVariable Details: ​
STORAGE_S3_PUBLIC_URL: Public URL from which files are served (optional, useful if caching via a CDN).STORAGE_S3_FORCE_PATH_STYLE: Set totruefor providers like MinIO or Cloudflare R2 that require path-style access instead of subdomain-style.