Database Configuration

This document describes how to configure PostgreSQL for Miniflux.

Database Installation

The first step is to install PostgreSQL with your package manager.

For example, on Debian it’s simple as typing this command:

sudo apt install postgresql postgresql-contrib

Database Configuration

Here an example from the command line:

# Switch to the postgres user
$ sudo -u postgres -i

# Create a database user for Miniflux
$ createuser -P miniflux
Enter password for new role: ******
Enter it again: ******

# Create a database for miniflux that belongs to our user
$ createdb -O miniflux miniflux

# Create the extension hstore as superuser
$ psql miniflux -c 'create extension hstore'
CREATE EXTENSION

Enabling HSTORE extension for Postgresql

Creating Postgresql extensions requires the SUPERUSER privilege. Several solutions are available:

  1. Give SUPERUSER privileges to the miniflux user only during the schema migration:
ALTER USER miniflux WITH SUPERUSER;
-- Run the migrations (miniflux -migrate)
ALTER USER miniflux WITH NOSUPERUSER;
  1. You could create the hstore extension with another user that have the SUPERUSER privileges before running the migrations.
sudo -u postgres psql $MINIFLUX_DATABASE
> CREATE EXTENSION hstore;

Note that if you use Debian or Ubuntu, you might have to install the postgresql-contrib package to activate the HSTORE extension.

Recent versions of Miniflux non longer uses the HSTORE extension but it still required to run the SQL migrations.

Database Connection Parameters

Miniflux uses the Golang library pq to communicate with PostgreSQL. The list of connection parameters are available on this page.

The default value for DATABASE_URL is user=postgres password=postgres dbname=miniflux2 sslmode=disable.

You could also use the URL format postgres://postgres:postgres@localhost/miniflux2?sslmode=disable.

Password that contains special characters like ^ might be rejected since Miniflux 2.0.3. Golang v1.10 is now validating the password and will return this error: net/url: invalid userinfo. To avoid this issue, do not use the URL format for DATABASE_URL, or make sure the password is URL encoded.