20

I have installed minio in docker. It installed successfully and below are logs of the minio server:

enter image description here

I think all is well but when I invoke localhost:9000 url in browser it redirects to localhost:40793 with error message site can't be reached.

enter image description here

I don't know the issue. Can anyone help ? Thanks in advance.

Lalit Goswami
  • 798
  • 1
  • 8
  • 21

1 Answers1

38

Addressing the warning about the dynamic port worked for me. I think the issue is that minio serves the API on port 9000, but tries to redirect you to the console when that address visited in the browser (e.g. localhost:9000). The console is on a dynamic port that isn't exposed by docker.

Instead, we can specify the console port using the --console-address flag and expose it in the docker command. This worked for me:

docker run -p 9000:9000 -p 9001:9001 --name minio -d -v ~/minio/data:/data -e "MINIO_ROOT_USER={ACCESS_KEY}" -e "MINIO_ROOT_PASSWORD={ACCESS_SECRET}" minio/minio server --console-address :9001 /data

I was then able to visit the console at localhost:9001 (although visiting localhost:9000 also redirected me there).

William Edmisten
  • 693
  • 5
  • 12
  • 5
    For usage with Docker Compose: `command: minio server --console-address ":9001" /data` – Mick Jul 15 '21 at 18:14
  • 2
    Yes but how is --console-address declared in docker-compose.yml – sisko Dec 13 '21 at 02:10
  • 1
    There's a command to start the minio server either in the docker-compose, or in the Dockerfile that builds minio. Just need to add this flag to it and then add "9001:9001" to your port mappings – Brett Green Dec 17 '21 at 19:41
  • 1
    @sisko `command: ["server", "--console-address", ":9001", "/data"]` – Yahya Feb 09 '22 at 02:43