Setting Up Nitter

14 October, 2022 | keystroke

Update 03/03/2024

Nitter has basically finally been killed by Twitter with the removal of its temporary mobile accounts that could be used to generate a month of anonymous access. There may be a solution to use your own personal account to get access, however users have reported that Twitter API limits them fairly quickly and so I am finally completely jumping ship from Twitter after all of this.

Good luck if you do try to find a way to get it working in the above thread but this is where I get off.


For quite a while now (since Tumblr made certain changes) I’ve been bemoaning the Twitter timeline and how they just seem to make it worse. Tweets not in chronological order, random suggestions for follows, likes and topics, and just weird loading fuckery meaning I see the same tweets multiple times. I’ve endlessly wished they would just show tweets from users I follow, in the order they twit.

I’ve made attempts around this before, mostly by using uBlockOrigin filters. As they remove elements it can fuck with the progressive loading Twitter does, but I still found it better than dealing with the algorithm so I shall include my filter below. It should work with any filter using the EasyList filter syntax (uBlock, ABP, etc.).

! https://twitter.com
		twitter.com##a[data-testid="AppTabBar_Explore_Link"]
		twitter.com##[aria-label="Timeline: Trending now"]:xpath(../../..)
		twitter.com##[aria-label="Who to follow"]:xpath(..)
		twitter.com##[aria-label="Recommended Topic: *"]:xpath(../../../../../../../../../../../../../../../..)
		twitter.com##.r-q3we1 a:has-text(/ liked$/):xpath(../../../../../../../../../../../../../../../..)
		twitter.com##.r-q3we1 a:has-text(/ follows$/):xpath(../../../../../../../../../../../../../../../..)
		twitter.com##.r-q3we1 a:has-text(/ follow$/):xpath(../../../../../../../../../../../../../../../..)
		

Trying out Nitter had been on my todo list for a bit, but what galvanised me into finally getting around to installing it was learning of its RSS feed support. While when they hopefully add following accounts to view them in an actual clean, chronological feed will probably be the best experience, I wanted to try catching up on updates through RSS as I have been with Tumblr for a while now.

To not further overload the poor nitter.net servers I decided to self-host, and since there is no packages due to the developmental nature of the software, it means compiling and configuring everything manually. Thankfully the instructions on GitHub are fairly good, though my setup differs in places.

While I am installing this locally, there is also a Docker image for those less-inclined to my more convoluted way of thinking.

Tutorial

To start, I made sure I had the dependencies (Using Ubuntu 22.04.1 LTS):

sudo apt install libsass-dev redis-server
		

One of the areas I differed from the documentation was installing my Nitter instance to /opt/nitter, as opposed to ~/nitter so it would be alongside my other websites. I also wanted to keep it as self-contained as possible instead of spreading it over the system, so Redis and LibSass were the only global installs I did, and neither require configuration to work for Nitter.

With the dependencies, I created a nitter user to keep permissions under control and set up the directory. While I have it in /opt it can be put wherever due to the self-contained nature of this installation.

sudo useradd --system nitter --user-group
		sudo mkdir /opt/nitter
		sudo chown nitter:nitter /opt/nitter
		cd /opt/nitter
		sudo su nitter
		

Nitter does need a Nim install to build, so I downloaded the Linux x64 binary and extracted it into its own subfolder. Since I didn’t want to add it permanently to $PATH (only needs to be built once) I first tried using the --nim flag to point to the binary. This, however, seems to break when compiling some steps, so the more reliable way was to temporarily export it to $PATH.

wget https://nim-lang.org/download/nim-1.6.12-linux_x64.tar.xz
		tar -xf nim-1.6.12-linux_x64.tar.xz
		mv nim-1.6.12 nim
		export PATH=$PATH:/opt/nitter/nim/bin
		

Now we can actually download and build Nitter!

git clone https://github.com/zedeus/nitter
		cd nitter
		nimble build -d:release
		nimble scss
		nimble md
		cp nitter.example.conf nitter.conf
		

Almost at the point where we can at least try and test it, we just need to set up the config file. It’s recommended to keep Nitter behind an Nginx proxy, so most of the settings can stay the way they are. The ones to update are:

If you just installed Redis it should all work with the default config. From here we just run Redis and Nitter.

redis-server --daemonize yes
		./nitter
		

Go to your server IP and port and check if it’s running! If yes, you can shut down Redis and Nitter, and exit the nitter user shell.

From here I set it up to run as a service using the systemd configuration provided in the README. Remember to change the WorkingDirectory and ExecStart to your installed location!

sudo nano /etc/systemd/system/nitter.service
		sudo systemctl enable --now redis-server.service
		sudo systemctl enable --now nitter.service
		

HTTPS

If you don’t mind having it running on a local network over HTTP then that’s all you need to do, plus maybe tweaking the config to your liking. However if you want to expose it to the wider internet, I would highly recommend SSL to the point of being mandatory. Wanting to run this through a personal domain, I went a bit further.

Thankfully with Nginx, setting up a reverse proxy is fairly simple. Point a domain at your IP and create an Nginx config from the example configuration provided from the Nitter documentation, making sure to fill in all your details (mainly domain name and Nitter port). If you already have Certbot set up, then just run it and make sure the Nginx config ssl_certificate criteria are all correct and voila!

sudo nano /etc/nginx/sites-available/nitter
		sudo ln -s /etc/nginx/sites-available/nitter /etc/nginx/sites-enabled/nitter
		sudo nginx -t  # Check if successful
		sudo systemctl restart nginx
		sudo certbot
		

Uninstallation

One of the reasons I have Nitter set up so isolated is for ease of both updating (basically just git cloning and building it again), and uninstalling. To uninstall Nitter I just have to undo all the steps thus far, basically:

sudo systemctl disable --now redis-server.service
		sudo systemctl disable --now nitter.service
		sudo rm /etc/systemd/system/nitter.service
		sudo certbot delete
		sudo rm /etc/nginx/sites-available/nitter /etc/nginx/sites-enabled/nitter
		sudo rm -r /opt/nitter
		sudo userdel nitter
		sudo apt remove libsass-dev redis-server
		sudo systemctl restart nginx
		

Yes, this is also so if I decide to change my mind in the future I can just come back and read this instead of busying myself with the hard task of “remembering”, thank you.

Conclusion

After all this, I finally set up my little RSS feeds in Thunderbird with a separate feed for each using the feed urls https://[hostname]/[username]/rss, and just needed to create a rule to delete any posts with “RT by “ in the subject. A couple of days in and I’m already finding this pretty usable over Twitter itself. Though I am still excited should Nitter add a proper unified feed, this is a step up in the meantime.

I have also combined this with the Alter Firefox plugin which allows me to redirect Twitter links to my Nitter instance, though there is a list of alternate extensions.


If you want to leave a comment or share your thoughts, consider emailing me!