Skip to content

Deploying Leed

Introduction

Leed (short for Light Feed) is a minimalist, self-hosted RSS feed aggregator that prioritizes simplicity and speed. Originally developed as a lightweight alternative to more complex feed readers, Leed provides a clean interface for following your favorite websites, blogs, and news sources without the bloat of feature-heavy applications.

Built with PHP and designed for minimal resource consumption, Leed stores feeds in a MySQL/MariaDB database and presents articles through a responsive web interface. The application focuses on doing one thing well: aggregating and displaying RSS/Atom feeds in an organized, readable format.

Key highlights of Leed:

  • Lightweight Design: Minimal resource footprint makes it ideal for low-powered servers and shared hosting
  • Fast Performance: Optimized codebase ensures quick page loads and responsive navigation
  • Clean Interface: Distraction-free reading experience with a focus on content
  • OPML Import/Export: Easily migrate feeds from other readers or back up your subscriptions
  • Folder Organization: Group feeds into categories for better organization
  • Keyboard Shortcuts: Navigate efficiently using keyboard commands
  • Mobile Responsive: Read comfortably on phones and tablets
  • Multi-User Support: Create separate accounts for different users
  • API Access: Integrate with mobile apps and third-party clients
  • Easy Installation: Simple setup with minimal dependencies

This guide walks through deploying Leed on Klutch.sh using Docker, configuring the database, and customizing your feed reader for daily use.

Why Deploy Leed on Klutch.sh

Deploying Leed on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Leed without complex configuration. Push to GitHub, and your feed reader deploys automatically.

Persistent Storage: Attach persistent volumes for your database and configuration. Your feed subscriptions and read history survive container restarts.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your feeds from anywhere.

GitHub Integration: Connect your repository directly from GitHub. Updates trigger automatic redeployments.

Scalable Resources: Start with minimal resources and scale as your subscription list grows.

Environment Variable Management: Securely store database credentials without exposing them in your repository.

Custom Domains: Assign a custom domain for a personalized feed reading experience.

Always-On Availability: Your feed reader stays online 24/7, continuously fetching new articles.

Prerequisites

Before deploying Leed on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Leed configuration
  • Basic familiarity with Docker and containerization concepts
  • A MySQL/MariaDB database (can be deployed as a separate service)
  • (Optional) A custom domain for your Leed instance

Understanding Leed Architecture

Leed uses a straightforward architecture:

PHP Application: The core is a PHP application that handles feed fetching, parsing, and display.

MySQL/MariaDB Database: Stores feeds, articles, user preferences, and read states.

Cron Jobs: Scheduled tasks fetch new articles from subscribed feeds at regular intervals.

Web Interface: A responsive HTML/CSS/JavaScript frontend for reading and managing feeds.

Preparing Your Repository

Repository Structure

leed-deploy/
├── Dockerfile
├── cron/leed-cron
├── README.md
└── .dockerignore

Creating the Dockerfile

FROM php:8.2-apache
# Install required PHP extensions
RUN docker-php-ext-install mysqli pdo pdo_mysql
# Install additional packages
RUN apt-get update && apt-get install -y \
cron \
curl \
&& rm -rf /var/lib/apt/lists/*
# Enable Apache modules
RUN a2enmod rewrite
# Set working directory
WORKDIR /var/www/html
# Download and extract Leed
RUN curl -L https://github.com/LeedRSS/Leed/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1
# Set permissions
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html
# Copy cron configuration
COPY cron/leed-cron /etc/cron.d/leed-cron
RUN chmod 0644 /etc/cron.d/leed-cron && crontab /etc/cron.d/leed-cron
# Expose port
EXPOSE 80
# Start cron and Apache
CMD cron && apache2-foreground

Creating the Cron File

Create cron/leed-cron:

*/15 * * * * www-data php /var/www/html/action.php > /dev/null 2>&1

Creating the .dockerignore File

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Environment Variables Reference

VariableRequiredDefaultDescription
MYSQL_HOSTYes-MySQL/MariaDB server hostname
MYSQL_DATABASEYesleedDatabase name
MYSQL_USERYes-Database username
MYSQL_PASSWORDYes-Database password

Deploying Leed on Klutch.sh

    Set Up MySQL/MariaDB Database

    Deploy a MySQL or MariaDB database as a separate Klutch.sh app or use a managed database service. Create a database for Leed.

    Push Your Repository to GitHub

    Terminal window
    git init
    git add Dockerfile cron/ .dockerignore README.md
    git commit -m "Initial Leed deployment configuration"
    git remote add origin https://github.com/yourusername/leed-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project named “leed” or “rss-reader”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account and select your Leed repository.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Add database connection variables:

    VariableValue
    MYSQL_HOSTYour MySQL hostname
    MYSQL_DATABASEleed
    MYSQL_USERYour database username
    MYSQL_PASSWORDYour database password

    Attach Persistent Volumes

    Mount PathRecommended SizePurpose
    /var/www/html/constant.php1 MBConfiguration file

    Deploy Your Application

    Click Deploy to start the build process.

    Complete Installation

    Access your Leed instance and complete the web-based installation:

    1. Navigate to https://your-app.klutch.sh/install.php
    2. Enter your database credentials
    3. Create an admin account
    4. Complete the setup wizard

Initial Configuration

Adding Your First Feeds

After installation:

  1. Log in with your admin credentials
  2. Click the ”+” button to add a new feed
  3. Enter the RSS/Atom feed URL
  4. Organize into folders if desired

Importing from Other Readers

  1. Export an OPML file from your previous reader
  2. Navigate to Settings > Import
  3. Upload your OPML file
  4. Review and confirm the imported feeds

Configuring Update Intervals

The cron job updates feeds every 15 minutes by default. Modify cron/leed-cron to change the frequency:

  • Every 5 minutes: */5 * * * *
  • Every 30 minutes: */30 * * * *
  • Hourly: 0 * * * *

Production Best Practices

Security Recommendations

  • Use strong passwords for all accounts
  • Remove install.php after setup completes
  • Keep PHP and Leed updated
  • Restrict database access to necessary hosts

Performance Tips

  • Limit the number of feeds if running on limited resources
  • Adjust cron frequency based on needs
  • Use database connection pooling
  • Enable PHP opcache for faster performance

Backup Strategy

  1. Regularly back up the MySQL database
  2. Export your OPML feed list periodically
  3. Back up the configuration file

Troubleshooting

Feeds Not Updating

  • Verify cron is running inside the container
  • Check PHP error logs for fetch failures
  • Ensure the feed URLs are accessible
  • Test feeds with an online RSS validator

Database Connection Issues

  • Verify database credentials in environment variables
  • Ensure MySQL is accessible from the container
  • Check firewall rules between services

Display Problems

  • Clear browser cache
  • Check Apache error logs
  • Verify file permissions are correct

Additional Resources

Conclusion

Deploying Leed on Klutch.sh gives you a lightweight, self-hosted RSS reader with automatic builds and secure HTTPS access. Its minimalist design ensures fast performance and a distraction-free reading experience.

With Leed on Klutch.sh, you can stay updated with your favorite content sources while maintaining complete control over your data and reading habits.