Categories Tutorials

How to install ODK Aggregate using Docker Image?

How to install ODK Aggregate using Docker Image?

This document explains the process of ODK Aggregate Installation using Docker Image on Ubuntu Server.

Pre-requisites for ODK Aggregate installation using Docker

There are following pre-requisites you need to run the installation process of ODK Aggregate using Docker –

1. Ubuntu Server (Ubuntu 18.08) – with root access
2. Docker
3. PostgreSql Database

Installation of Components

This section helps to install all the required components mentioned in above section if not installed already on the server.

Docker Installation

Further, you need to install docker on your server so that docker image (You will produce this in next step) can be run to install ODK Aggregate. Please follow the installation steps below –
Click Here to install Docker on Ubuntu server.

PostgreSql Installation

You need to install PostgreSql on your server as it is required for ODK Aggregate to run. To install the same, please follow the steps below –
Ref. URL –
Note – In case, if you are using Amazon RDS for database then you can skip this step to install PostgreSql. You just need to run the queries mentioned below under section “Queries to Execute” to set up Database and Schema with user access in PostgreSql so that ODK Aggregate installation can create DB tables.

1. Login to the server with root access.
2. Run following commands one by one –

a. sudo apt-get install postgresql-10

3. That’s it and it will install PostgreSql on your server.

Further, you need to create User, Schema and Database in PostgreSql for ODK Aggregate. Kindly run the following command for that –

Queries To Execute

create database “DB NAME”;
create user “DB USER” with /* unencrypted */ password ’DB PASSWORD’;
grant all privileges on database “DB NAME” to “DB USER”;
alter database “DB NAME” owner to “DB USER”;

create schema “DB SCHEMA”;
grant all privileges on schema “DB SCHEMA” to “DB USER”;
alter schema “DB SCHEMA” owner to “DB USER”;

Note – Kindly change following placeholders with your actual values in above queries –
a. DB NAME – Replace it with your database name
b. DB USER – Replace it with your database user name
c. DB Password – Replace it with your database Password
d. DB Schema – Replace it with your database schema name

ODK Aggregate Installation Using Docker

This section explains the installation of ODK Aggregate with Docker. For this, you need to run following command –

1. Login to the server with root access.
2. Run following commands one by one –

a. docker run -e AGGREGATE_HOST=auto -e DB_SCHEMA= -e DB_USERNAME= -e DB_PASSWORD= -e DB_HOST= -e DB_NAME= -p 8080:8080 knowband/odk-aggregate-ubuntu (It will run the docker image and configure ODK Aggregate with DB tables set up)

b. Now, you can open ODK Aggregate on the browser using following link –