How to Create Your Own Reddit With Teddit

Spread the love

Teddit is a privacy-respecting frontend alternative to Reddit. Unlike the regular website, it creates an interface without JavaScript and does not track and log every link and page you visit. Here we show you how to install Teddit on your Linux server.

Content

Installing Teddit

This tutorial shows you how to install Teddit on Ubuntu. We are using the domain “yetanotherteddit.xyz,” though you can use your own domain name or the localhost.

  1. Open a terminal and run the following command to install all the necessary tools and programs for Teddit:
sudo apt install nodejs redis-server ffmpeg git iptables-persistent nginx npm certbot python3-certbot-nginx

  1. Copy the Teddit repository from the developer’s Codeberg page by running the following command:
git clone https://codeberg.org/teddit/teddit
cd teddit

  1. Use the npm utility to install the program’s binaries to your system:
npm install --no-optional

  1. Copy the configuration template to the root directory of your Teddit repository:
cp config.js.template config.js
  1. Run the following command to test whether the Teddit binary is running properly in your system:
npm start

Setting Up the Web Server

With Teddit installed, you need to set up the web server so that it can be accessed from the browser. This section focuses on securing your server using Nginx.

  1. Make sure your firewall is only accepting incoming connections on ports 22, 80 and 443:
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
sudo netfilter-persistent save

  1. Create the Nginx configuration file for your Teddit server:
sudo nano /etc/nginx/sites-available/teddit
  1. Insert a new server{} block inside the “teddit” configuration file. For example, the following should create a simple reverse proxy out of the box:
server {
       listen 80;
       listen [::]:80;
 
       root /var/www/html;
 
       server_name yetanotherteddit.xyz www.yetanotherteddit.xyz;
 
       location / {
                  proxy_pass http://127.0.0.1:8080;
       }
}
  1. Enable the new configuration.
sudo ln -s /etc/nginx/sites-available/teddit /etc/nginx/sites-enabled/
  1. Restart the Nginx daemon to reload all of your new settings.
sudo systemctl reload nginx

With Nginx properly running, you can also easily enable SSL for your webserver. Doing this will ensure that every incoming connection to your Teddit instance is secure:

certbot --nginx yetanotherteddit.xyz

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

Tip: Reddiquette: learn what you should/shouldn’t do in Reddit.

Creating a Reddit API Key for Teddit

You need a Reddit API key for your Teddit instance to access Reddit’s servers.

  1. Log in to your Reddit account and open the Application Preferences page.

  1. Click the “Create an App…” button on the page’s upper-left corner.

  1. Provide the name for the API key that you want to make.

  1. Select the “Application Type” for your API key by clicking the “installed app” radio button.

  1. Write the current URL of your instance in the “about url” box. You also need to write “http://localhost:8080” in the “redirect url” box.

  1. Click the “create app” button to generate the API key for your instance.

  1. The web page will display a small box where all the details of your new API key will be printed. Copy the string underneath the name of your new app.

  1. Back to your server, open the Teddit’s “config.js” file and find the “reddit_app_id” value.

  1. Paste and replace the current value of this variable with your Reddit’s API key.

Tip: Teddit can’t download Reddit’s videos for you. Find out how to do it here.

Frequently Asked Questions

Is it possible to log in to my Reddit account in Teddit?

No. Teddit is a view-only version of Reddit, so you can’t log in to Reddit here. Similar to Reddit’s “no participation” mode, you cannot comment and upvote any posts in Teddit either.

I cannot see beyond the first page of a subreddit.

This issue is most likely due to a missing Reddit API key. To fix this, you need to double-check that you have properly copied the App ID value from Reddit to your config.js file.

You can also temporarily fix this by disabling the API support in Teddit. You can do this by changing the “use_reddit_oauth” value to false.

Is it possible to automate the Teddit startup process?

You can easily automate the Teddit startup process by using pm2. This is a process manager for NodeJS applications that is simple to install and use.

To use this with Teddit, you need to run the following command: npm install pm2 -g && pm2 start app.js.

Image credit: Unsplash. All alterations and screenshots by Ramces Red.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time. Subscribe


Ramces Red
Staff Writer

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

Comments are closed