Description
docker-fail2ban is a Docker image that runs Fail2ban, a tool that bans hosts after repeated failed logins. The image is published on Docker Hub as crazymax/fail2ban and on the GitHub Container Registry as ghcr.io/crazy-max/fail2ban, with Alpine-based and Debian-based tags. Its main setup is a Docker Compose file, with examples in the repository for running it alongside your services. The README explains how to set the timezone, log target and log level, how long bans are kept in the database before they are purged, and whether iptables should run in auto, nft or legacy mode. Custom jails, actions and filters are kept in a /data volume together with the Fail2ban database. The guide also covers the DOCKER-USER chain, jail examples, using fail2ban-client, global jail configuration, GeoIP2 lookups, sending email through a sidecar container, and the systemd journal backend. The image can be built locally from the repository. The code is public on GitHub.…
Highlights
- Fail2ban in a Docker image, Alpine or Debian based
- Docker Compose setup with examples
- Custom jails, actions and filters in /data
- Choice of iptables mode: auto, nft or legacy
- Notes on DOCKER-USER and systemd journal logging
Ratings & Reviews
No ratings yet
Be the first to rate Docker Fail2ban.
People also visit
Fail2Ban-Report
Web-based dashboard for Fail2Ban log filtering and blocklist control
Ufw Docker Automated
Manage UFW (Uncomplicated Firewall) rules for Docker containers
Docker Nginx FPM Alpine
PrivateBin docker image based on Nginx, php-fpm & Alpine Linux stack
Docker Fail2ban FAQ
What is docker-fail2ban?
It is a Docker image of Fail2ban, a service that watches logs and bans hosts that cause repeated authentication failures.
Where is the image published?
The README lists Docker Hub as crazymax/fail2ban and the GitHub Container Registry as ghcr.io/crazy-max/fail2ban. Tags include latest, edge, and Debian variants.
How do I run it?
Docker Compose is the recommended route, and the repository has examples in the examples/compose folder. You can also start it from the command line.
Which settings can I change?
The README lists the timezone, log target, log level, how long bans stay in the database, and the iptables mode, each set with an environment variable.
Can I use my own rules?
Yes. Custom jails, actions and filters go into the /data volume alongside the Fail2ban database. The README also covers global jail configuration and GeoIP2.
What are the best Docker Fail2ban alternatives?
Popular alternatives to Docker Fail2ban include Fail2ban, Fail2Ban-Report and Ufw Docker Automated. See all Docker Fail2ban alternatives