Miniflux on Pi

I chose to go with DietPi as the OS on my Pi 3B+ for two reasons. One for the software repo and second because it was lighter than Raspbian AND took care of excessive logging. Not that it mattered because I had already attached an m.2 SSD to the Pi. Suck it SD cards! The choice of softwares offered on DietPi is very comprehensive and makes self-hosting almost painless. I installed FreshRSS from its repo and its growing on me. Its no Inoreader but it resides on my Pi, doesn’t badger me to upgrade to a paid subscription and the installation is a breeze.

I have heard so much about Miniflux by now that I had to try it. The last time I gave it a try I was clueless and the instructions weren’t linear either. Searching for help with its instructions took me to some sites which talked about installing it on Ubuntu desktop. I found only one blog which describes the installation on an openWRT over Pi. Though these blogs and sites didn’t help with the actual instructions, they helped me piece together what steps I do need to follow.

  1. Install Postgres - Follow this guide until the creation of database. I chose to accept all devices on the network and accept all IP addresses. From security standpoint, this is not a good option but this setup is only for me.

  2. Miniflux uses a default configuration file but if we chose to change some of the environment variables, we can do so by creating a miniflux.conf file in /etc and adding the required environment variables in it.

  3. Configure the database - The commands shown on the installation page are an example and thus differ slightly in actual use. The database name here is miniflux but the configuration file in the previous step refers to the database miniflux2 and in the lack of a configuration file, the application defaults to miniflux2 as the database name. So try to keep the database name same as miniflux2 to avoid any confusion.

  4. Enabling HSTORE extension for Postgresql - I used the second command to enable HSTORE extension with the root user. sudo -u postgres psql $MINIFLUX_DATABASE.

  5. Download the Miniflux build - For the Raspberry Pi, we need the ARMV7 build. Download it with wget and move the binary to /usr/local/bin

  6. Now we need to make the binary executable by issuing chmod +x miniflux. Refer this.

  7. If we have a custom configuration file, pass the argument -c /etc/miniflux.conf when running the binary. So for the next step of running SQL migrations use this command miniflux -migrate -c /etc/miniflux.conf.

  8. Create an admin user miniflux -create-admin -c /etc/miniflux.conf.

  9. And finally run the application miniflux -c /etc/miniflux.conf.

If all went well, Miniflux should be available at http://x.x.x.x:8080 on the client machine and we can login with the admin user created in step 8.

Issues I faced: a. For some reason, Miniflux wouldn’t accept my custom config file and always tried to listen for incoming connections on 127.0.0.1:8080. I even had it updated to the static address of the Pi I was running Miniflux on. So I did the next best thing and set the env variable LISTEN_ADDR manually by using this export LISTEN_ADDR=x.x.x.x:8080. That did the trick and I was able to access Miniflux on my laptop by going to this address http://x.x.x.x:8080. b. I tried to set it up a systemd service but Miniflux would once again ignore my custom config file. To overcome that, I did a systemctl edit miniflux.service and added the following lines in the auto-generated override configuration file -

[Service]
Environment="LISTEN_ADDR=x.x.x.x:8080"

I will be evaluating both FreshRSS and Miniflux over the next few days but I can already tell I prefer FreshRSS over Miniflux.

Day 22 - Join Me in #100DaysToOffload