专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

swissmakers/fail2ban-ui Docker 镜像 - 轩辕镜像 | Docker 镜像高效稳定拉取服务

热门搜索:openclaw🔥nginx🔥redis🔥mysqlopenjdkcursorweb2apimemgraphzabbixetcdubuntucorednsjdk
fail2ban-ui
swissmakers/fail2ban-ui
swissmakers
A Go-based, management interface for Fail2Ban.
1 次收藏下载次数: 0状态:社区镜像维护者:swissmakers仓库类型:镜像最近更新:14 小时前
使用轩辕镜像,把时间还给真正重要的事。点击查看
镜像简介版本下载
使用轩辕镜像,把时间还给真正重要的事。点击查看

Fail2Ban UI Container Deployment Guide

A guide for deploying Fail2Ban UI using Docker/Podman.

Table of Contents

  • Quick Start
  • Running the Container
  • Volume Mounts
  • Configuration
  • Docker Compose
  • SELinux Configuration
  • Troubleshooting

Quick Start

Using Pre-built Image

Pull the official image with podman from Docker Hub (default):

bash
podman pull swissmakers/fail2ban-ui:latest
# or with Docker:
docker pull swissmakers/fail2ban-ui:latest

Alternative: Pull from Swissmakers registry (fallback):

bash
podman pull registry.swissmakers.ch/infra/fail2ban-ui:latest
docker pull registry.swissmakers.ch/infra/fail2ban-ui:latest

Running the Container

Basic Run Command (for a local fail2ban connection - fail2ban on host)
bash
podman run -d \
  --name fail2ban-ui \
  --network=host \
  -v /opt/podman-fail2ban-ui:/config:Z \
  -v /etc/fail2ban:/etc/fail2ban:Z \
  -v /var/log:/var/log:ro \
  -v /var/run/fail2ban:/var/run/fail2ban \
  swissmakers/fail2ban-ui:latest
Custom Port Configuration and using only remote fail2ban (over ssh)

You can change the default port (8080) using the PORT environment variable:

bash
podman run -d \
  --name fail2ban-ui \
  --network=host \
  -e PORT=8436 \
  -v /opt/podman-fail2ban-ui:/config:Z \
  swissmakers/fail2ban-ui:latest

Access the web interface at http://localhost:8436.

Container Management

Start the container:

bash
podman start fail2ban-ui

Stop the container:

bash
podman stop fail2ban-ui

View logs:

bash
podman logs -f fail2ban-ui

Remove the container:

bash
podman stop fail2ban-ui
podman rm fail2ban-ui

Execute commands inside the container:

bash
podman exec -it fail2ban-ui /bin/bash

Volume Mounts

The Fail2Ban UI container requires several volume mounts to function properly. Below is a detailed explanation of each volume:

Required Volumes
/config - Configuration and Database Storage
  • Host Path: /opt/podman-fail2ban-ui (or your preferred location)
  • Container Path: /config
  • Purpose: Stores the SQLite database (fail2ban-ui.db), application settings, and SSH keys for remote server connections
  • Permissions: Read/Write
  • SELinux Context: :Z flag required on SELinux-enabled systems
  • Contents:
    • fail2ban-ui.db - SQLite database with server configurations and ban events
    • .ssh/ - Directory for SSH keys used for remote server connections
    • Application configuration files
/etc/fail2ban - Fail2Ban Configuration Directory (reqired for local fail2ban connector only)
  • Host Path: /etc/fail2ban
  • Container Path: /etc/fail2ban
  • Purpose: Access to Fail2Ban configuration files (jails, filters, actions)
  • Permissions: Read/Write (required for configuration management)
  • SELinux Context: :Z flag required on SELinux-enabled systems
  • Note: Required if managing local Fail2Ban instance
/var/run/fail2ban - Fail2Ban Socket Directory (reqired for local fail2ban connector only)
  • Host Path: /var/run/fail2ban
  • Container Path: /var/run/fail2ban
  • Purpose: Access to Fail2Ban control socket (fail2ban.sock)
  • Permissions: Read/Write
  • SELinux Context: Not required (tmpfs)
  • Note: Required for local Fail2Ban management
/var/log - Log Files (reqired for local fail2ban connector only)
  • Host Path: /var/log
  • Container Path: /var/log
  • Purpose: Read access to system logs for automatically logpath-tests on jail enabe
  • Permissions: Read-Only (:ro)
  • Note: If test fails, jail is auto-disabled to prevent fail2ban daemon errors
Optional Volumes
GeoLite2-Country.mmdb - GeoIP Database
  • Host Path: /path/to/your/GeoIPFolder
  • Container Path: e.g. /usr/share/GeoIP paht must match the settings in the UI.
  • Purpose: Only needed if you want to use the MaxMind provider.
  • Permissions: Read-Only (:ro)
  • Note: Fail2Ban UI uses the built-in ip-api.com by default, which requires no local database
Volume Summary Table
VolumeRequiredRead/WriteSELinux ContextPurpose
/config✅ YesRead/Write:ZDatabase, settings, SSH keys
/etc/fail2ban✅ Yes*Read/Write:ZFail2Ban configuration files
/var/run/fail2ban✅ Yes*Read/Write-Fail2Ban control socket
/var/log✅ Yes*Read-Only:roSystem log files for automated logpath tests on jail management.
/path/to/your/GeoIPFolder⚠️ OptionalRead-Only:roMaxMind GeoIP databases (only needed if using MaxMind provider)

*Required only if managing a local Fail2Ban instance. Not needed for remote-only deployments.


Configuration

Environment Variables
VariableDefaultDescription
PORT8080Port number for the web interface
BIND_ADDRESS0.0.0.0IP address to bind the web interface to. Useful when running with host networking to prevent exposing the web UI to unprotected networks. Set to a specific IP (e.g., 127.0.0.1 or a specific interface IP) to restrict access.
CONTAINERtrueAutomatically set by the container (do not override)
First Launch Configuration

After starting the container, access the web interface and configure your first Fail2Ban server:

  1. Access the Web Interface

    • Navigate to http://localhost:8080 (or your configured port)
  2. Add Your First Server

    • Go to Settings → Manage Servers
    • Local Server: Enable the local connector if Fail2Ban runs on the same host
    • Remote Server: Add via SSH or API agent connection
  3. Configure Settings

    • Fail2Ban Callback URL: This URL is used by all Fail2Ban instances to send ban alerts back to Fail2Ban UI
      • For local deployments: Use the same port as Fail2Ban UI (e.g., [***] or your configured port)
      • For reverse proxy setups: Use your TLS-encrypted endpoint (e.g., [***])
      • The callback URL automatically updates when you change the server port (if using the default localhost pattern)
    • Callback URL Secret: Auto-generated 42-character secret for authenticating ban notification requests (viewable in Settings with show/hide toggle)
    • GeoIP Provider: Choose between MaxMind (local database) or Built-in (ip-api.com) - default is Built-in
    • Maximum Log Lines: Configure how many log lines to include in ban notifications (default: 50)
    • Set up email alerts (optional)
    • Configure language preferences
    • Adjust security settings

Note: The local Fail2Ban service is optional. Fail2Ban UI can manage remote Fail2Ban servers via SSH or API agents without requiring a local Fail2Ban installation in the container.

Important: The Fail2Ban Callback URL must be accessible from all Fail2Ban instances (local and remote) that need to send alerts. If you change the Fail2Ban UI port, ensure the callback URL is updated accordingly.


Docker Compose

For easier management, you can use Docker Compose. Create a docker-compose.yml file:

yaml
services:
  fail2ban-ui:
    # Use pre-built image from Docker Hub (default)
    image: swissmakers/fail2ban-ui:latest

    # Alternative: Use Swissmakers registry (fallback)
    # image: registry.swissmakers.ch/infra/fail2ban-ui:latest

    # Or build from source (uncomment to use):
    # build:
    #   context: .
    #   dockerfile: Dockerfile

    container_name: fail2ban-ui
    #privileged: true # needed if you want to use a container-local fail2ban instance (because fail2ban.sock is owned by root)
    # a single all-in-one container is planned, currently you need to use the fail2ban container from linuxserver, see docker-compose-allinone.yml for an example
    network_mode: host

    environment:
      # Change this to use a different port for the web interface (defaults is 8080)
      - PORT=8080

    volumes:
      # Required for fail2ban-ui: Stores SQLite database, application settings, and SSH keys of the fail2ban-ui container
      - /opt/podman-fail2ban-ui:/config:Z
      # Required for fail2ban-ui: Used for testing, that logpath is working, before enabeling a jail. Without this read only access the fail2ban-ui will not be able to enable jails (logpath-test would fail)
      - /var/log:/var/log:ro

      # Required for local fail2ban instance: Fail2Ban configuration directory, needed for managing a local Fail2Ban instance (e.g. on host system) via fail2ban-ui
      - /etc/fail2ban:/etc/fail2ban:Z
      # Required for local fail2ban instance: Fail2Ban socket directory, needed for local Fail2Ban (e.g. on host system) for control via fail2ban-ui
      - /var/run/fail2ban:/var/run/fail2ban

      # Optional: Map MaxMind GeoIP databases (only needed if using MaxMind provider)
      #- /usr/share/GeoIP:/usr/share/GeoIP:ro

    restart: unless-stopped

Start with Docker Compose:

bash
docker-compose up -d

View logs:

bash
docker-compose logs -f

Stop:

bash
docker-compose down
All-in-One Docker Compose Setup

For a complete containerized setup with both Fail2Ban and Fail2Ban UI, use the all-in-one Docker Compose configuration:

yaml
services:
  fail2ban:
    image: lscr.io/linuxserver/fail2ban:latest
    container_name: fail2ban
    cap_add:
      # Required for fail2ban container: Allows to manage network interfaces and iptables from the container
      - NET_ADMIN
      # Required for fail2ban container: Allows to create raw sockets (needed for fail2ban.sock)
      - NET_RAW
      # Required for fail2ban container: Allows to run as root (needed to manage network interfaces and raw sockets)
      - SYS_ADMIN
    #privileged: true
    network_mode: host # needed to add iptables rules to the host network
    environment:
      - TZ=Europe/Zurich
      - VERBOSITY=-vv
    volumes:
      # To make sure linuxserver-fail2ban configs are persistent across container restarts (also needed by fail2ban-ui to modify configs)
      - ./fail2ban-config:/config:z
      # Directory that contains fail2ban.sock for communication between fail2ban-ui and fail2ban container
      - ./f2b-run:/var/run/fail2ban:z

      # Log sources for fail2ban container
      - /var/log:/var/log:ro
      - /var/log/httpd:/remotelogs/apache2:ro
    restart: unless-stopped

  fail2ban-ui:
    # Use pre-built image from Docker Hub (default)
    image: swissmakers/fail2ban-ui:latest
    # Alternative: Use Swissmakers registry (fallback)
    # image: registry.swissmakers.ch/infra/fail2ban-ui:latest
    # Or build from source (uncomment to use):
    # image: localhost/fail2ban-ui:dev
    container_name: fail2ban-ui
    privileged: true # needed because the fail2ban-ui container needs to modify the fail2ban config owned by root inside the linuxserver-fail2ban container
    network_mode: host
    environment:
      # Optional: Change this to use a different port for the web interface (defaults is 8080)
      - PORT=3080
      # Optional: Bind to a specific IP address (default: 0.0.0.0)
      # This is useful when running with host networking to prevent exposing
      # the web UI to unprotected networks. Set to a specific IP (e.g., 127.0.0.1
      # or a specific interface IP) to restrict access.
      # - BIND_ADDRESS=127.0.0.1
    volumes:
      # Required for fail2ban-ui: Stores SQLite database, application settings, and SSH keys of the fail2ban-ui container
      - ./config:/config:Z
      # Required for fail2ban-ui: Used for testing, that logpath is working, before enabeling a jail. Without this read only access the fail2ban-ui will not be able to enable jails (logpath-test would fail)
      - /var/log:/var/log:ro
      - /var/log/httpd:/remotelogs/apache2:ro # this mounts the apache2 logs of a RPM based system (e.g. Rocky Linux) to the default location set by linuxserver-fail2ban. (on debian based systems this is /var/log/apache2 and currently hardcoded in the linuxserver-fail2ban container)

      # Required for compose-local fail2ban instance: We mount the same Fail2Ban config as the linuxserver-fail2ban container (under /config/fail2ban to fail2ban-ui can modify configs)
      - ./fail2ban-config/fail2ban:/etc/fail2ban:z
      # Required for compose-local fail2ban instance: Mount the same run directory that contains fail2ban.sock for communication between fail2ban-ui and the linuxserver-fail2ban container
      - ./f2b-run:/var/run/fail2ban:z

    restart: unless-stopped
bash
# Edit docker-compose to customize:
# - PORT environment variable for Fail2Ban UI
# - Timezone (TZ environment variable)
# - Volume paths

# Start both services
docker-compose up -d

Features:

  • Combined Setup: Fail2Ban (linuxserver/fail2ban) and Fail2Ban UI in one compose file
  • Shared Configuration: Both containers share the same Fail2Ban configuration directory
  • Shared Socket: Both containers access the same Fail2Ban control socket
  • Network Mode: Uses host network mode for proper iptables integration

Volume Structure:

./fail2ban-config/fail2ban  → /config/fail2ban (fail2ban container)
./fail2ban-config/fail2ban  → /etc/fail2ban (fail2ban-ui container)
./f2b-run                   → /var/run/fail2ban (both containers)
./config                    → /config (fail2ban-ui container)

Important Notes:

  • The fail2ban-ui container requires privileged: true to modify Fail2Ban configs owned by root
  • Both containers must use network_mode: host for proper networking
  • Ensure SELinux labels are correct (:z or :Z flags)

SELinux Configuration (only when using fail2ban-ui with a fail2ban instance on host)

If SELinux is enabled on your system, you must apply the required SELinux policies to allow the container to communicate with Fail2Ban.

Apply Pre-built Policies (github)

The policies are located in ./SELinux/:

bash
cd deployment/container/SELinux
semodule -i fail2ban-container-ui.pp
semodule -i fail2ban-container-client.pp
Manually Compile and Install Policies

If you want to modify or compile the SELinux rules yourself:

bash
cd deployment/container/SELinux

# Compile the module
checkmodule -M -m -o fail2ban-container-client.mod fail2ban-container-client.te

# Package the module
semodule_package -o fail2ban-container-client.pp -m fail2ban-container-client.mod

# Install the module
semodule -i fail2ban-container-client.pp
Verify SELinux Policies
bash
semodule -l | grep fail2ban

You should see:

  • fail2ban-container-ui
  • fail2ban-container-client

Troubleshooting

UI Not Accessible

Symptoms: Cannot access web interface

Solutions:

  1. Check if container is running:

    bash
    podman ps | grep fail2ban-ui
    
  2. Check container logs:

    bash
    podman logs fail2ban-ui
    
  3. Verify port is not blocked by firewall:

    bash
    sudo firewall-cmd --list-ports
    sudo firewall-cmd --add-port=8080/tcp --permanent
    sudo firewall-cmd --reload
    
  4. Check if Fail2Ban UI process is running inside container:

    bash
    podman exec -it fail2ban-ui ps aux | grep fail2ban-ui
    
  5. Verify port configuration:

    • Check if PORT environment variable is set correctly
    • Check container logs for the actual port being used
No Servers Configured

Symptoms: Empty dashboard, no servers visible

Solutions:

  1. Navigate to Settings → Manage Servers in the web UI
  2. Enable Local Connector (if Fail2Ban runs locally)
  3. Add remote server via SSH or API agent
  4. Verify server connection status
SSH Connection Issues

Symptoms: Cannot connect to remote server

Solutions:

  1. Verify SSH key authentication works from the host:

    bash
    ssh -i /opt/podman-fail2ban-ui/.ssh/your_key user@remote-host
    
  2. Ensure SSH user has proper permissions on remote server:

    • Sudo access for fail2ban-client and systemctl restart fail2ban (configured via sudoers)
    • File system ACLs on /etc/fail2ban for configuration file access
    • See the main README for recommended setup with service account and ACLs
  3. Check SSH keys location:

    • SSH keys should be placed in /config/.ssh directory inside the container
    • Verify key permissions (should be 600)
  4. Enable debug mode:

    • Go to Settings → Enable debug mode for detailed error messages
  5. Verify network connectivity:

    • The container needs network access to remote SSH servers
    • Check if using --network=host or configure proper port mappings
Permission Denied Errors

Symptoms: Permission errors when accessing Fail2Ban files

Solutions:

  1. Check SELinux context on volumes:

    bash
    ls -Z /opt/podman-fail2ban-ui
    ls -Z /etc/fail2ban
    
  2. Apply correct SELinux context:

    bash
    chcon -Rt container_file_t /opt/podman-fail2ban-ui
    
  3. Verify volume mount flags:

    • Use :Z flag for read/write volumes on SELinux systems
    • Use :ro flag for read-only volumes
Database Errors

Symptoms: Database-related errors in logs

Solutions:

  1. Check database file permissions:

    bash
    ls -la /opt/podman-fail2ban-ui/fail2ban-ui.db
    
  2. Verify database integrity:

    bash
    podman exec -it fail2ban-ui sqlite3 /config/fail2ban-ui.db "PRAGMA integrity_check;"
    
  3. Backup and recreate if corrupted:

    bash
    cp /opt/podman-fail2ban-ui/fail2ban-ui.db /opt/podman-fail2ban-ui/fail2ban-ui.db.backup
    

Contact & Support

For issues, contributions, or feature requests, visit our GitHub repository:
🔗 GitHub Issues

For enterprise support, visit:
🔗 Swissmakers GmbH

查看更多 fail2ban-ui 相关镜像 →
linuxserver/fail2ban logo
linuxserver/fail2ban
linuxserver
LinuxServer.io提供的fail2ban Docker镜像,是一个用于禁止多次认证错误主机的守护进程,支持在主机和Docker容器级别工作,具备多架构支持、定期应用与安全更新、简单用户映射等特性,帮助提升系统安全性。
57 次收藏10万+ 次下载
5 天前更新
crazymax/fail2ban logo
crazymax/fail2ban
crazymax
基于Alpine Linux的Fail2ban Docker镜像,用于监控系统日志并自动封禁恶意IP,防御服务器暴力破解等攻击,支持自定义规则配置。
81 次收藏1000万+ 次下载
12 天前更新
rapydo/fail2ban logo
rapydo/fail2ban
rapydo
暂无描述
10万+ 次下载
5 小时前更新
forumi0721/alpine-fail2ban logo
forumi0721/alpine-fail2ban
forumi0721
alpine-fail2ban
1万+ 次下载
13 小时前更新
basip/link-fail2ban-service logo
basip/link-fail2ban-service
basip
暂无描述
1万+ 次下载
11 小时前更新

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

Docker 配置

登录仓库拉取

通过 Docker 登录认证访问私有仓库

专属域名拉取

无需登录使用专属域名

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

系统配置

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

MacOS OrbStack

MacOS OrbStack 容器配置

Docker Compose

Docker Compose 项目配置

NAS 设备

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

极空间

极空间 NAS 系统配置服务

网络设备

爱快路由

爱快 iKuai 路由系统配置

宝塔面板

在宝塔面板一键配置镜像

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

使用与功能问题

docker search 报错:专属域名下仅支持 Docker Hub 查询

docker search 报错问题

网页搜不到镜像:Docker Hub 有但轩辕镜像搜索无结果

镜像搜索不到

离线传输镜像:无法直连时用 docker save/load 迁移

离线传输镜像

Docker 插件安装错误:application/vnd.docker.plugin.v1+json

Docker 插件安装错误

WSL 下 Docker 拉取慢:网络与挂载目录影响及优化

WSL 拉取镜像慢

轩辕镜像是否安全?镜像完整性校验(digest)说明

镜像安全性

如何用轩辕镜像拉取镜像?登录方式与专属域名配置

如何拉取镜像

错误码与失败问题

manifest unknown 错误:镜像不存在或标签错误

manifest unknown 错误

TLS/SSL 证书验证失败:Docker pull 时 HTTPS 证书错误

TLS 证书验证失败

DNS 解析超时:无法解析镜像仓库地址或连接超时

DNS 解析超时

410 Gone 错误:Docker 版本过低导致协议不兼容

410 错误:版本过低

402 Payment Required 错误:流量耗尽错误提示

402 错误:流量耗尽

401 UNAUTHORIZED 错误:身份认证失败或登录信息错误

身份认证失败错误

429 Too Many Requests 错误:请求频率超出专业版限制

429 限流错误

Docker login 凭证保存错误:Cannot autolaunch D-Bus(不影响登录)

凭证保存错误

账号 / 计费 / 权限

免费版与专业版区别:功能、限额与使用场景对比

免费版与专业版区别

支持的镜像仓库:Docker Hub、GCR、GHCR、K8s 等列表

轩辕镜像支持的镜像仓库

拉取失败是否扣流量?计费规则说明

拉取失败流量计费

KYSEC 权限不够:麒麟 V10/统信 UOS 下脚本执行被拦截

KYSEC 权限错误

如何申请开具发票?(增值税普票/专票)

开具发票

如何修改网站与仓库登录密码?

修改网站和仓库密码

配置与原理类

registry-mirrors 未生效:仍访问官方仓库或报错的原因

registry-mirrors 未生效

如何去掉镜像名称中的轩辕域名前缀?(docker tag)

去掉域名前缀

如何拉取指定架构镜像?(ARM64/AMD64 等多架构)

拉取指定架构镜像

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
swissmakers/fail2ban-ui
博客公告Docker 镜像公告与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
镜像拉取问题咨询请 提交工单,官方技术交流群:1072982923。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
镜像拉取问题咨询请提交工单,官方技术交流群:。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
商务合作:点击复制邮箱
©2024-2026 源码跳动
商务合作:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.