unoverse

Posted:

RSS with Miniflux

I consume all my news, blogs and podcasts through RSS. I’ve been doing that for many years with different apps and self hosted solutions. The one I’ve been using the last few years is Miniflux. It’s written in Go and doesn’t need a ton of depencencies. It features a nice web interface which works great on both phone and PC. Miniflux also works as a progressive web app, which is a big plus as I’m usually reading on the phone.

The RSS feed pulls the actual content and strips away everything else such as ads, trackers, cookies, Javascripts and other nasty stuff. In times like these it’s nice to be able to read news and other stuff without the need to actually visiting the site. Many social media platforms allow you to follow users content via RSS, if you’re in to that kind of stuff.

There’s also options to filter out articles before it hits your feed, if there is stuff you know you dont want in the feed.

Installation

Installing Miniflux is a very simple task and it can be installed both manually and with docker. Since I’m not a docker user I’ll just cover how to do it manually, if you prefer any other way to install it, look at the official miniflux installation documentation.

Dependencies

The first thing is to install a few packages needed for Miniflux.

sudo apt update
sudo apt install postgresql nginx python3-certbot-nginx

Download and install

Download and install the latest version of Miniflux.

wget https://github.com/miniflux/v2/releases/download/2.0.xx/miniflux_2.0.xx_amd64.deb
sudo dpkg -i miniflux_2.0.xx_amd64.deb

Configure

The config file is located in /etc/miniflux.conf. To find out what options there are for the configuration file, take a look at the official documentation.

sudo vim /etc/miniflux.conf

Here is how my config looks like

DATABASE_URL="user=miniflux password=pw dbname=miniflux sslmode=disable"
BASE_URL=<domain>
LISTEN_ADDR=/run/miniflux/miniflux.sock
POLLING_FREQUENCY=15
BATCH_SIZE=30
CLEANUP_FREQUENCY_HOURS=24
CLEANUP_ARCHIVE_READ_DAYS=30
CLEANUP_ARCHIVE_UNREAD_DAYS = -1
CLEANUP_REMOVE_SESSIONS_DAYS=30
RUN_MIGRATION=1

We need to export the $DATABASE_URL variable we defined in the config.

export DATABASE_URL="user=miniflux password=pw dbname=miniflux sslmode=disable"

Database

Next up is to create a database, database user and give that user permission to the database.

sudo -u postgres createuser -P miniflux
sudo -u postgres createdb -O miniflux miniflux
miniflux -migrate

NGINX

To be able to actually host it on the web we need a webserver and my choice is NGINX which is a webserver and reverse proxy.

We need to create the config file which should be placed in /etc/nginx/sites-available/miniflux.

This is what we till put in there

server {
    server_name     <domain>;

    location / {
        proxy_pass http://unix:/run/miniflux/miniflux.sock;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

To actually serve it on the web we will create a symlink to /etc/nginx/sites-enabled.

sudo ln -s /etc/nginx/sites-available/miniflux /etc/nginx/sites-enabled

Certificate

To be able to visit the site over SSL/HTTPS we need a certificate. We can generate one with the help of certbot that we installed earlier.

With one easy command certbot generate the certificate and add the necessary parts to our NGINX config file.

sudo certbot -d <domän>

Finish

Now we can restart NGINX and Miniflux and everything should run.

sudo systemctl restart {nginx,miniflux}

First account

One last thing we need to do is to create an admin account

miniflux -create-admin

Now we’re done and we can visit our Miniflux installation on the (sub)domain we configured and login with the admin account.