Laravel dusk refused to connect to host

Hi, I’m trying all the day to make this work, following this tutorial ( and I aways get the screenshot with the error “x.x.x.x refused to connect”.

The only thing different from the video is the php image and the version of laravel and dusk (I’m using the most recent of both).

Someone passed for something like? This is the last step for we definitely use here.

@ibrunotome, we’ve issued a task to a dev who wrote this guide to check things out. We’ll let you know asap.

Thanks. I’m using a clone of this project:, if this can help him to test/investigate.

1 Like

Hi @Octavia, any news about this issue? We planed to start to use in our team in this week.

Here my docker-compose.yml file, where laravel dusk works perfectly. See the shared networks between the containers, I think that’s maybe is the problem.

Sorry for not getting back to you earlier on that, @ibrunotome.

We’ve been investigating things and found a problem on your side. A replace has been made on the localhost phrase:
sed -i "s/localhost/$HOST_NAME/g" .env - you’ve got no localhost in this file; there’s only a hostname of your machine. Because of that, the replace fails to be made.

The thing is that the variable APP_URL in the .env should be set on this container’s address and that’s what the replace does.

Also, I can see that you’re using port 8080, so the APP_URL after switching should have such value, for instance:

I have a .env.example that I copy on every execution (with localhost) to make the replace with the host. But the 8080 on the .env in parallel with the terminal command really did the things work perfectly now!

I really appreciate your help @Octavia and this great product too. Thanks!

1 Like