Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mkdesign82's avatar

Run Dusk in production mode

Hi every one

Do you know why it's a danger to run dusk in production mode?

0 likes
10 replies
crnkovic's avatar

Because Dusk literally opens your browser, types stuff, does stuff here and there, it literally reruns your migrations, puts your app into weird place during the tests with overriding .env file, etc. It could screw up your entire db. Don't do that.

rawfan's avatar

I came across this, because I want to run Dust in production as a scraper with a minimal UI. The current version of the DuskServiceProvider actually prevents the login routes being registered in production.

Annaro's avatar

I'm working on a robot/scraper too, and need to run Dusk on a remote server. I'm a beginner with Laravel and even more so with Dusk, so i did not quite understand what you mentioned about the DuskServiceProvider. Are you saying it will be impossible to run Dusk in production? Or else, do you know what to do to make it work? Currently i get the following error:

Facebook\WebDriver\Exception\WebDriverCurlException Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["--disable-gpu","--no-sandbox"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"args":["--disable-gpu","--no-sandbox"]}}} Failed to connect to localhost port 9515: Connection refused

Is it "normal"? Is there a way to make it work?

1 like
argonzalez's avatar

Does Goutte run the Javascript on the page before scraping?

silverhand's avatar

@automica is there any way to run Javascript on the scrapper with PHP? I have the same concern as @annaro and planning to use Dusk to run JavaScript to gather elements and load the SPA. I guess Goutte seems outdated in my case.

uteq's avatar

@silverhand I am currently looking for the same kind of solution. Did you already find a solution?

1 like

Please or to participate in this conversation.