# Trouble with local development on WSL2

**URL:** <https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688>\
**Category:** Developers\
**Created:** [June 2, 2021, 9:34pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688 "2021-06-02T21:34:40Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 2, 2021, 9:34pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/1 "2021-06-02T21:34:41Z")

</div>

Hi, I am new to the Internet Computer. Since I have a PC, I am running the Internet Computer on WSL2. I am currently following this guide for local development: [Local development :: Internet Computer](https://sdk.dfinity.org/docs/quickstart/local-quickstart.html)  
I followed every step exactly, however when I run “dfx deploy” I get the error “Could not reach the server: error sending request for url ([http://127.0.0.1:8000/api/v1/status](http://127.0.0.1:8000/api/v1/status)): error trying to connect: tcp connect error: Connection refused (os error 111)”. I don’t know what the source of this error is, but it prevents me from running any canister and I’m unable to run anything as basic as a “hello world” application. Any help whatsoever would be really appreciated! Thank you so much!

---

<div class="post-metadata">

**Author:** ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)\
**Post date:** [June 2, 2021, 11:01pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/2 "2021-06-02T23:01:45Z")

</div>

Do you also have `dfx start` running in another terminal? You’ll need both that and the terminal you’re deploying from, and both should be in the project directory. This might be the issue.

---

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 2, 2021, 11:33pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/3 "2021-06-02T23:33:25Z")

</div>

Thank you for your response! I followed the Local Development tutorial exactly, which included running _dfx start_ in another terminal, so unfortunately that’s not the issue. Would there be any reason for _dfx start_ or _dfx deploy_ to error out in any way?

---

<div class="post-metadata">

**Author:** ![nerdoutcj](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nerdoutcj/32/3234_2.png) [@nerdoutcj](https://forum.dfinity.org/u/nerdoutcj)\
**Post date:** [June 3, 2021, 2:36am UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/4 "2021-06-03T02:36:14Z")

</div>

When you run `dfx start`, do you see any abnormality in the terminal log messages?

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [June 3, 2021, 10:44am UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/5 "2021-06-03T10:44:34Z")

</div>

I believe when I tried using WSL2 and Ubuntu 20.04, I used

`dfx start --background`

to run dfx in the same terminal, and it worked.

The replica is quite verbose when it runs and will log lots of messages, most of them benign, which can be annoying when running in the same terminal. I think this is why using a second terminal is recommended.

If you could quote some of the output you see on running `dfx start` we might be able to offer more help. If you can’t quote the warnings because the forum doesn’t like the content (you see at 403 error), just post a screenshot instead.

---

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 3, 2021, 4:16pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/6 "2021-06-03T16:16:28Z")

</div>

![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/8/8f36c8b02829d6cf0f9691e9edba8807900b1c75.png)  
This is what it looked like when I ran dfx start, and I screenshotted what appeared to be an abnormality. Is this unusual?

---

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 3, 2021, 4:18pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/7 "2021-06-03T16:18:19Z")

</div>

![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/6/60051854c1ff208333fdb5bd252501c35eefe870.png)  
This is what it looked like when I ran dfx start --background. I’m fairly certain this is an error, but does this give any indication as to what is going wrong? Still can’t run dfx deploy.

---

<div class="post-metadata">

**Author:** ![prithvi](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@prithvi](https://forum.dfinity.org/u/prithvi)\
**Post date:** [June 3, 2021, 5:04pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/8 "2021-06-03T17:04:23Z")

</div>

What version of dfx are you using? is it `0.7.0` or `0.7.1`?

---

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 3, 2021, 5:20pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/9 "2021-06-03T17:20:58Z")

</div>

When I ran dfx --version it says 0.6.26. Would I need to upgrade to 0.7.0? If so how would I do that?

---

<div class="post-metadata">

**Author:** ![prithvi](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@prithvi](https://forum.dfinity.org/u/prithvi)\
**Post date:** [June 3, 2021, 5:27pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/10 "2021-06-03T17:27:42Z")

</div>

`DFX_VERSION=0.7.1 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"`

You can run that. And let’s see if the error is still reproducible.

---

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 3, 2021, 6:23pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/11 "2021-06-03T18:23:12Z")

</div>

Thank you for your response. I updated to 0.7.1 and ran through the instructions again. When running dfx start I got the following:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/8/809e3da9bcdab5e327d1a361a69a44ced55c2561.png)  
and then when I ran dfx deploy I got this error:  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/0/00abb6ed98dca005e235d0a284e620a579e6b76b.png)  
which I think is the same error I got beforehand. Not entirely sure if anything changed in terms of the error?

---

<div class="post-metadata">

**Author:** ![livelyx](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/livelyx/32/1047_2.png) [@livelyx](https://forum.dfinity.org/u/livelyx)\
**Post date:** [June 3, 2021, 7:08pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/12 "2021-06-03T19:08:54Z")

</div>

What WSL image are you running? I believe that Ubuntu 20 is what is currently recommended for WSL.

---

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 3, 2021, 7:26pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/13 "2021-06-03T19:26:36Z")

</div>

Just checked, currently running Ubuntu 20.04.2 on WSL 2 .

---

<div class="post-metadata">

**Author:** ![nerdoutcj](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nerdoutcj/32/3234_2.png) [@nerdoutcj](https://forum.dfinity.org/u/nerdoutcj)\
**Post date:** [June 3, 2021, 8:06pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/14 "2021-06-03T20:06:51Z")

</div>

Try to install sdk and create all your projects under the Linux home location. Once you start terminal do `cd ~` and go from there.

---

<div class="post-metadata">

**Author:** ![rban](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rban](https://forum.dfinity.org/u/rban)\
**Post date:** [June 3, 2021, 8:28pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/15 "2021-06-03T20:28:27Z")

</div>

Once I did cd ~ and ran everything again it worked! Thank you so much!! Everything seems to be working perfectly now

---

<div class="post-metadata">

**Author:** ![nerdoutcj](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nerdoutcj/32/3234_2.png) [@nerdoutcj](https://forum.dfinity.org/u/nerdoutcj)\
**Post date:** [June 3, 2021, 8:38pm UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/16 "2021-06-03T20:38:49Z")

</div>

Awesome!

Apparently, having projects under your Windows home location (mounted drive) is not advisable.

C.J

---

<div class="post-metadata">

**Author:** ![thiagodesnferreira](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thiagodesnferreira/32/2308_2.png) [@thiagodesnferreira](https://forum.dfinity.org/u/thiagodesnferreira)\
**Post date:** [June 18, 2021, 6:08am UTC](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688/17 "2021-06-18T06:08:31Z")

</div>

That solution definitely works for me! @nerdoutcj Thanks for sharing! If you are using Windows you definitely should follow this advice! 🤩
