-
Notifications
You must be signed in to change notification settings - Fork 184
Move to Zoraxy from Nginx Proxy Manager
Do you need a step-by-step guide? Take a look on this beginners guide!
Most people who selfhost different services use the Nginx Proxy Manager (NPM) for easy managing their services with or without Docker. I would like to show you how to move over to Zoraxy in this basic guide.
If you use Zoraxy in docker, you can use it like Nginx proxy manager. Create a proxy rule in Zoraxy and use the container name (or service name) and the port inside the container.
For example Immich:
immich_server
is the container name and the port inside the container is 3001
. In Zoraxy you create a proxy rule with
immich_server:3001
That´s it!
If you use Zoraxy directly on your host, you need static IPs for docker containers, since the IPs change if you use docker compose down
and docker compose up -d
-
First make a list of your existing proxyhosts in NPM because you need to start over in Zoraxy!
-
If you use portmappings for your containers like 8080:80, you can easily use the same in Zoraxy.
You only need to point to localhost:8080, exactly the same like in NPM. That´s it!
Create a separate docker network with this:
docker network create --ipv6 --subnet fd00:112::/64 --subnet 172.40.0.0/16 staticnet
With IPV6 if wanted or
docker network create --subnet 172.40.0.0/16 staticnet
without IPV6
If it is successful it will give you a long output like "2cabe0428cb514e3e3d8e49d358df0930f519b8a80a39886dd8c8cae4fd6cfa1", if it fails with "Error response from daemon: Pool overlaps with other one on this address space", then increase the number 40 to 41, 42 etc.. in the subnet parameter (172.41.0.0/16). Now we have a new network named "staticnet".
The next step is to integrate this network in the docker-compose.yml
Take a look at this example:
version: '3'
services:
app:
image: myapp:latest
restart: unless-stopped
ports:
- "8080:80"
environment:
- TZ=Europe/Berlin
volumes:
- ./files:/data
healthcheck:
test: ["CMD", "curl", "-fSs", "http://localhost:8008/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 5s
db:
image: postgres:15-alpine
restart: unless-stopped
volumes:
- ./database:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=changeme
- POSTGRES_INITDB_ARGS= --encoding='UTF8' --lc-collate='C' --lc-ctype='C'
We can comment out the portmapping, since we use the container IP directly and only need the port inside the container. Then we add the container to our network "staticnet" and give it a unique IP. Please start with the IP 172.40.0.2, because the numbers 255, 0 and 1 are already used in the network.
An example file would now look like this:
version: '3'
services:
app:
image: myapp:latest
restart: unless-stopped
# ports:
# - "8080:80"
networks:
staticnet:
ipv4_address: 172.40.0.2
# ipv6_address: fd00:112::2 #comment out for IPV6
environment:
- TZ=Europe/Berlin
volumes:
- ./files:/data
healthcheck:
test: ["CMD", "curl", "-fSs", "http://localhost:8008/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 5s
db:
image: postgres:15-alpine
restart: unless-stopped
volumes:
- ./database:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=changeme
- POSTGRES_INITDB_ARGS= --encoding='UTF8' --lc-collate='C' --lc-ctype='C'
networks:
staticnet:
external: true
The last 3 lines tell docker to use our already created network.
With this easy change you can now point Zoraxy to CONTAINER_IP:PORT, in this example it would be 172.40.0.2:80. This is the only thing to do for the most services. Some services need a few more steps, like Synapse (Matrix). Take a look here Troubleshoot for this.
Further information about docker networking can be found here: Docker Network
I have tested these services with this method, and it worked without any further configuration:
Kavita, Jellyfin, Immich, Paperless-ngx, Adguard, Dashdot, SearxNG, Nextcloud, Gotify, WikiJS, Vaultwarden and Stirling PDF