Notice: I've personally stopped relying on the Nitter instance on fly.io, so this guide won't be updated and support will be best-effort
Notice: Since deploying to fly.io exposes the Nitter instance to the Internet, to prevent malicious scrapers, an nginx instance is in front of the Nitter instance with the following protections:
- All RSS paths are protected with a predefined password as a query parameter, e.g.
nitter.net/elonmusk/rss?key=<PREDEFINED PASSWORD> - All others paths (except for static resources such as js and css, pictures and videos) are protected with HTTP basic authentication, e.g. when someone goes to a link, they need to enter a predefined username/password combo
-
Create a
nitterfolder and create afly.tomlfile inside it. Create an emptyfly.tomlfile and paste contents from this file -
Create a fly.io app (not deployed yet)
cd nitter && flyctl launch --no-deploy
When prompted "Would you like to copy its configuration to the new app?", answer y (yes)
When prompted "Do you want to tweak these settings before proceeding?", answer N (no)
- Customize your Nitter instance In order to customize your Nitter instance, you need to set some environment variables for the fly.io app.
Here is how to set up an environment variable for the fly.io app:
flyctl secrets set --detach <environment variable key>=<environment variable value>
Here is a list of required environment variables for the fly.io app
TWITTER_USERNAMETWITTER_PASSWORDINSTANCE_RSS_PASSWORDINSTANCE_WEB_USERNAMEINSTANCE_WEB_PASSWORD
Consult this table for what each environment variable means and set each one up
For example, to set up TWITTER_USERNAME, you would do
flyctl secrets set --detach TWITTER_USERNAME=<your twitter account username>
The table also contains several customization options such as instance title and instance default theme that you might be interested in.
- Deploy the fly.io app
flyctl deploy
If everything goes well, at the end of the command run, you should see a URL that resembles https://nitter-SOME-RANDOM-WORDS.fly.dev/. This URL will be your personal, password-protected Nitter instance!
You should now be able to
- Access your Nitter instance from
https://YOUR-NITTER-INSTANCE-NAME.fly.devafter you've entered the Web UI username/password combo you entered in step 5 - Access a RSS feed for your Nitter instance such as
https://YOUR-NITTER-INSTANCE-NAME.fly.dev/elonmusk/rss?key=<PASSWORD>, while<PASSWORD>being the RSS password you entered in step 5. You should also be able use this password-suffixed RSS feed in RSS readers or any applications that handle RSS feeds.