# How to set host and port with dfx start on dfx 0.12

**URL:** <https://forum.dfinity.org/t/how-to-set-host-and-port-with-dfx-start-on-dfx-0-12/15781>\
**Category:** Developers\
**Created:** [October 6, 2022, 8:08pm UTC](https://forum.dfinity.org/t/how-to-set-host-and-port-with-dfx-start-on-dfx-0-12/15781 "2022-10-06T20:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lastmjs](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lastmjs/32/3406_2.png) [@lastmjs](https://forum.dfinity.org/u/lastmjs)\
**Post date:** [October 6, 2022, 8:08pm UTC](https://forum.dfinity.org/t/how-to-set-host-and-port-with-dfx-start-on-dfx-0-12/15781/1 "2022-10-06T20:08:46Z")

</div>

I’ve upgraded to dfx 0.12.0-beta.3 and it seems like the port of the replica is changing randomly. That’s a big problem because our Node.js tests have to specify a host and port, which used to be 127.0.0.1:8000.

How do we set the port when using `dfx start`? Also this is kind of a major change in behavior, I’m not sure it should just be pushed out with dfx 0.12

---

<div class="post-metadata">

**Author:** ![lastmjs](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lastmjs/32/3406_2.png) [@lastmjs](https://forum.dfinity.org/u/lastmjs)\
**Post date:** [October 6, 2022, 8:36pm UTC](https://forum.dfinity.org/t/how-to-set-host-and-port-with-dfx-start-on-dfx-0-12/15781/2 "2022-10-06T20:36:03Z")

</div>

Apparently the `networks` property in `dfx.json` is what I want. But this isn’t working. Here is my dfx.json:

```json
{
    "canisters": {
        "azle": {
            "type": "custom",
            "build": "npx azle azle",
            "root": "canisters/azle",
            "ts": "canisters/azle/index.ts",
            "candid": "canisters/azle/index.did",
            "wasm": "target/wasm32-unknown-unknown/release/azle.wasm",
            "declarations": {
                "output": "dfx_generated/azle"
            }
        },
        "motoko": {
            "type": "motoko",
            "main": "canisters/motoko/main.mo",
            "declarations": {
                "output": "dfx_generated/motoko"
            }
        },
        "rust": {
            "type": "rust",
            "package": "rust",
            "candid": "canisters/rust/src/lib.did",
            "declarations": {
                "output": "dfx_generated/rust"
            }
        }
    },
    "networks": {
        "local": {
            "bind": "127.0.0.1:8000",
            "type": "ephemeral"
        }
    }
}

```

But running dfx start is still using the wrong port:

```bash
Running dfx start for version 0.12.0-beta.3
Using project-specific network 'local' defined in /home/lastmjs/development/azle/examples/query/dfx.json
WARN: Project-specific networks are deprecated and will be removed after February 2023.
Dashboard: http://localhost:36805/_/dashboard

```

---

<div class="post-metadata">

**Author:** ![lastmjs](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lastmjs/32/3406_2.png) [@lastmjs](https://forum.dfinity.org/u/lastmjs)\
**Post date:** [October 6, 2022, 8:40pm UTC](https://forum.dfinity.org/t/how-to-set-host-and-port-with-dfx-start-on-dfx-0-12/15781/3 "2022-10-06T20:40:40Z")

</div>

Nevermind, the dashboard port was throwing me off. Instead of a local `networks` property, it is also possible to use the `REPLICA_PORT` environment variable like this: `REPLICA_PORT=8000 dfx start --clean`
