Selfoss is a lightweight, open-source web application designed for self-hosting RSS feeds and personal content aggregation. It offers users control over their data, extensive customization options, and a clean, responsive interface. Whether you're a developer seeking a self-hosted solution or a tech-savvy user looking for a powerful RSS reader, this guide will walk you through deploying, configuring, and managing Selfoss step-by-step.
Installing Selfoss
π¦ Docker/Docker Compose Setup
Using Docker is one of the easiest ways to deploy Selfoss. Hereβs how you can set it up with Docker Compose:
- Create a
docker-compose.yml
file:
version: '3.9'
services:
selfoss:
image: selfoss/selfoss:latest
container_name: selfoss
ports:
- "8080:80"
volumes:
- ./data:/var/www/html/data
- ./config.ini:/var/www/html/config.ini
restart: unless-stopped
This configuration maps the application to port 8080, stores data persistently in a ./data
directory, and allows configuration via a config.ini
file.
- Deploy Selfoss using Docker Compose:
docker-compose up -d
After running this command, Selfoss will be accessible at http://<your_server_ip>:8080
.
π Manual Installation
For those who prefer a manual installation approach on a Linux server, follow these steps:
- Install necessary dependencies:
sudo apt update
sudo apt install -y apache2 php libapache2-mod-php php-sqlite3 unzip wget
- Download and extract Selfoss:
wget https://github.com/SSilence/selfoss/releases/latest/download/selfoss.zip
unzip selfoss.zip -d /var/www/selfoss
- Set permissions and configure Apache:
sudo chown -R www-data:www-data /var/www/selfoss
sudo chmod -R 755 /var/www/selfoss
- Enable Apache modules and restart:
sudo a2enmod rewrite
sudo systemctl restart apache2
Selfoss should now be accessible via your server's IP address.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To use Nginx as a reverse proxy for Selfoss:
- Create an Nginx server block file:
sudo nano /etc/nginx/sites-available/selfoss
Add the following configuration:
server {
listen 80;
server_name 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;
}
}
- Enable the configuration and restart Nginx:
sudo ln -s /etc/nginx/sites-available/selfoss /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
π SSL/TLS Setup
To secure Selfoss with SSL using Letβs Encrypt:
- Install Certbot:
sudo apt install -y certbot python3-certbot-nginx
- Generate and apply an SSL certificate:
sudo certbot --nginx -d example.com
- Automate certificate renewal:
sudo systemctl enable certbot.timer
Logging and Debugging Selfoss
ποΈ Enabling Debug Logs
To enable debug-level logging in Selfoss:
- Edit the
config.ini
file in your Selfoss directory:
nano /path/to/selfoss/config.ini
- Add or modify the following line:
log_level = DEBUG
π Viewing Logs
If you are using Docker, view logs with:
docker logs -f selfoss
For manual installations, check logs in the data/log
directory:
tail -f /var/www/selfoss/data/log/selfoss.log
π οΈ Troubleshooting Common Issues
Inspect logs for specific errors such as database connection failures. For example, if you encounter a SQLite permission error, ensure the data
directory is writable:
sudo chmod -R 755 /var/www/selfoss/data
Backup and Restore
ποΈ File-Based Backups
Backup the Selfoss configuration and data files:
tar -czvf selfoss_backup.tar.gz /path/to/selfoss/config.ini /path/to/selfoss/data
π Database Backups
If Selfoss uses SQLite, backup the database with:
cp /path/to/selfoss/data/sqlite.db /path/to/backup/sqlite.db
Restore the database by copying the backup file back to its original location.
π Automated Backup Scripts
Set up automated backups using cron:
- Create a backup script:
nano backup_selfoss.sh
Add the following:
#!/bin/bash
tar -czvf /path/to/backup/selfoss_$(date +%F).tar.gz /path/to/selfoss/data
- Make the script executable and schedule it via cron:
chmod +x backup_selfoss.sh
crontab -e
Add a daily backup task:
0 2 * * * /path/to/backup_selfoss.sh
Updating and Upgrading Selfoss
β¬οΈ Updating Docker Images
To update Selfoss when using Docker:
- Pull the latest image:
docker-compose pull selfoss
- Restart the container:
docker-compose up -d
π οΈ Manual Updates
For manual installations, download the latest version and replace the existing files:
wget https://github.com/SSilence/selfoss/releases/latest/download/selfoss.zip
unzip -o selfoss.zip -d /var/www/selfoss
Then restart your web server:
sudo systemctl restart apache2
Leveraging Selfossβs Unique Features
π§ Enabling APIs
To enable the Selfoss API:
- Edit the
config.ini
file:
api_enabled = true
- Use the API to fetch items with
curl
:
curl http://example.com/api/items
π Advanced Configurations
To customize how feeds are updated, modify the config.ini
file:
sources_update_interval = 3600
This example sets the feed update interval to one hour.
Wrapping Up
By following this guide, youβve successfully deployed, configured, and secured Selfoss on your server. With its powerful features and ease of customization, Selfoss is a perfect solution for anyone looking to self-host a personal RSS feed aggregator. Now itβs time to explore APIs, advanced configurations, and backups to make the most out of your Selfoss deployment!