# Install ODK with Postgres

**URL:** <https://forum.getodk.org/t/install-odk-with-postgres/13559>\
**Category:** Support\
**Created:** [June 14, 2018, 2:38am UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559 "2018-06-14T02:38:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_Sosa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gabriel\_Sosa](https://forum.getodk.org/u/Gabriel_Sosa)\
**Post date:** [June 14, 2018, 2:38am UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/1 "2018-06-14T02:38:19Z")

</div>

Hello,  
I have a problem,  
The problem is that it does not install with postgres. Does anyone have a step-by-step manual?

Best regards.

Gabriel Sosa

---

<div class="post-metadata">

**Author:** ![mathieubossaert](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/mathieubossaert/32/6131_2.png) [@mathieubossaert](https://forum.getodk.org/u/mathieubossaert)\
**Post date:** [June 14, 2018, 6:50am UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/2 "2018-06-14T06:50:41Z")

</div>

Hi,

of course it does.  
Where are you blocked ?

By the way, you need to install postgresql by yourself.  
When PostgreSQL runs, you can start to "install" Aggregate with the "installer" and enter the parameters db connection parameters.  
The install will generate the SQL code to run over your PostgreSQL instance. Adapt it if your database or schema already exist.  
On PostgreSQL 10 the script will throw an error because of the use of the "unencrypted" option for password creation.

You just need to delete the word. here is the code to adapt :

```sql
-- Adapt this code to your conf

create database "odk_database_name";
create user "db_user_name" with /* unencrypted */ password 'db_user_password';
grant all privileges on database "odk_database_name" to "db_user_name";
alter database "odk_database_name" owner to "db_user_name";

-- Connect to ODK DATABASE called odk_database_name
\c "odk_database_name";

create schema "odk_schema_name";
grant all privileges on schema "odk_schema_name" to "odk_user_name";
alter schema "odk_schema_name" owner to "odk_user_name";

```

---

<div class="post-metadata">

**Author:** ![Gabriel\_Sosa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gabriel\_Sosa](https://forum.getodk.org/u/Gabriel_Sosa)\
**Post date:** [June 14, 2018, 1:38pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/3 "2018-06-14T13:38:15Z")

</div>

the problem is Apache Tomcat  
when I start the application I get: FAIL -Application Context path / ODKAggregate could not be started

---

<div class="post-metadata">

**Author:** ![mathieubossaert](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/mathieubossaert/32/6131_2.png) [@mathieubossaert](https://forum.getodk.org/u/mathieubossaert)\
**Post date:** [June 14, 2018, 1:57pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/4 "2018-06-14T13:57:37Z")

</div>

So it's not tomcat but Aggregate. The parameters you input are certainly wrong. Or the user does not have sufficient rights.  
You should check it with pgadmin or psql (same database / schema / user / host adress)

Maybe you will find some info into the tomcat logs.

---

<div class="post-metadata">

**Author:** ![Gabriel\_Sosa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gabriel\_Sosa](https://forum.getodk.org/u/Gabriel_Sosa)\
**Post date:** [June 14, 2018, 2:15pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/5 "2018-06-14T14:15:23Z")

</div>

I'm using windows server 2016 does it affect anything?

---

<div class="post-metadata">

**Author:** ![mathieubossaert](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/mathieubossaert/32/6131_2.png) [@mathieubossaert](https://forum.getodk.org/u/mathieubossaert)\
**Post date:** [June 14, 2018, 3:14pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/6 "2018-06-14T15:14:43Z")

</div>

I don't think so, bu I work on linux so I can't be sure.

---

<div class="post-metadata">

**Author:** ![Gabriel\_Sosa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/g/ee59a6/32.png) [@Gabriel\_Sosa](https://forum.getodk.org/u/Gabriel_Sosa)\
**Post date:** [June 14, 2018, 3:51pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/7 "2018-06-14T15:51:04Z")

</div>

Can you explain me install odk in Ubuntu server? Please..

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 14, 2018, 6:33pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/8 "2018-06-14T18:33:09Z")

</div>

@Gabriel_Sosa A step-by-step guide is going to be hard because those instructions change frequently.

Have you tried the [ODK Aggregate VM](https://docs.opendatakit.org/aggregate-vm/)? It's Ubuntu-based and is backed by PostgreSQL and very easy to install. Start there and get that working.

Once that's done, then in your Ubuntu machine, try installing Tomcat and PostgreSQL separately. Once those two are confirmed working, then follow the instructions at [https://docs.opendatakit.org/aggregate-tomcat/#installation-procedure](https://docs.opendatakit.org/aggregate-tomcat/#installation-procedure).

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [March 3, 2019, 7:08pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/9 "2019-03-03T19:08:53Z")

</div>

A post was split to a new topic: [Trouble installing Aggregate with PostgreSQL](https://forum.getodk.org/t/trouble-installing-aggregate-with-postgresql/18248)

---

<div class="post-metadata">

**Author:** ![flaviove](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/f/45deac/32.png) [@flaviove](https://forum.getodk.org/u/flaviove)\
**Post date:** [January 19, 2020, 4:47pm UTC](https://forum.getodk.org/t/install-odk-with-postgres/13559/10 "2020-01-19T16:47:20Z")

</div>

Hi @yanokwa, by what you wrote, we have two options: The first one is using a VM image to get evething up and running. The second one is using the traditional install and separately get Ubuntu and Postgres. After that ODK Aggregate. Am I right? Sorry i am a "nooby player".  
Reagards,  
Flávio Veras
