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 as simple as typing this command:
sudo apt install postgresql postgresql-contrib
Database Creation ¶
After installing PostgreSQL, you need to create a database.
There are different ways to do that, but here is one example using the createdb command-line tool:
# Switch to the postgres user
sudo -u postgres -i
# Create a database for miniflux (owned by the default postgres user)
createdb miniflux2
Optionally, you could also create a separate user for the Miniflux database:
# Create a new user for our miniflux database
createuser -P miniflux
Enter password for new role: ******
Enter it again: ******
# Create a database owned by the miniflux user
createdb -O miniflux miniflux2
Database Configuration ¶
Older versions of Miniflux required the HSTORE extension for PostgreSQL.
This is no longer the case since version 2.0.27.
There is a SQL migration in Miniflux 2.2.14 to remove HSTORE extension from the database.
If you are seeing this Postgres error: Error: pq: must be owner of extension hstore, you can fix it by running the following SQL command as a superuser for the Miniflux database:
DROP EXTENSION hstore;
This error means you initially created the hstore extension as a different database user than the one you are currently using for Miniflux.
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.
Depending on your PostgreSQL setup, you might need to adjust the connection parameters accordingly.
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.