How to Install Newspipe on Debian Latest

Newspipe is a feed aggregator designed to be self-hosted on your own server. In this tutorial, you will learn how to install Newspipe on Debian Latest.

Prerequisites

Before getting started, you will need to have the following:

Step 1: Install Required Dependencies

Before installing Newspipe, you will need to install some required dependencies on your server. Open the terminal and run the following command:

sudo apt update
sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx git

This will install pip3 package manager, Python development headers, PostgreSQL and the NGINX web server.

Step 2: Set Up PostgreSQL

Next, you need to create a PostgreSQL database for Newspipe. Run the following commands to create a new database user and database:

sudo -u postgres psql

CREATE DATABASE newspipe;
CREATE USER newspipeuser WITH PASSWORD 'newspipepassword';
GRANT ALL PRIVILEGES ON DATABASE newspipe TO newspipeuser;

Make sure to replace newspipeuser and newspipepassword with your preferred username and password.

Step 3: Install Newspipe

First, clone the Newspipe repository from the Git source. Run the following command in your terminal:

git clone https://git.sr.ht/~cedric/newspipe.git

This will create a newspipe directory in your current working directory.

Next, use pip3 to install the required Python packages:

cd newspipe
sudo pip3 install -r requirements.txt

Step 4: Configure Newspipe

To configure Newspipe, create a new file called config.py in the config directory:

cd config
cp prod.py template.py

Open the template.py file in your preferred text editor and modify the following settings:

DEBUG = False
SECRET_KEY = 'your-secret-key-here'
SQLALCHEMY_DATABASE_URI = 'postgresql://newspipeuser:newspipepassword@localhost/newspipe'

Make sure to replace your-secret-key-here with a strong secret key.

Step 5: Set Up NGINX Reverse Proxy

Next, you need to configure NGINX to act as a reverse proxy and serve Newspipe over HTTPS.

Create a new configuration file for Newspipe:

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

Paste the following configuration into the file:

server {
    listen 80;
    server_name your-domain.com;

    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name your-domain.com;

    ssl_certificate /etc/ssl/certs/your-domain.com.crt;
    ssl_certificate_key /etc/ssl/private/your-domain.com.key;

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:5000;
    }
}

Make sure to replace your-domain.com with your own domain name.

Enable the site with the following command:

sudo ln -s /etc/nginx/sites-available/newspipe /etc/nginx/sites-enabled/

Restart NGINX for the changes to take effect:

sudo systemctl restart nginx

Step 6: Start Newspipe

To start Newspipe, run the following commands:

export FLASK_APP=newspipe
export FLASK_ENV=production
export NEWPIPE_SETTINGS=/path/to/newspipe/config/prod.py
flask db upgrade
flask run --host=127.0.0.1 --port=5000

Make sure to replace /path/to/newspipe/config/prod.py with the absolute path to your prod.py config file.

You should now be able to access Newspipe on your domain name.

Conclusion

Congratulations! You have successfully installed Newspipe on Debian Latest. Newspipe is now ready to use as your own self-hosted feed aggregator.

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!