Tiny Tiny RSS

Last modified on 2018-01-19

Install and self-host an RSS news reader and gain access to news feeds over the web.

Let’s go!

Setup: Netbook with IP ADDRESS running the latest stable release of Debian.

0. Pre-install

Tiny Tiny RSS is a PHP application that requires a proxy web server and a database back-end to store content. See PHP + Nginx + PostgreSQL for necessary prerequisites to host TTRSS. 1

1. Database

Create a new PostgreSQL database to hold the content of RSS feeds. Example: Launch the PostgreSQL interactive console front-end psql as the postgres user and create a new username www-data 2 and database ttrss

$ sudo -u postgres psql postgres
postgres=# CREATE USER "www-data" WITH PASSWORD 'newpasswd';   
postgres=# CREATE DATABASE ttrss WITH OWNER "www-data";                         
postgres=# GRANT ALL PRIVILEGES ON DATABASE ttrss to "www-data";                
postgres=# \quit                                                                

Reload server …

$ sudo systemctl restart postgresql

1.1 Peer authentication

Later when running the TTRSS update.php script you may run into the error Peer authentication failed for user .

[ Fix! ] 3 Edit /etc/postgresql/*/main/pg_hba.conf and change peer

# "local" is for Unix domain socket connections only                            
local   all             all                                     peer            

… to trust

# "local" is for Unix domain socket connections only
local   all             all                                     trust           

Reload server …

$ sudo systemctl restart postgresql                                       


Clone the ttrss repository using Git …

$ git clone https://tt-rss.org/git/tt-rss.git tt-rss

Move ttrss directory into Nginx’s document root directory (I use /home/foo/www) and change some permissions …

$ mv tt-rss /home/foo/www/ttrss
$ cd ttrss                                                                      
$ chmod -R 777 cache/images cache/js cache/export cache/upload feed-icons lock

3. Nginx

Create a server block (virtual host) for TTRSS. An example /etc/nginx/sites-available/ttrss 4 configuration …

server {                                                                        
        listen 80;
        listen [::]:80;
        root /home/foo/www/ttrss;
        index index.php;                                       
        access_log /var/log/nginx/ttrss_access.log;                                 
        error_log /var/log/nginx/ttrss_error.log info;                              
        server_name ttrss.*;                                                      
        location / {                                                                
            index           index.php;                                              
        location ~ \.php$ {                                                         
            try_files $uri = 404; #Prevents autofixing of path which could be used for exploit
            fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;                               
            fastcgi_index index.php;                                                
            include /etc/nginx/fastcgi.conf;

Alternative: Create a self-signed SSL certificate and configure HTTPS access on port 443.

Save changes and enable block …

$ cd /etc/nginx/sites-enabled                                               
$ sudo ln -s /etc/nginx/sites-available/ttrss                                       
$ sudo systemctl restart nginx                                         

3.1 Add hostname to HOSTS

On the Linux client device, modify /etc/hosts by adding the ttrss.lan address …    ttrss.lan

4. Configure

Navigate to https://ttrss.lan/install/ and configure …

Database type: [select PostgreSQL]                                                
Username: www-data                                                              
Password: [database password created earlier]                                         
Database Name: ttrss                                                            
Hostname: [leave blank]                                                           
Port: 5432
URL: https://ttrss.lan    # 'https' if using the SSL certificate option

Press Test configuration, then Initialize database, and finally Save configuration.

Navigate back to ttrss.lan and log back in with username admin and password password. In the top-right go to Actions->Preferences to make further changes to default settings. Create new user account (vs logging in all the time as admin) and change the default admin password.

5. Updates

Fix ‘Peer authentication failed for user’ errors when trying to run the TTRSS update.php script by modifying /etc/postgresql/*/main/pg_hba.conf and change …

# "local" is for Unix domain socket connections only
local   all             all                                     peer

… to …

# "local" is for Unix domain socket connections only
local   all             all                                     trust

Restart ….

$ sudo systemctl restart postgresql

Test updates …

$ /usr/bin/php /home/foo/www/ttrss/update.php --feeds --quiet            

If script returns no errors add a new job to cron to run script periodically …

crontab -e


55 * * * * /usr/bin/php /home/foo/www/ttrss/update.php --feeds --quiet

🐧 Part of the Linux Home Server project.

Happy hacking!


  1. Alternative host setups can replace nginx web server with apache and postgresql database with mysql or sqlite. However the TTRSS community recommends the above combination as the optimal setup for lightweight servers like the Raspberry Pi.

  2. PostgreSQL maintains its own users and passwords, which are separate from the Linux user accounts. It is not required that your PostgreSQL usernames match the Linux usernames. However, the default setup for PostgreSQL is to give access to system users (e.g. postgres, www-data). See Practical PostgreSQL database.

  3. Unable to connect to postgresql server

  4. Make TTRSS hosted on a home server accessible from the outside over the web by configuring a dynamic DNS service (I like duckdns.org). See DDNS and OpenWrt.