Install Miniflux on Ubuntu 14.04

install-miniflux-on-an-ubuntu-14-04-vpsIn this tutorial, we will learn how to install Miniflux on an Ubuntu 14.04 VPS with PHP-FPM and Nginx. Miniflux is an opensource, self-hosted minimalist web-based RSS reader optimized for readability. It is fast, simple, efficient and it works with your smartphone, tablet or desktop. This guide should work on other Linux VPS systems as well but was tested and written for an Ubuntu 14.04 VPS.

Login to your VPS via SSH

ssh user@vps_IP

Update the system and install necessary packages

[user]$ sudo apt-get update && sudo apt-get -y upgrade
[user]$ sudo apt-get install software-properties-common git nano curl

Install PHP, Composer and required PHP modules

To install the latest stable version of PHP version 5.6 and all necessary modules, run:

[user]$ sudo add-apt-repository -y ppa:ondrej/php5-5.6
[user]$ sudo apt-get update
[user]$ sudo apt-get -y install php5-fpm php5-cli php5-json php5-curl php5-sqlite

Composer is a dependency manager for PHP with which you can install packages. Composer will pull in all the required libraries and dependencies you need for your project.

[user]$ curl -sS https://getcomposer.org/installer | php
[user]$ sudo mv composer.phar /usr/local/bin/composer

Install miniflux

Clone the project repository from GitHub:

[user]$ git clone https://github.com/miniflux/miniflux.git ~/myminiflux.com

Change to the directory:

[user]$ cd  ~/myminiflux.com

Install all PHP dependencies using composer

[user]$ composer install

Set the Cronjob

The cron job task will automatically update your feeds on a regular basis.
Type crontab -e to edit your crontab file or create one if it doesn’t already exist and enter the folowing:

# Update all feeds in 60 minutes (updates the 8 oldest feeds each time with a total of 120 feeds).
* */4 * * *  cd /home/your_user/myminiflux.com && /usr/bin/php cronjob.php --call-interval=4 --update-interval=60 >/dev/null 2>&1

Do not forget to change your_user with your username.

PHP-FPM configuration

Create a new PHP-FPM pool for your user:

[user]$ sudo nano /etc/php5/fpm/pool.d/your_user.conf
[your_user]
user = your_user
group = your_user
listen = /var/run/php-fpm-your_user.sock
listen.owner = your_user
listen.group = your_user
listen.mode = 0666
pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
pm.max_requests = 200
chdir = /

Do not forget to change your_user with your username.
Restart PHP-FPM:

[user]$ sudo service php5-fpm restart

Install and configure Nginx

Ubuntu 14.04 comes with Nginx version 1.4, to install the latest stable version of Nginx version 1.8, run:

[user]$ sudo add-apt-repository -y ppa:nginx/stable
[user]$ sudo apt-get update
[user]$ sudo apt-get -y install nginx

Generate a self signed ssl certificate:

[user]$ sudo mkdir -p /etc/nginx/ssl
[user]$ cd /etc/nginx/ssl
[user]$ sudo openssl genrsa -des3 -passout pass:x -out miniflux.pass.key 2048
[user]$ sudo openssl rsa -passin pass:x -in miniflux.pass.key -out miniflux.key
[user]$ sudo rm miniflux.pass.key
[user]$ sudo openssl req -new -key miniflux.key -out miniflux.csr
[user]$ sudo openssl x509 -req -days 365 -in miniflux.csr -signkey miniflux.key -out miniflux.crt

If you don’t want to get warnings associated with self-signed SSL Certificates, you can purchase a trusted SSL certificate.

Next, create a new Nginx server block:

[user]$ sudo nano /etc/nginx/sites-available/myminiflux.com
server {
    listen 443;
    server_name myminiflux.com;
    root /home/your_user/myminiflux.com;
    index index.php;

    location / {
      try_files $uri $uri/ /index.php$is_args$args;
    }

    ssl on;
    ssl_certificate     /etc/nginx/ssl/miniflux.crt;
    ssl_certificate_key /etc/nginx/ssl/miniflux.key;
    ssl_session_timeout 5m;
    ssl_ciphers               'AES128+EECDH:AES128+EDH:!aNULL';
    ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    access_log  /var/log/nginx/miniflux.access.log;
    error_log   /var/log/nginx/miniflux.error.log;

    location /data {
      deny all;
      return 404;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php-fpm-your_user.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen      80;
    server_name myminiflux.com;

    add_header Strict-Transport-Security max-age=2592000;
    rewrite ^ https://$server_name$request_uri? permanent;
}

Do not forget to change your_user with your username.

Activate the server block by creating a symbolic link :

[user]$ sudo ln -s /etc/nginx/sites-available/myminiflux.com /etc/nginx/sites-enabled/myminiflux.com

Test the Nginx configuration and restart nginx:

[user]$ sudo nginx -t
[user]$ sudo service nginx restart

That’s it. You have successfully installed Miniflux on your Ubuntu 14.04 VPS. The default username and password are both admin. Do not forget to change the default password. For more information about how to manage your Miniflux installation, please refer to the official miniflux documentation.


Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

3 thoughts on “Install Miniflux on Ubuntu 14.04”

  1. server {
    listen 443;
    server_name myminiflux.com;
    root /home/your_user/myminiflux.com;
    index index.php

    Last line should be:

    index index.php;

    Reply

Leave a Comment