Important
This is a fork of redlib-org/redlib, built on Nachtalb/redlib. It ships multi-arch images for amd64, 386, arm64, arm/v7, arm/v6, riscv64 and mips64le, and includes many features and fixes from unmerged upstream pull requests plus its own.
Tip
Run this fork's image, ghcr.io/project516/redlib:latest, rather than upstream's quay.io/redlib/redlib.
Warning
If Reddit blocks your instance's requests, set a session in REDLIB_REDDIT_COOKIE (setup).
10-second pitch: Redlib is a private front-end like Invidious but for Reddit. Browse the coldest takes of r/unpopularopinion without being tracked.
- π Fast: written in Rust for blazing-fast speeds and memory safety
- βοΈ Light: no JavaScript, no ads, no tracking, no bloat
- π΅ Private: all requests are proxied through the server, including media
- π Secure: strong Content Security Policy prevents browser requests to Reddit
Tip
π Want to automatically redirect Reddit links to Redlib? Use LibRedirect or Privacy Redirect!
An up-to-date table of instances is available in Markdown and machine-readable JSON.
Both files are part of the redlib-instances repository. To contribute your self-hosted instance to the list, see the redlib-instances README.
This section outlines how Redlib compares to Reddit in terms of speed and privacy.
PageSpeed Insights results from January 12, 2024
β οΈ Warning: these numbers are outdated. Current instances may vary, as they adjust automatically to Reddit's blocking efforts.
Results from Google PageSpeed Insights (Redlib Report, Reddit Report).
| Performance metric | Redlib | |
|---|---|---|
| Speed Index | 0.6s | 1.9s |
| Performance Score | 100% | 64% |
| Time to Interactive | 2.8s | 12.4s |
What each side collects about you, according to Reddit's privacy policy and cookie notice, and Redlib's code.
| Redlib | ||
|---|---|---|
| Logging | ||
| IP address | π± | |
| User-agent string | π± | |
| Browser type | π± | |
| Operating system | π± | |
| Referral URLs | π± | |
| Device information (e.g. device IDs) | π± | |
| Device settings | π± | |
| Pages visited | π± | |
| Links clicked | π± | |
| The requested URL | π± | |
| Search terms | π± | |
| Location | ||
| GPS (consensual) | π± | |
| Bluetooth (consensual) | π± | |
| Content associated with a location (consensual) | π± | |
| Your IP address | π± | |
| Cookies | ||
| Authentication | π± | |
| Functionality | π± | π your settings, nothing personal |
| Analytics and performance | π± | |
| Advertising | π± | |
| Third-party cookies | π± | |
| Third-party sites | π± |
Redlib's server logs nothing about visitors in release builds (the binary, Docker images and public instances). Debug builds (cargo run without --release) log fetched post IDs to help with troubleshooting. Its cookies are not cross-site and only hold the settings you chose.
This section covers multiple ways of deploying Redlib. Using Docker is recommended for production.
For configuration options, see CONFIGURATION.md.
Images are on ghcr.io for amd64, 386, arm64, arm/v7, arm/v6, riscv64 and mips64le, with these tags:
latest: the newest commit onmaster, or the newest release if one came after it.<version>, like2026.1102.1: one release; it never changes.dev: the newest commit onmaster, between releases.sha-<commit>: one commit onmaster; it never changes.
For amd64 and arm64 every tag also has a -mimalloc variant (latest-mimalloc, β¦), built with the mimalloc allocator: faster under load, but it holds more memory afterwards.
Docker Compose
Copy compose.yaml and .env.example (as .env), and adjust them, for example the port.
docker compose up -d # start Redlib in the background
docker logs -f redlib # follow its logsDocker CLI
docker run -d --name redlib -p 8080:8080 ghcr.io/project516/redlib:latest # listen on port 8080
docker run -d --name redlib -p 127.0.0.1:8080:8080 ghcr.io/project516/redlib:latest # behind a reverse proxy: local only
docker run -d --name redlib -p 8080:8080 --env-file .env ghcr.io/project516/redlib:latest # with settings from .env
docker logs -f redlib # follow its logsPodman (Quadlets)
β Important: This assumes a systemd-based distro with Podman, and
loginctl enable-linger <username>so the service starts without you logging in.
Copy redlib.container and .env.example (as .env) to ~/.config/containers/systemd/ and adjust them, then reboot or:
systemctl --user daemon-reload # pick up the new files
systemctl --user start redlib.service # start Redlib
systemctl --user status redlib.service # check on itBinary
Grab a binary from the latest release. Every release has static Linux builds for x86_64, i686, aarch64, armv7, arm (v6), riscv64 and mips64el, plus macOS, Windows and Android builds that this fork doesn't test, and SHA256SUMS. redlib-x86_64-unknown-linux-musl-mimalloc and redlib-aarch64-unknown-linux-musl-mimalloc are the mimalloc builds from the -mimalloc images.
curl -fL -o redlib https://github.com/Project516/redlib/releases/latest/download/redlib-x86_64-unknown-linux-musl # pick your architecture
sudo chmod +x redlib && sudo chown root:root redlib # make it executable, owned by root
sudo cp ./redlib /usr/bin/redlib # install it
redlib # listen on 0.0.0.0:8080β Important: If you're proxying Redlib through NGINX (see issue #122), add
proxy_http_version 1.1;above yourproxy_passline.
You can use the systemd service available in contrib/redlib.service
(install it on /etc/systemd/system/redlib.service).
That service can be optionally configured in terms of environment variables by
creating a file in /etc/redlib.conf. Use the contrib/redlib.conf as a
template. You can also add any of the settings in
CONFIGURATION.md.
When "Proxying using NGINX" where the proxy is on the same machine, you should
guarantee nginx waits for this service to start. Edit
/etc/systemd/system/redlib.service.d/reverse-proxy.conf:
[Unit]
Before=nginx.serviceReplit/Heroku
β οΈ Warning: These are free hosting options, but they are not private and will monitor server usage to prevent abuse. If you need a free and easy setup, this method may work best for you.
launchd (macOS)
If you are on macOS, you can use the launchd service available in contrib/redlib.plist.
Install it with cp contrib/redlib.plist ~/Library/LaunchAgents/.
Load and start it with launchctl load ~/Library/LaunchAgents/redlib.plist.
Cloudflare WAF rule
Behind Cloudflare, a custom WAF rule with the action Managed Challenge keeps bots and scrapers off your instance, so they don't burn through its Reddit quota. Visitors solve the challenge once and keep the cf_clearance cookie; static files, the health badge, /info.json and an optional status probe with a secret header pass without one. This is the rule r.naa.gg uses, with your host and a random secret filled in:
(http.request.full_uri wildcard r"https://redlib.example.com/*"
and not http.cookie contains "cf_clearance"
and not ends_with(http.request.uri.path, ".css")
and not ends_with(http.request.uri.path, ".js")
and not ends_with(http.request.uri.path, "touch-icon-iphone.png")
and not ends_with(http.request.uri.path, "favicon.ico")
and not ends_with(http.request.uri.path, ".woff2")
and not ends_with(http.request.uri.path, "manifest.json")
and http.request.uri.path ne "/healthz/reddit.json"
and http.request.uri.path ne "/info.json"
and not (http.request.uri.path in {"/settings" "/healthz/reddit"}
and http.request.headers["x-status-probe"][0] eq "<random secret>"))
Paste it under Security β WAF β Custom rules β Edit expression. Leave out the last condition if you don't run a status page.
Redlib is configured with environment variables, a redlib.toml file or command-line flags. All settings, the Reddit session, the backend order and proxies are described in CONFIGURATION.md.
git clone https://github.com/Project516/redlib && cd redlib
cargo build --release # the binary ends up in target/release/redlib
cargo build --release --features mimalloc # optional: mimalloc allocator, faster under load, holds more memoryA build from a git checkout reports its version as dev-<commit>; with REDLIB_RELEASE=1 set during the build it reports the version in Cargo.toml, like the release builds. A build from a release's source archive, which has no git information, reports the release version on its own.
Redlib talks to Reddit through wreq, which uses BoringSSL with wreq's patches (via the btls-sys crate) so its TLS handshake looks like a real browser's. The BoringSSL source ships with the crate and is patched and compiled during the build, so you need git, cmake, a C/C++ compiler and libclang (for bindgen). Certificates are checked against Mozilla's trust store compiled into the binary.
On Debian/Ubuntu:
sudo apt install build-essential git cmake libclang-devOn Windows (not tested by this fork), install MSVC, which you likely already have for Rust, then:
# Update your PATH afterwards; some installers don't (hence -i, interactive mode).
winget install -i Kitware.CMake
winget install -i NASM.NASM
winget install -i LLVM.LLVMFor maintainers. Run Actions β Release β Run workflow on master. It picks the next version YYYY.MDD.N (like 2026.1102.1), commits and tags it on master, builds the images and binaries, and publishes the GitHub release with generated notes. If it fails after the commit, use Re-run failed jobs: a new run makes a new version. If the commit landed but the tag didn't, the next run tags that commit instead of making another.
- Label pull requests that make users change something (settings, defaults, endpoints, the image, binary names)
breaking; the notes list those first. - The
build-imagelabel gets a pull request apr-<number>test image of its current commit. Read the changes first, and re-add the label after new commits. - One-time setup: a GitHub App with Contents read and write, installed on this repository and allowed past the rule protecting
master, with its client ID and private key in the secretsRELEASE_APP_CLIENT_IDandRELEASE_APP_PRIVATE_KEY.
