├── .github └── workflows │ └── docker-image.yml ├── Dockerfile └── README.md /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: NxFilter docker image CI 2 | 3 | on: 4 | push: 5 | paths: 6 | - "Dockerfile" 7 | branches: 8 | - "main" 9 | 10 | jobs: 11 | docker: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - 15 | name: Checkout 16 | uses: actions/checkout@v3 17 | - 18 | name: Set up QEMU 19 | uses: docker/setup-qemu-action@v2 20 | - 21 | name: Set up Docker Buildx 22 | uses: docker/setup-buildx-action@v2 23 | - 24 | name: Login to Docker Hub 25 | uses: docker/login-action@v2 26 | with: 27 | username: ${{ secrets.DOCKERHUB_USERNAME }} 28 | password: ${{ secrets.DOCKERHUB_TOKEN }} 29 | - 30 | name: Build and push 31 | uses: docker/build-push-action@v4 32 | with: 33 | context: . 34 | platforms: linux/amd64,linux/arm64,linux/arm/v7 35 | push: true 36 | tags: deepwoods/nxfilter:latest 37 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | LABEL maintainer="Rob Asher" 4 | LABEL version="4.7.1.9" 5 | LABEL release-date="2025-05-27" 6 | LABEL source="https://github.com/DeepWoods/nxfilter-docker" 7 | 8 | ENV TZ=${TZ:-Etc/UTC} 9 | 10 | RUN apt -y update && apt -y upgrade \ 11 | && apt -y install --no-install-recommends dnsutils iputils-ping tzdata curl openjdk-11-jre-headless \ 12 | && curl $(printf ' -O http://pub.nxfilter.org/nxfilter-%s.deb' $(curl https://nxfilter.org/curver.php)) \ 13 | && apt -y install --no-install-recommends ./$(printf 'nxfilter-%s.deb' $(curl https://nxfilter.org/curver.php)) \ 14 | && apt -y clean autoclean \ 15 | && apt -y autoremove \ 16 | && rm -rf ./$(printf 'nxfilter-%s.deb' $(curl https://nxfilter.org/curver.php)) \ 17 | && rm -rf /var/lib/apt && rm -rf /var/lib/dpkg && rm -rf /var/lib/cache && rm -rf /var/lib/log \ 18 | && echo "$(curl https://nxfilter.org/curver.php)" > /nxfilter/version.txt 19 | 20 | EXPOSE 53/udp 19004/udp 80 443 19002 19003 19004 21 | 22 | CMD ["/nxfilter/bin/startup.sh"] 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NxFilter # 2 | 3 | ## About ## 4 | [NxFilter](http://nxfilter.org/p3/) is a scalable and reliable DNS filtering server software by Jahastech. 5 | 6 | Container image is based off of Ubuntu:latest minimal with the most current DEB package for NxFilter from [NxFilter](https://nxfilter.org/p3/download/). 7 | 8 | 9 | ## Usage ## 10 | 11 | #### Interactive container for testing: #### 12 | 13 | ``` 14 | docker run -it --name nxfilter \ 15 | -p 53:53/udp \ 16 | -p 19004:19004/udp \ 17 | -p 80:80 \ 18 | -p 443:443 \ 19 | -p 19002-19004:19002-19004 \ 20 | deepwoods/nxfilter:latest 21 | ``` 22 | 23 | #### Detached container with persistent data volumes: #### 24 | 25 | ``` 26 | docker run -dt --name nxfilter \ 27 | -e TZ=America/Chicago \ 28 | -v nxfconf:/nxfilter/conf \ 29 | -v nxfdb:/nxfilter/db \ 30 | -v nxflog:/nxfilter/log \ 31 | -p 53:53/udp \ 32 | -p 19004:19004/udp \ 33 | -p 80:80 \ 34 | -p 443:443 \ 35 | -p 19002-19004:19002-19004 \ 36 | deepwoods/nxfilter:latest 37 | ``` 38 | 39 | 40 | ## Configuration 41 | * The admin GUI URL is http://[DOCKER_HOST_SERVER_IP]/admin 42 | * The default Block Redirection IP under System -> Setup needs to match your [DOCKER_HOST_SERVER_IP] unless you're bridging your docker network to your local LAN or using MACVLAN. 43 | * TZ of the container defaults to UTC unless overridden by setting the environment variable to your locale. [see List of tz time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) 44 | 45 | 46 | --- 47 | ## Docker-compose example ## 48 | 49 | ```yaml 50 | version: '3.5' 51 | 52 | services: 53 | nxfilter: 54 | image: deepwoods/nxfilter:latest 55 | container_name: nxfilter 56 | hostname: nxfilter 57 | restart: unless-stopped 58 | environment: 59 | TZ: "America/Chicago" 60 | volumes: 61 | - nxfconf:/nxfilter/conf 62 | - nxflog:/nxfilter/log 63 | - nxfdb:/nxfilter/db 64 | ports: 65 | - 53:53/udp 66 | - 19004:19004/udp 67 | - 80:80 68 | - 443:443 69 | - 19002-19004:19002-19004 70 | volumes: 71 | nxfconf: 72 | nxfdb: 73 | nxflog: 74 | ``` 75 | 76 | ### Useful Commands ### 77 | docker-compose to start and detach container: `docker-compose up -d` 78 | 79 | Stop and remove container: `docker-compose down` 80 | 81 | Restart a service: `docker-compose restart nxfilter` 82 | 83 | View logs: `docker-compose logs` 84 | 85 | Open a bash shell on running container name: `docker exec -it nxfilter /bin/bash` 86 | 87 | > **Warning** 88 | > Commands below will delete all data volumes not associated with a container! 89 | > 90 | > Remove container & persistent volumes(clean slate): `docker-compose down && docker volume prune` 91 | 92 | ## Updating ## 93 | 1. Pull the latest container. `docker pull deepwoods/nxfilter:latest` 94 | 2. Stop and remove the current container. `docker stop nxfilter && docker rm nxfilter` 95 | > **Note** If using docker-compose: `docker-compose down` 96 | 3. Run the new container with the same command from above. [Detached container](#detached-container-with-persistent-data-volumes) 97 | > **Note** If using docker-compose: `docker-compose up -d` 98 | 4. Make sure that the container is running. `docker ps` 99 | 5. Check the container logs if unable to access the GUI for some reason. `docker logs nxfilter` 100 | > **Note** If using docker-compose: `docker-compose logs` 101 | --------------------------------------------------------------------------------