Start a self-hosted news aggregator
Start a Self-Hosted News Aggregator
This tutorial will guide you through setting up your own self-hosted news aggregator. This can be particularly useful for homelab enthusiasts or developers looking to have full control over their data and services.
Hardware or Software Requirements
- A server with at least 1GB of RAM (2GB recommended)
- At least 500MB of storage space (more if you plan on storing images)
- An internet connection
- LAMP stack installed (Linux, Apache, MySQL, PHP) or a similar web server environment
- A domain name for your aggregator (optional but recommended for better user experience)
Step-by-Step Instructions
Choose a news aggregator software. For this tutorial, we will use Newsboat, an open-source RSS/Atom feed reader.
Install the necessary dependencies on your server. If you are using Ubuntu or Debian, run:
sudo apt update sudo apt install newsboatCreate a MySQL database and user for Newsboat to store its data.
mysql -u root -p CREATE DATABASE newsboat; GRANT ALL PRIVILEGES ON newsboat.* TO 'newsboat_user'@'localhost' IDENTIFIED BY 'your_password'; FLUSH PRIVILEGES; EXIT;Create a configuration file for Newsboat. You can do this by running:
newsboat --initEdit the generated .newsboat/config file to add your RSS feed URLs and other preferences.
Start Newsboat by running:
newsboatTo make Newsboat run automatically on boot, you can use a systemd service file. Create a new file at /etc/systemd/system/newsboat.service:
[Unit] Description=Newsboat RSS/Atom feed reader After=syslog.target network.target [Service] Type=simple User=ExecStart=/usr/bin/newsboat Restart=on-failure [Install] WantedBy=multi-user.target Reload the systemd daemon and enable Newsboat to start on boot:
sudo systemctl daemon-reload sudo systemctl enable newsboat.serviceStart the service:
sudo systemctl start newsboat
Commands Where Useful
Here are some commands that might be useful during setup:
- Create MySQL database and user:
mysql -u root -p; CREATE DATABASE newsboat; GRANT ALL PRIVILEGES ON newsboat.* TO 'newsboat_user'@'localhost' IDENTIFIED BY 'your_password'; FLUSH PRIVILEGES; EXIT; - Edit configuration file:
nano ~/.newsboat/config - Start Newsboat:
newsboat - Create systemd service file:
nano /etc/systemd/system/newsboat.service - Reload and enable service:
sudo systemctl daemon-reload; sudo systemctl enable newsboat.service - Start the service:
sudo systemctl start newsboat
Troubleshooting Section
If Newsboat fails to start, check the logs for any errors using
journalctl -xeu newsboat.service.If you encounter issues with database permissions, ensure that the user has the correct privileges by running
GRANT ALL PRIVILEGES ON newsboat.* TO 'newsboat_user'@'localhost'; FLUSH PRIVILEGES;To check if your server can access the internet and fetch RSS feeds, try running
curl -I https://example.com/rss.
Conclusion
You have now successfully set up a self-hosted news aggregator using Newsboat. This setup allows you to curate your own news sources and keep them updated without relying on third-party services.
Comments