Page 1 of 1

[Solved] static IP for Containers

Posted: Fri Mar 14, 2025 3:31 pm
by Freescreen

Hi,

i have autobrr behind gluetun. So i must every restart update the IP Form radarr and sonarr.

How can i get static IP for the network containers.

I try this one to radarr, but there come an error:

Code: Select all

validating /opt/yams/docker-compose.yaml: services.networks Additional property default is not allowed

Code: Select all

networks:
    default:
        ipv4_address: 172.18.0.6

Any one can help me?


Re: static IP for Containers

Posted: Fri Mar 14, 2025 4:36 pm
by rogs

Hey @Freescreen!

You can follow this StackOverflow to add static IPs to your containers: https://stackoverflow.com/questions/394 ... er-compose

Cheers!

Roger.


Re: static IP for Containers

Posted: Sat Mar 15, 2025 8:36 am
by Freescreen

Thanks , it works!
yaml>

Code: Select all

networks:
  netya: # here we set the network name
    driver: bridge
    ipam:
      driver: default
      config:
      - subnet:  172.19.0.0/16
        gateway: 172.19.0.1

For containers>

Code: Select all

networks:
       netya:
         ipv4_address: 172.19.0.2