This terraform setup creates a nitter deployment on a simple EC2 instance behind a network load balancer.
┌────────────────────┐
│ network load │
│ balancer (FQDN)│
└─────────┬──────────┘
│port 8080
┌─────────▼──────────┐
│ autoscaling group │
│ ┌──────────────┐ │
│ │ EC2 Instance │ │
│ │ │ │
│ │ "nitter" │ │
│ └──────────────┘ │
│ │
└────────────────────┘
You can configure the instance type and the username later needed to access the nitter instance.
See variables.tf
.
The following is copied from sekai-soft/guide-nitter-self-hosting:
-
Create a throw away twitter account (here) without MFA enabled.
-
After that you will need actual nitter auth. In this directory execute:
git clone --depth 1 https://github.com/sekai-soft/guide-nitter-self-hosting cd guide-nitter-self-hosting docker compose run --build nitter-auth
-
Execute the last "echo" line as advised. The authentication will be read by the terraform setup.
-
To set variables create
variables.auto.tfvars
. -
Do the usual
terraform init
andterraform apply
you will get the following output:
basic-auth-password = "some-basic-authpassword"
basic-auth-username = "nitter"
lib-redirect-twitter-url = <<EOT
USAGE WITH LIB-REDIRECT CHROME EXTENSION:
-----------------------------------------
Install https://libredirect.github.io/download.html
Open the options of the extension and select "Twitter" on the left side.
Click on the input field under "Add own instance" and enter:
http://nitter:some-basic-authpassword@nitter-123456789.elb.eu-central-1.amazonaws.com:8080
EOT
You can now access your private nitter instance as http://nitter:some-basic-authpassword@nitter-123456789.elb.eu-central-1.amazonaws.com:8080