How to Install Selfoss on Debian

Selfoss is a free and open source web application that allows users to easily read and follow RSS feeds. In this tutorial, we will guide you through the process of installing Selfoss on Debian.

Prerequisites

Before you start, make sure your system meets the following prerequisites:

Step 1: Install Required Packages

The first step is to install required packages on your Debian system. You can install all the required packages by running the following commands:

sudo apt update
sudo apt install curl unzip apache2 libapache2-mod-php7.4 php7.4-curl php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-xml

Step 2: Download Selfoss

Once you have installed all required packages, the next step is to download Selfoss. You can download the latest version of Selfoss from the official website using the following command:

sudo curl -o selfoss.zip https://selfoss.aditu.de/selfoss.zip

After downloading the zip file, extract it using the following command:

sudo unzip selfoss.zip -d /var/www/html/selfoss

This command will extract the Selfoss files into the /var/www/html/selfoss directory.

Step 3: Configure Apache or Nginx

The next step is to configure your web server to serve Selfoss. If you are using Apache, you can create a new virtual host file /etc/apache2/sites-available/selfoss.conf:

sudo nano /etc/apache2/sites-available/selfoss.conf

Add the following configuration to your virtual host file:

<VirtualHost *:80>
    ServerName selfoss.example.com
    DocumentRoot /var/www/html/selfoss/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/selfoss/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Replace ServerName with your domain or IP address. Then save and close the file.

If you are using Nginx, you can create a new virtual host file /etc/nginx/sites-available/selfoss:

sudo nano /etc/nginx/sites-available/selfoss

Add the following configuration to your virtual host file:

server {
    listen 80;
    server_name selfoss.example.com;
    root /var/www/html/selfoss;

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}

Replace server_name with your domain or IP address. Then save and close the file.

After creating the virtual host file, enable it by running the following command:

sudo a2ensite selfoss.conf        # For Apache
sudo ln -s /etc/nginx/sites-available/selfoss /etc/nginx/sites-enabled/   # For Nginx

Then reload your web server:

sudo systemctl reload apache2     # For Apache
sudo systemctl reload nginx      # For Nginx

Step 4: Configure Selfoss

Before you can access Selfoss, you need to configure the application by creating a new configuration file config.ini inside the data directory:

sudo cp /var/www/html/selfoss/data/config.ini.example /var/www/html/selfoss/data/config.ini
sudo nano /var/www/html/selfoss/data/config.ini

Edit the configuration file and set the database connection parameters:

[database]
type = "mysql"
host = "localhost"
port = "3306"
database = "selfoss"
username = "selfoss"
password = "YOUR_PASSWORD"

Make sure to replace YOUR_PASSWORD with a strong password.

Then save and close the file.

Step 5: Create Database and User

The next step is to create a new database and user for Selfoss. You can create a new database and user by running the following commands:

sudo mysql -u root -p

Enter your MySQL root password when prompted.

CREATE DATABASE selfoss;
CREATE USER 'selfoss'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';
GRANT ALL PRIVILEGES ON selfoss.* TO 'selfoss'@'localhost';
FLUSH PRIVILEGES;
exit;

Again, replace YOUR_PASSWORD with a strong password.

Step 6: Access Selfoss

You can now access Selfoss by pointing your web browser to the domain or IP address of your server. If you followed our Apache configuration, you can access Selfoss using the URL http://selfoss.example.com or if you followed our Nginx configuration, you can access Selfoss using the URL http://selfoss.example.com.

Conclusion

In this tutorial, you have learned how to install Selfoss on Debian, configure Apache or Nginx, and create a new database and user for Selfoss. You can now start adding RSS feeds and enjoy reading your favorite websites in one place.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!