Show Navigation


Plugin allows to use embedded postgres in application.

Owner: relaximus | 1.1.2 | Jan 17, 2019 | Package | Issues | Source | License: Apache-2.0

dependencies {
    compile 'embedded.postgres:embedded-postgres:1.1.2'



Build Status Download

Plugin replaces default embedded H2 datasource in awesome Grails framework to Postgres. Plugin uses already existing solution otj-pg-embedded.

This plugin is not for production use, the main idea to have your development and u-test environment similar to the standalone production Postgres (of course, if you use this DB in the project).

Getting Started

To get started with the minimum of configuration start from the following: Add to your build.gradle

repositories {
    maven {
        url  "" 
compile 'org.grails.plugins:embedded-postgres:1.1.2'

In your application.yml change the dataSource settings to the next one:

    embeddedPostgres: true


Plugin configured to work with Grails 3.0.0 or higher, but theoretically can be used even for older version of it. But this was not checked properly, so contributing is welcome.


Plugin uses next parameters in DataSource section:

|Parameter name|Description|Default value| |--------------|-----------|-------------| | embeddedPostgres | Enabling of the plugin, main switcher. | false | | embeddedPort | You can define the particular port, which will be used by Postgres instance | random free port | | url | You can specify the url with any additional parameters, which Postgres understands | jdbc:postgresql://localhost:/postgres | | username || postgres | | password || postgres |

All other parameters common for the Grails Datasource configuration section are being used by grails dataSource plugin. For example, you can set

    pooled: true
    embeddedPostgres: true

In this case embedded Postgres will be created with connection pool in front of it.


Apache License, Version 2.0


  • Great respect to the otj-pg-embedded for Embedded Postgres implementation.