Important
PRE-RELEASE BETA
Real-time log viewer for Apache, Nginx, NPM, system logs and Fail2ban
README en FranΓ§ais | Installation | Plugins | Configuration | Reverse Proxy | Documentation
- Installation
- Plugins
- Configuration
- Reverse Proxy
- System Log Access
- Documentation
- Contribution
- License
LogviewR - real-time log viewer for Apache, Nginx, NPM, system logs and Fail2ban.
- π Real-time via WebSocket
- π Filters: level, date, IP, HTTP methodβ¦
- π Statistics and dashboards per plugin
- π JWT auth, role management
- π³ Docker-ready
π₯οΈ Host System - Linux/Unix system logs
- Syslog, auth, kernel, daemon, mail, custom logs
- Automatic Docker environment detection
- RFC 3164 / RFC 5424 support
- Configurable base path (
/var/logor/host/logsin Docker)
π Apache - Apache HTTP Server logs
- Access logs (Combined, Common, VHost) + Error logs
- IP, timestamp, HTTP method, status code, referer, user-agent extraction
- Editable default regex,
.gzsupport
π Nginx - Nginx logs
- Access logs (Combined, Common, Main, Extended) + Error logs
- Timestamp parsing with timezone handling
- Fail2ban and ELK compatible regex,
.gzsupport
π Nginx Proxy Manager (NPM) - NPM logs
- 5 supported formats with automatic detection
- Fields: cache, upstream status, gzip ratio, subdomains
.gzsupport
π‘οΈ Fail2ban - jail monitoring and banned IPs
Tabs: Jails Β· Filters Β· Actions Β· IP Tracker Β· Map Β· Ban Manager Β· Stats Β· IPTables Β· IPSet Β· NFTables Β· Config Β· Audit
Requirements: fail2ban installed and active on the host. Host setup required - see Installation Step 2.
To verify: Administration β Plugins β Fail2ban β Diagnostic.
Firewall tabs in Docker (IPTables Β· IPSet Β· NFTables)
These tabs require two cumulative conditions - neither alone is sufficient:
| Condition | Role |
|---|---|
network_mode: host |
Shares host network namespace - container sees host iptables/ipset/nft rules |
cap_add: NET_ADMIN |
Linux capability required by the kernel for netfilter read/write |
β οΈ Three incompatibilities to know:
network_mode: hostis incompatible withports:- removeports:and usePORT=7500inenvironment:insteadsecurity_opt: no-new-privileges:trueis incompatible with firewall tabs -sudocannot elevate with this flag, breaking iptables/ipset/nft commands- To change the listen port: set
PORT=8080in.envand point your reverse proxy to127.0.0.1:8080
Use docker-compose.fail2ban.yml β it includes network_mode: host, NET_ADMIN, and fail2ban socket/group already configured. See Installation Step 2.
Without these options, IPTables/IPSet/NFTables tabs will show a Permission denied or no new privileges error.
Fail2ban is optional. LogviewR works out of the box for viewing Apache, Nginx, NPM and system logs β no extra setup needed. The Fail2ban plugin is a powerful addition that lets you fully manage fail2ban (jails, bans, IPSet lists, firewall rules) from the dashboard, but it is not required.
Step 1 - Create the application directory
mkdir -p /home/docker/logviewr && cd /home/docker/logviewrStep 2 - Create .env and choose your docker-compose file
echo "JWT_SECRET=$(openssl rand -base64 32)" > .envStandard β log viewer only (Apache, Nginx, NPM, system logs):
wget -O docker-compose.yml https://raw.githubusercontent.com/Erreur32/LogviewR/main/docker-compose.ymlFail2ban + Firewall β full fail2ban management + IPTables/IPSet/NFTables tabs:
wget -O docker-compose.yml https://raw.githubusercontent.com/Erreur32/LogviewR/main/docker-compose.fail2ban.yml
# then run the setup script (one-time, sets permissions + writes FAIL2BAN_GID to .env):
curl -fsSL https://raw.githubusercontent.com/Erreur32/LogviewR/main/scripts/setup-fail2ban-access.sh | sudo bashThe setup script automatically creates the
fail2bangroup, sets socket/SQLite permissions, installs a systemd drop-in for persistence, and writesFAIL2BAN_GIDto.env. Run it once on the Docker host β survives reboots automatically.
Step 3 - Start
docker compose up -dDashboard available at http://your-ip:7500
| Variable | Description | Default | Required |
|---|---|---|---|
JWT_SECRET |
Secret used to sign JWT tokens | - | β Yes |
DASHBOARD_PORT |
Dashboard port (bridge mode with ports:) |
7500 |
No |
PORT |
Direct listen port (network_mode: host mode) |
3000 |
No |
HOST_IP |
Host machine IP address | Auto-detect | No |
CONFIG_FILE_PATH |
Path to external configuration file | /app/config/logviewr.conf |
No |
ADM_GID |
GID of the adm group on the host (system logs) |
4 |
No |
HOST_ROOT_PATH |
Host root path mounted in the container | /host |
No |
TZ |
Container timezone β must match your host TZ so log timestamps (written by Apache/Nginx in host local time, without TZ info) are parsed correctly. Override if your host is not in Europe/Paris. | Europe/Paris |
No |
Two ready-to-use files β download the one that matches your setup:
| File | Mode | What it does |
|---|---|---|
docker-compose.yml |
Standard | Log viewer only (Apache, Nginx, NPM, system). Bridge network, ports: mapping. |
docker-compose.fail2ban.yml |
Fail2ban + Firewall | Full fail2ban management + IPTables/IPSet/NFTables tabs. network_mode: host + NET_ADMIN. Requires setup-fail2ban-access.sh. |
See Installation Step 2 for download commands.
Fail2ban optional rw mounts (fail2ban mode only): The host filesystem is mounted
:rofor security. Two features need a dedicated rw bind mount (uncomment indocker-compose.fail2ban.yml):
Feature Uncomment source:SQLite VACUUM (Fail2ban Config tab) /var/lib/fail2banConfig file editing from the UI ( jail.local/fail2ban.local)/etc/fail2banShort-form mounts cannot override a
:roparent β the long-form syntax withpropagation: sharedis required.
Changing the port:
- Standard mode: set
DASHBOARD_PORT=8080in.env - Fail2ban mode: set
PORT=8080in.env, then point your reverse proxy to that port
When using fail2ban mode (network_mode: host), there is no Docker port mapping β the container listens directly on the host. A reverse proxy connects via 127.0.0.1:
In standard mode (ports: mapping), a reverse proxy can connect to 127.0.0.1:7500 the same way, or you can expose the port directly without a proxy.
Forward Hostname : 127.0.0.1
Forward Port : 7500 β must match PORT= or DASHBOARD_PORT=
server {
listen 443 ssl;
server_name logviewr.example.com;
location / {
proxy_pass http://127.0.0.1:7500;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}logviewr.example.com {
reverse_proxy 127.0.0.1:7500
}
http:
routers:
logviewr:
rule: "Host(`logviewr.example.com`)"
service: logviewr
services:
logviewr:
loadBalancer:
servers:
- url: "http://127.0.0.1:7500"The Host System plugin reads log files owned by root:adm (permissions 640).
The container automatically joins the adm group (GID 4) via group_add in docker-compose.
If your system uses a different GID for the adm group:
getent group adm | cut -d: -f3 # check the GID on the host
echo "ADM_GID=your_gid" >> .envSome files (/var/log/php8.0-fpm.log, /var/log/rkhunter.log) are owned by root:root 600 and are not readable even with adm group membership.
Fix them on the host:
sudo chgrp adm /var/log/php8.0-fpm.log* && sudo chmod 640 /var/log/php8.0-fpm.log*To make this persist across log rotation, add to /etc/logrotate.d/php8.0-fpm:
create 640 root adm
- Parser guides - supported formats and regex
- NPM Parser Help - NPM formats
- Nginx Parser Help - Nginx formats
- Host-system integration audit - error/warning scan
Contributions are welcome!
This project is licensed under the MIT License. See LICENSE.
Made with β€οΈ for system administrators and developers
Issues | Discussions | Wiki