An anti-capitalist ad-blocker that uses the hosts file
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Twann 72871c8d43
fixed email in readme
3 weeks ago
.gitea updated pr template 1 month ago
assets added patch to package binary for ubuntu 1 month ago
debian fixed debian control 1 month ago
docs patched help page and improved examples 4 months ago
scripts updated gitlab CI 1 month ago
tblock fixed pipeline and tests 1 month ago
test added gitlab CI configuration 2 months ago
.bandit.yml multiple changes 1 month ago
.drone.yml updated .drone.yml 1 month ago
.gitignore updated .gitignore and 4 months ago
.gitlab-ci.yml updated .gitlab-ci.yml 1 month ago
AUTHORS Added python code, Makefile and devscripts 5 months ago added 3 months ago release 1.3.2 2 months ago updated documentation 2 months ago
LICENSE Added python code, Makefile and devscripts 5 months ago renamed CHANGELOG to 5 months ago
Makefile multiple changes 1 month ago fixed email in readme 3 weeks ago changes in documentation 2 months ago moved to repo root 4 months ago
requirements.txt security fixes 2 months ago
setup.cfg edited documentation and added devscripts to build source RPM package 4 months ago changed 'anticapitalist' to 'anti-capitalist' 2 months ago
tblock.spec modified Makefile 2 months ago

TBlock Logo

Copr build status GitLab CI PyPI Version PyPI Downloads License AUR Votes Remote repository filters count Syntax supported count Mastodon Follow



TBlock is a free and open-source ad-blocker, written in Python. It uses the hosts file to block advertising and tracking domains, which means it protects your whole system against these domains. TBlock is compatible with most of filter formats, and also has a built-in filter converter, to help you share your custom filters with people that are using different ad-blockers.


  • Free and open-source software
  • Easy to install
  • Does not cost any money
  • Does not track your personal data
  • Does not make you fingerprintable, unlike some ad-blocking browser extensions
  • Fast rules parsing
  • Blocks ads for your whole operating system
  • Compatible with most filter formats
  • Has an online filter repository to help you find and subscribe to filters in an easier way
  • Has a built-in filter converter


There are various methods to install TBlock. You need to install TBlock as root, since superuser privileges are required to edit the hosts file.

With python

This is the fastest and easiest way to install TBlock on your machine. Simply run the following command:

$ sudo pip install tblock

Other installation methods

More installation methods can be found on our website:

More installation methods


To build TBlock manually, see


After the installation and after each update of TBlock, you should update your local version of the remote filter repository and subscribe to a blocking filter, by running:

$ sudo tblock -Sy tblock-base


Blocking a domain with TBlock

To show the help page of TBlock, simply run:

$ tblock -h

To show the help page of the built-in converter, simply run:

$ tblockc -h

You can find more help about usage on TBlock's wiki.


If you found an issue or that you want to request a new feature, you have multiple options (because we don't want to force our users to join Codeberg to contribute to the project):


TBlock, its converter and its logo are released under GPLv3.

Libraries used

TBlock uses the external libraries:

Name Author License Homepage
colorama Jonathan Hartley BSD
requests Kenneth Reitz Apache 2.0
urllib3 Andrey Petrov MIT
defusedxml Christian Hiemes PSFL