FreshRSS Deployment on Ubuntu 24.04: A Step-by-Step Guide for a Secure, Self-Hosted RSS Reader. We'll show you how to install FreshRSS with Nginx and SSL from Let's Encrypt for a private, ad-free experience.
What is FreshRSS?
FreshRSS is an open-source, self-hostable RSS and Atom feed aggregator. In simple terms, it's a web-based application that allows us to collect, read, and organize content from all our favorite websites in one centralized, ad-free location.
Think of it as our personal news hub. Instead of visiting dozens of websites every day to check for new articles, FreshRSS fetches the content for us. We just need to add the RSS feed URLs of the sites we follow, and FreshRSS does the rest, pulling in the latest headlines and articles into a clean, easy-to-read interface.
Prerequisites
Before we begin, ensure we have the following:
- An Ubuntu 24.04 on dedicated server or KVM VPS.
- Domain Name point A record to the server IP.
- Basic Linux Command Line Knowledge.
FreshRSS Self-Hosted Guide Ubuntu Nginx & SSL
1. Initial Server Setup and Dependencies
Before we install FreshRSS, we need to set up our server and install the necessary software packages. We'll start with updating our system and installing Nginx, PHP-FPM, and a database server.
Update the System: It's a good practice to ensure our system is up to date.
sudo apt update && sudo apt upgrade -y
Install Nginx: Nginx is a high-performance web server that will serve FreshRSS to our users.
sudo apt install nginx -y
Configure our firewall to allow HTTP and HTTPS traffic:
sudo ufw allow 'Nginx Full'
sudo ufw reload
Install PHP and Required Modules: FreshRSS is a PHP-based application. We'll install PHP 8.3 (the latest version for Ubuntu 24.04) along with the modules it needs to function correctly.
sudo apt install php8.3-fpm php8.3-curl php8.3-xml php8.3-mbstring php8.3-gd php8.3-zip php8.3-mysql -y
Install a Database Server: FreshRSS requires a database to store feeds, articles, and user data. We can use either MySQL/MariaDB or SQLite. For a production server, MariaDB is a solid, performant choice.
sudo apt install mariadb-server -y
2. Install and Configure FreshRSS
With our dependencies in place, we'll download and configure FreshRSS.
Create FreshRSS Directory: We'll create a dedicated directory for our FreshRSS installation in the standard web root location. We'll use /var/www/freshrss
for this guide.
sudo mkdir -p /var/www/freshrss
cd /var/www/freshrss
Download FreshRSS: We'll download the latest stable release from the official GitHub repository. We should always check for the most recent version on the FreshRSS GitHub releases page.
sudo wget https://github.com/FreshRSS/FreshRSS/releases/latest/download/FreshRSS-Portable.tar.gz
Extract and Set Permissions: Now, we'll extract the downloaded archive and set the correct file permissions to allow the web server to access the files.
sudo tar -xzvf FreshRSS-Portable.tar.gz --strip-components=1
sudo chown -R www-data:www-data /var/www/freshrss
sudo chmod -R 755 /var/www/freshrss
The www-data
user is the default user for the Nginx web server on Ubuntu. Setting the ownership and permissions correctly is crucial for security and functionality.
3. Configure the Database
Next, we need to create a database and a user for FreshRSS to use.
Secure MariaDB Installation: Run the security script to remove insecure defaults and set a root password.
sudo mysql_secure_installation
Follow the prompts. It's recommended to set a strong root password and answer "Y" to the rest of the questions.
Create FreshRSS Database and User: Log in to the MariaDB shell and create a new database and user specifically for FreshRSS. Replace freshrss_user
and your_strong_password
with our desired username and password.
sudo mysql -u root -p
Enter the root password we just set. Then, run the following commands in the MariaDB prompt:
CREATE DATABASE freshrss_db;
CREATE USER 'freshrss_user'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON freshrss_db.* TO 'freshrss_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
4. Configure Nginx
This is a critical step where we tell Nginx how to serve our FreshRSS application.
Create Nginx Server Block: We'll create a new configuration file for FreshRSS. Replace yourdomain.com with our actual domain name.
sudo nano /etc/nginx/sites-available/freshrss.conf
Paste the following configuration into the file:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
root /var/www/freshrss/p;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* /data/(.*) {
deny all;
return 404;
}
}
Enable the Server Block: We'll create a symbolic link from the sites-available to the sites-enabled directory.
sudo ln -s /etc/nginx/sites-available/freshrss.conf /etc/nginx/sites-enabled/
Test and Restart Nginx: Always test the Nginx configuration before restarting the service to catch any syntax errors.
sudo nginx -t
sudo systemctl restart nginx
5. Secure with SSL using Certbot
Securing our FreshRSS instance with SSL is a must for protecting our data. We'll use Certbot and Let's Encrypt for this.
Install Certbot:
sudo apt install certbot python3-certbot-nginx -y
Obtain and Install the SSL Certificate: Certbot will automatically handle the certificate issuance and Nginx configuration.
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Follow the interactive prompts. We'll be asked for our email address and to agree to the terms of service. Certbot will then verify our domain ownership and automatically configure our Nginx server block to use HTTPS.
Verify Auto-renewal: Let's Encrypt certificates expire after 90 days. Certbot automatically sets up a timer to renew the certificates. We can test this process with a dry run.
sudo certbot renew --dry-run
If this command runs without errors, our certificates will automatically renew.
6. Complete FreshRSS Installation
Now we can complete the web-based installation.
Access FreshRSS: Open our web browser and navigate to https://yourdomain.com
. The FreshRSS installation wizard will appear.
Follow the Wizard:
Language: Choose our preferred language.
Checks: The wizard will run a series of checks. All should be marked as "OK." If any issues are found, review the previous steps to ensure all dependencies and configurations are correct.
Database Configuration: Select MariaDB/MySQL. Enter the database details we created earlier:
Host: localhost
Database: freshrss_db
User: freshrss_user
Password: your_strong_password
General Configuration: Create our main administrator account and set a strong password.
Once the installation is complete, we'll be redirected to the FreshRSS login page. We can now log in and start adding our favorite RSS feeds.
Congratulations! We have successfully deployed a self-hosted FreshRSS instance on our Ubuntu 24.04 server with a secure Nginx and SSL setup. Enjoy a streamlined, private, and ad-free RSS reading experience.
Checkout our low cost dedicated servers.