A command-line productivity blocker for Linux, backed by a systemd service.
Open Turkey is an open-source, Linux-native alternative to Cold Turkey: it blocks distracting websites and applications and keeps them blocked, even against your own attempts to undo it on impulse. Where Cold Turkey is paid and centered on Windows/macOS, Open Turkey is free, built in Go, and designed around the way Linux actually enforces policy.
It organizes blocking into blocks — named groups of:
- Sites (domains, e.g.
youtube.com) - Apps (process names, e.g.
discord,telegram-desktop)
When you activate a block, a daemon continuously ensures the blocking layers stay applied.
Open Turkey doesn't rely on a single, easily-bypassed mechanism. Each active block is enforced on four independent layers, and a systemd daemon re-applies them every 5 seconds if anything is tampered with:
/etc/hosts— resolves blocked domains to0.0.0.0(affects every program, not just browsers).- Firewall (iptables) — blocks network connections to the blocked sites.
- Browser enterprise policies — managed
URLBlocklist/WebsiteFilterpolicies for Firefox, Chromium, Google Chrome and Brave. The user cannot disable these from inside the browser, not even in private/incognito mode. - Process kill — terminates blocked apps that are running (SIGKILL).
Because the hosts and firewall layers act below the browser, blocking works even for browsers installed via Snap or Flatpak (where the system-wide browser policy file may not be read).
Prerequisites:
- Linux with
systemd iptablesavailable- Go (to build), at
/usr/local/go/binor otherwise on yourPATH
Recommended:
sudo ./install.shThis:
- compiles the binary (
CGO_ENABLED=0, pure-Go SQLite viamodernc.org/sqlite) - installs
open-turkey(a wrapper) andopen-turkey-bin(the real binary) into/usr/local/bin - adds a rule in
/etc/sudoers.d/open-turkeyso it runs without a password prompt - installs and starts the
systemdserviceopen-turkey.service - creates the database at
/var/lib/open-turkey/open-turkey.db
The installed program is independent of the source directory — once installed, you can remove the project folder and it keeps working.
- Block: a set of sites/apps you want to block together.
- Active: a block that is currently in effect (the system is enforcing it).
- Lock (
--lock): when enabled, prevents deactivation viastop. The only way to deactivate a locked block isunlock, which requires completing a typing challenge — deliberate friction to outlast an impulse.
open-turkey block create social-media
open-turkey block add-site social-media instagram.com x.com facebook.com
open-turkey block add-app social-media discord telegramShow details:
open-turkey block info social-mediaList all blocks:
open-turkey block listActivate:
open-turkey start social-mediaActivate with a lock:
open-turkey start social-media --lockShow status:
open-turkey statusDeactivate (only if not locked):
open-turkey stop social-mediaUnlock a locked block (this also deactivates it):
open-turkey unlock social-mediaRemove a domain from a block:
open-turkey block remove-site social-media instagram.comNotes:
- If the block is active, Open Turkey re-applies the layers so the change takes effect immediately.
- If the block is active and locked, you cannot edit its sites/apps. Run
open-turkey unlock <block>first (which deactivates it), make your changes, then activate again.
Remove an app (process) from a block:
open-turkey block remove-app social-media discordRemove an entire block (must be inactive):
open-turkey block remove social-mediaThe daemon is managed by systemd:
systemctl status open-turkey
systemctl restart open-turkey
journalctl -u open-turkey -fsudo make uninstallMIT — see LICENSE.