Installing NxFilter on Raspberry Pi 4 inside Docker
It is a pain when you have to deal with sdcard failure of your home automation system. But that is what happened. So I have to rebuild my home automation again from scratch, but thankfully I have documented everything in my blog, so I just have to repeat the steps again to reproduce this. My old instruction is installing NxFilter directly to the main repository of Raspberry Pi. Given that I already have docker container installed, why not try to install the NxFilter in the docker as well. So here are the steps that I took to install it.
Step 1. Create Docker compose file
Using your favourite editor like nano, create the docker-compose.yaml
version: '3.7'
services:
nxfilter:
image: deepwoods/nxfilter:latest
container_name: nxfilter
environment:
TZ: "Australia/Melbourne"
volumes:
- nxfconf:/nxfilter/conf
- nxflog:/nxfilter/log
- nxfdb:/nxfilter/db
restart: unless-stopped
dns:
- "192.168.0.1" # change this to your dns server or router ip address
ports:
- 80:80
- 443:443
- 53:53/udp
- 19002-19004:19002-19004
# volumes for mapping data,config and log
volumes:
nxfconf:
nxfdb:
nxflog:
networks:
default:
Save the file above
Step 2. Start and detach the container
Using the following command start and detach the contaiiner
docker compose up -d
Then check that the container have started up using the following command
docker container ls -a
You should be able to see the nxfilter container as shown in the following picture

Check the log to make sure that the NxFilter have started up using the following command
docker compose logs
you should see the following screen that shows NxFilter is currently downloading the Jahaslist

When it eventually finished you should see the line similar to the last line in the following screen shot showing that it is now listening on port 80 and 443.

Step 3. Login and Configure NxFilter
You should be able to point your browser to the following address
http://your-nxfilter-ip/admin.jsp
You should be presented with an admin login screen. The default username and password is admin, so you need to change it once you have logged in.

Happy filtering. Drop me a line if this helped you in any way, or if you have any questions.
Step 4. Updating the NxFilter
From time to time you will need to update to the latest version of Nx Filter the following steps will be useful to do so.
- Pull the latest container using.
docker pull deepwoods/nxfilter:latest - Step and remove the current container.
docker stop nxfilter && docker rm nxfilter- If using docker-compose: docker compose down
- Run the new container with the same command as below
docker run -dt --name nxfilter \
-e TZ=America/Chicago \
-v nxfconf:/nxfilter/conf \
-v nxfdb:/nxfilter/db \
-v nxflog:/nxfilter/log \
-p 53:53/udp \
-p 19004:19004/udp \
-p 80:80 \
-p 443:443 \
-p 19002-19004:19002-19004 \
deepwoods/nxfilter:latest
- If using docker-compose:
docker compose up -d - Make sure the container is running.
docker ps - Check the container logs if GUI is not available.
docker logs nxfilter- If using docker-compose:
docker compose logs
- If using docker-compose:
Note: Reference https://github.com/DeepWoods/nxfilter-docker