Search code examples
dockerlocalhostadminer

How to get Adminer to run locally using Docker


I am having issues with running Adminer on my localhost. After running this command:

$ docker run --rm -ti --network host adminer
[Sun Jan 10 18:19:33 2021] PHP 7.4.14 Development Server (http://[::]:8080) started

I expect to see Adminer running on localhost:8080, however my browser "can't establish a connection to the server at localhost:8080"

Not sure how to proceed from here. My terminal states that the server is running on 8080

Thank you!


Solution

  • If you have to run docker on a virtual machine then I think it's only listening to port 8080 on that VM (which you could check with wget or curl on the VM IP address which you should be able to find using the docker desktop, or you could use the VM console and try wget or curl on http://localhost:8080)

    You may need to use -p 8080:8080 instead of --network hostto expose the port on your local machine.