Skip to content
Switch branches/tags


Build status

This is an plugin to the Hangfire to enable PostgreSQL as a storage system. Read about hangfire here: and here:


For .NET

Install Hangfire, see

Download all files from this repository, add the Hangfire.PostgreSql.csproj to your solution. Reference it in your project, and you are ready to go by using:

app.UseHangfireServer(new BackgroundJobServerOptions(), 
  new PostgreSqlStorage("<connection string or its name>"));

For ASP.NET Core

First, additional NuGet packages needs installation:

  • Hangfire
  • Hangfire.AspNetCore
  • Hangfire.PostgreSql

In Startup.cs ConfigureServices(IServiceCollection services) method add the following line:

services.AddHangfire(config =>

In Configure method, add these two lines:


And... That's it. You are ready to go. Also there exists sample application here.

If you encounter any issues/bugs or have idea of a feature regarding Hangfire.Postgresql, create us an issue. Thanks!

Enabling SSL support

SSL support can be enabled for Hangfire.PostgreSql library using the following mechanism:

config.UsePostgreSqlStorage(new DefaultConnectionBuilder(
    connection =>
        connection.ProvideClientCertificatesCallback += clientCerts =>


Copyright © 2014-2021 Frank Hommers and others (Burhan Irmikci (barhun), Zachary Sims(zsims), kgamecarter, Stafford Williams (staff0rd), briangweber, Viktor Svyatokha (ahydrax), Christopher Dresel (Dresel), Vytautas Kasparavičius (vytautask), Vincent Vrijburg, David Roth (davidroth), Tinyakov.

Hangfire.PostgreSql is an Open Source project licensed under the terms of the LGPLv3 license. Please see for license text or COPYING.LESSER file distributed with the source code.

This work is based on the work of Sergey Odinokov, author of Hangfire.

Related Projects