DM_SERVICE_PORT is ignored

Hi

I’m running defold on Linux, the problem is variable DM_SERVICE_PORT is ignored when opening the editor

I’ve set export DM_SERVICE_PORT=8001. But when running the editor, the editor still runs on random port

util.http-server - {:line 376, :msg "Http server running", :local-url "http://localhost:44085"}

Because of firewall i need the editor to keep using the same port.

Is there any other way to set the http port?

Thank you

That’s correct, DM_SERVICE_PORT is ignored in that case (defold/engine/docs/DEBUG_PORTS_AND_SERVICES.md at dev · defold/defold · GitHub). It’s a bit silly to be honest and I think it’s something we should change. Can you please open a feature request on GitHub?

Hi!

I currently have the same problem with Defold v1.12.4. I’m using Kubuntu 24.04. When I try to run Defold (standalone executable) from terminal with DM_SERVICE_PORT=8001 ./Defold or with export DM_SERVICE_PORT=8001 + ./Defold, the editor still runs in random port:

util.http-server - {:line 380, :msg "Http server running", :local-url "http://localhost:41785"}

Is there still something that I’m missing? Or should I create a new issue ticket? I saw that the previous issue was fixed by Check ENV and validate DM_SERVICE_PORT by JosephFerano · Pull Request #11407 · defold/defold · GitHub. But I have still the issue in v1.12.4. I also tested v1.11.2 and v1.12.0 but the issue reproduces also in these.

1 Like

For the record if someone has the same issue I had: --port argument seems to work and changes the port of the HTTP server (documented in here: Automating the Defold editor with HTTP). For example, running ./Defold --port 7777 works for me and the port is changed to 7777. Maybe DM_SERVICE_PORT is not correct parameter in my use case.