Sep 19, 2024 β€’ 3 min read

Freshrss: Your Self-Hosting Setup and Management Guide

Freshrss: Your Self-Hosting Setup and Management Guide

Freshrss is a lightweight, self-hosted RSS aggregator designed to give users full control over their feed management. It’s ideal for developers and tech-savvy users who value privacy, customization, and a streamlined user interface. In this guide, we’ll cover everything you need to deploy, configure, and manage Freshrss, including installation methods, reverse proxy setup, logging, backups, updates, and leveraging advanced features.

Installing Freshrss

πŸ“¦ Docker/Docker Compose Setup

Docker is one of the easiest ways to deploy Freshrss because it simplifies dependency management. Below is a docker-compose.yml file tailored for Freshrss.


version: "3"

services:

freshrss:

image: freshrss/freshrss:latest

container_name: freshrss

environment:

- TZ=UTC

ports:

- "8080:80"

volumes:

- freshrss_data:/var/www/FreshRSS/data

restart: unless-stopped

volumes:

freshrss_data:

Run the following commands to deploy Freshrss:


nano docker-compose.yml

## Save the file and start the container

docker-compose up -d

## Verify the container is running

docker ps

Visit http://<server-ip>:8080 in your browser to complete the web-based configuration.

πŸš€ Manual Installation

To install Freshrss directly on a Linux server:


## Update package lists and install dependencies

sudo apt update && sudo apt install -y apache2 php libapache2-mod-php php-cli php-json php-mbstring php-xml php-curl unzip

## Download and extract Freshrss

cd /var/www

sudo wget https://github.com/FreshRSS/FreshRSS/archive/refs/heads/main.zip -O freshrss.zip

sudo unzip freshrss.zip

sudo mv FreshRSS-main freshrss

## Set correct permissions

sudo chown -R www-data:www-data freshrss

sudo chmod -R 755 freshrss

## Enable required Apache modules and restart

sudo a2enmod rewrite

sudo systemctl restart apache2

Once installed, visit http://<server-ip> to finish the configuration.

Configuring Nginx as a Reverse Proxy

🌐 Nginx Configuration

Set up an Nginx server block to route traffic to Freshrss.


server {

listen 80;

server_name rss.example.com;

location / {

proxy_pass http://localhost:8080/;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

}

Save this file to /etc/nginx/sites-available/freshrss and enable it:


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

sudo nginx -t

sudo systemctl reload nginx

πŸ”’ SSL/TLS Setup

Secure your Freshrss instance with Let's Encrypt:


sudo apt install -y certbot python3-certbot-nginx

sudo certbot --nginx -d rss.example.com

## Test certificate renewal

sudo certbot renew --dry-run

πŸ› οΈ Testing and Reloading Nginx

After making any changes, validate and reload Nginx:


sudo nginx -t

sudo systemctl reload nginx

Logging and Debugging Freshrss

πŸ—ƒοΈ Enabling Debug Logs

Enable advanced logging in Freshrss by editing its configuration file:


sudo nano /var/www/freshrss/data/config.php

## Add or update the following line

'API_DEBUG' => true,

πŸ“„ Viewing Logs

For Docker installations:


docker logs freshrss

For manual installations, locate logs in /var/www/freshrss/data/log/.

πŸ› οΈ Troubleshooting Common Issues

Inspect logs for errors related to permissions or missing dependencies. For example:


cat /var/www/freshrss/data/log/php.log

πŸ“€ Exporting Logs

To send logs to an ELK Stack (ElasticSearch, Logstash, Kibana), use filebeat for log shipping. Install Filebeat and configure it to monitor Freshrss logs.

Backup and Restore

πŸ—‚οΈ File-Based Backups

Backup critical Freshrss files and directories:


tar -czvf freshrss_backup.tar.gz /var/www/freshrss

Restore with:


tar -xzvf freshrss_backup.tar.gz -C /var/www

πŸ”„ Database Backups

If using a database, export it with:


mysqldump -u root -p freshrss_db > freshrss_db_backup.sql

Restore with:


mysql -u root -p freshrss_db < freshrss_db_backup.sql

πŸ“… Automated Backup Scripts

Set up a cron job for periodic backups:


crontab -e

## Add this line to run daily

0 2 * * * tar -czvf /backup/freshrss_$(date +\%F).tar.gz /var/www/freshrss

Updating and Upgrading Freshrss

⬆️ Updating Docker Images

Pull the latest Freshrss image and redeploy:


docker-compose pull

docker-compose up -d

πŸ› οΈ Manual Updates

For manual installations:


cd /var/www/freshrss

sudo git pull origin main

sudo chown -R www-data:www-data .

πŸ” Checking for Updates

Visit Freshrss’s GitHub page or check for updates within the app’s settings.

Leveraging Freshrss’s Unique Features

πŸ”§ Enabling APIs

Enable the API in the configuration file:


sudo nano /var/www/freshrss/data/config.php

## Add or update this line

'ENABLE_API' => true,

Test the API with curl:


curl -X GET "http://rss.example.com/api/greader.php/reader/api/0/user-info?output=json" -u username:password

🌟 Advanced Configurations

Customize Freshrss settings like feed caching or user quotas by editing config.php. For example, increase feed cache size:


'FEED_CACHE_DURATION' => 86400,

Wrapping Up

Freshrss is a powerful, lightweight, and customizable RSS aggregator that puts you in full control of your feed management. By following this guide, you’ve learned how to deploy Freshrss, configure it with Nginx, debug issues, manage backups, and leverage its advanced features. Start implementing these steps today to enjoy a secure, privacy-focused feed reader tailored to your needs!

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Selfhosted Ninja.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.