Installing miniflux on FreeBSD

After trying to figure out why FreshRSS does not update my feeds as frequently as I expect – it's supposed to do it every 20min, but my cron jobs every 30min only seem to show updates every few hours? – I decided to check out what other self-hosted RSS readers are around these days. It's been a few years since I looked, always good to see what's new.

The only option that seemed appealing that I hadn't tried before is miniflux – it's a very small app written in go and with very firm opinions about what a RSS reader should and should not be. As long as my opinions are somewhat in line, seems like a good option.

There's also a FreeBSD port for miniflux, and it only supports postgresql which I like, so seems like a good option.

However on installing the port I found it didn't install dependencies and configure the app as much as I expected, and so this post.

Install PostgreSQL

Also needs the contrib package, which I didn't realize at first.

sudo pkg install postgresql13-client postgresql13-server postgresql13-contrib

Next, get postgresql up and running.

sudo /usr/local/etc/rc.d/postgresql initdb

Then add postgresql_enable="YES" to /etc/rc.conf, and run

sudo service postgresql start

Setup Database

This part's straight out of the miniflux docs.

sudo su - postgresql
createuser -P miniflux
(set password)
createdb -O miniflux miniflux
psql miniflux -c 'create extension hstore'

That last part is what required the contrib package, the hstore extension is in contrib.

Install the miniflux package

sudo pkg install miniflux

I had issues with the package not properly creating the miniflux user, it errored out even though it had (partially?) added the user. A quick sudo vipw and just making a noop change (remove a character and readd it) and save, and then was able to re-run the pkg install and it worked fine.

Configure miniflux and run migrations

Generally straight forward, again pretty much straight from the docs.

Edit /usr/local/etc/miniflux.env and add the database connection string.

DATABASE_URL=user=miniflux password=[passwd] dbname=miniflux sslmode=disable

Then run these commands to do the db migrations and add the admin user.

miniflux -c /usr/local/etc/miniflux.env -migrate
miniflux -c /usr/local/etc/miniflux.env -create-admin

Assuming everything completed without errors up to this point you should be ready to start the service.

Start the service

As you'd expect for a FreeBSD port, add this to /etc/rc.conf.

miniflux_enable="YES"

Then start the serivice as you would normally

sudo service miniflux start

You should now have miniflux running on port 8080 on the server (unless you changed the port in miniflux.env). Adding a web server proxy in front of the app is left as an exercise for you – I may get to it sometime in future.