0

So i'm trying to setup netbox.

I installed redis and postgresql manually and then follow the guide on linuxserver.io. I created the docker-compose and edited the right environments, however when starting the container i'm getting the error 'could not translate postgres to address'.

When I did an inspect on my postgress container I found out it was using the name 'postgresql' so I have changed it to 'postgres' but even now I still have the same error.

I assume it cannot find the hostname of my postgres container, but I don't know what the exact problem is.

Can anyone help?

Edit:

I have setup postgresql with this command:

docker run --name postgresql -e POSTGRES_USER=myusername -e POSTGRES_PASSWORD=mypassword -p 5432:5432 -v /data:/var/lib/postgresql/data -d postgres

and have setup according to this guide: redislab/redis

docker run -d --cap-add sys_resource --name rp -p 8443:8443 -p 9443:9443 -p 12000:12000 redislabs/redis

And finally I have setup using this docker compose yaml:

version: "2.1"
services:
  netbox:
    image: lscr.io/linuxserver/netbox:latest
    container_name: netbox
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=<TZ>
      - SUPERUSER_EMAIL=<SUPERUSER_EMAIL>
      - SUPERUSER_PASSWORD=<SUPERUSER_PASSWORD>
      - ALLOWED_HOST=<ALLOWED_HOST>
      - DB_NAME=<DB_NAME>
      - DB_USER=<DB_USER>
      - DB_PASSWORD=<DB_PASSWORD>
      - DB_HOST=<DB_HOST>
      - DB_PORT=<DB_PORT>
      - REDIS_HOST=<REDIS_HOST>
      - REDIS_PORT=<REDIS_PORT>
      - REDIS_PASSWORD=<REDIS_PASSWORD>
      - REDIS_DB_TASK=<REDIS_DB_TASK>
      - REDIS_DB_CACHE=<REDIS_DB_CACHE>
      - BASE_PATH=<BASE_PATH> #optional
      - REMOTE_AUTH_ENABLED=<REMOTE_AUTH_ENABLED> #optional
      - REMOTE_AUTH_BACKEND=<REMOTE_AUTH_BACKEND> #optional
      - REMOTE_AUTH_HEADER=<REMOTE_AUTH_HEADER> #optional
      - REMOTE_AUTH_AUTO_CREATE_USER=<REMOTE_AUTH_AUTO_CREATE_USER> #optional
      - REMOTE_AUTH_DEFAULT_GROUPS=<REMOTE_AUTH_DEFAULT_GROUPS> #optional
      - REMOTE_AUTH_DEFAULT_PERMISSIONS=<REMOTE_AUTH_DEFAULT_PERMISSIONS> #optional
    volumes:
      - <path to data on host>:/config
    ports:
      - 8000:8000
    restart: unless-stopped

I have ommited the optional ones

for postgresql I have used the container name 'postgres' according to the default in netbox.

  • Tell us what you did. I'm not going to scour the entire linuxserver.io site to try to figure out what you did. – jjanes Oct 16 '22 at 15:15

0 Answers0