2021-06-24
Install Miniflux

I follow all my news and blogs via my RSS feed. I would recommend it to everyone for a safe and distraction free read.

I’ve been using miniflux for a couple of years and i am very happy with it. I remember the first time i was going to install it and had some problems because their own documentation is a bit messy. Everything you need are there, but it can be hard to find everything in the right order. Here is how i set it up on Debian 10.

Download, update and install

First of all we need to update our repositories

$ sudo apt update

Install all packages needed to run miniflux

$ sudo apt install postgresql nginx python3-certbot-nginx

Download and install miniflux. Since i run debian on my server and i am too lazy to compile it myself, i will go for the .deb-package. Find the latest release on their Github

$ wget https://github.com/miniflux/v2/releases/download/x.x.xx/miniflux_x.x.xx_amd64.deb
$ sudo dpkg -i miniflux_x.x.xx_amd64.deb

Configuration

Edit the configuration file to fit your needs. For more info about the options what to put in it, see miniflux man page. My options is below

$ vim /etc/miniflux.conf

DATABASE_URL="user=miniflux password=pw dbname=miniflux sslmode=disable"
BASE_URL=https://your.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

Just a heads up. A few versions back they added the option CLEANUP_ARCHIVE_UNREAD_DAYS which removes unread entries after..i think it was 6 months. If you add that option and set it to -1, they will never be removed from the database.

Now we need to export the DATABASE_URL variable with your info

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

Database

Create and migrate the database

$ sudo -u postgres createuser -P miniflux
$ sudo -u postgres createdb -O miniflux miniflux
$ sudo -u postgres psql

postgres=# ALTER USER miniflux WITH SUPERUSER;
postgres=# \q
$ miniflux -migrate
$ sudo -u postgres psql
postgres=# ALTER USER miniflux WITH NOSUPERUSER;
postgres=# \q

Nginx

First we need to create and populate the nginx configuration file

$ sudo vim /etc/nginx/sites-available/miniflux

This is the config miniflux provides

server {
    server_name     your.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;
    }
}

For nginx to understand that we what to serve this page, we need to symlink it

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

If the service dont start

For some reason miniflux doesn’t create a socket file and won’t be able to start by itself. I always try to start miniflux myself before i do this, but this is usually what i need to do. run sudo systemctl start miniflux and sudo systemctl status miniflux and see what the status is before manually creating the directory below. After that, we restart miniflux and nginx.

$ sudo mkdir /run/miniflux/ && sudo chown -R miniflux: /run/miniflux
$ sudo systemctl restart miniflux
$ sudo systemctl restart nginx

Certbot

The last thing we need to do now before the service is done is to create a certificate. You’ll be guided though the creation of the certificate. After that we will restart the services

$ sudo certbot

Final step, create your admin user

Create your admin user

$ miniflux -create-admin

Now the RSS aggregator is up and running with your user and a certificate.

Newsboat

I know a lot of people like to have their RSS feed in the terminal. While this is greate when you’re at home, I usually read my feed when I’m not at the computer. However, it is possible to integrate your feed into Newsboat, see this part in the newsboat documentation.

I still haven’t looked in to a password file or any other safe way to store my password yet.

#miniflux #rss #selfhosted