How to Create Your Own Reddit With Teddit

Install Teddit Linux 00 Featured Image

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.

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
Install Teddit Linux 05 Install Dependencies
  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
Install Teddit Linux 06 Clone Repositories
  1. Use the npm utility to install the program’s binaries to your system:
npm install --no-optional
Install Teddit Linux 07 Install Nodejs Binaries
  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
Install Teddit Linux 08 Test Run Teddit

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
Install Teddit Linux 09 Create Firewall Rules
  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.
Install Teddit Linux 12 Reddit Api Prefs
  1. Click the “Create an App…” button on the page’s upper-left corner.
Install Teddit Linux 13 Create New App
  1. Provide the name for the API key that you want to make.
Install Teddit Linux 14 App Name Sample
  1. Select the “Application Type” for your API key by clicking the “installed app” radio button.
Install Teddit Linux 15 Select Installed App Option
  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.
Install Teddit Linux 16 Uri Sample
  1. Click the “create app” button to generate the API key for your instance.
Install Teddit Linux 17 Finalize New App Button
  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.
Install Teddit Linux 18 Copy App Id
  1. Back to your server, open the Teddit’s “config.js” file and find the “reddit_app_id” value.
Install Teddit Linux 19 Find App Id Option
  1. Paste and replace the current value of this variable with your Reddit’s API key.
Install Teddit Linux 20 Paste App Id New

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

Ramces Red
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.