# Dfx on windows for beginners

**URL:** <https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194>\
**Category:** Community Tutorials & Video\
**Tags:** Video\
**Created:** [November 17, 2019, 7:00pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194 "2019-11-17T19:00:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [November 17, 2019, 7:00pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/1 "2019-11-17T19:00:52Z")

</div>

this is a small video i made for beginners to get the sdk to run under windows. its the first time for me to do something like this so i would appreciate your feedback 🙂  
i know the audio is a bit off and the video is longer than necessary 😃  
if you have topics you want to cover via video make sure to hit me up and ill add them to the mission control youtube channel!

---

<div class="post-metadata">

**Author:** ![rckprtr](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/rckprtr/32/809_2.png) [@rckprtr](https://forum.dfinity.org/u/rckprtr)\
**Post date:** [November 17, 2019, 9:53pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/3 "2019-11-17T21:53:28Z")

</div>

I use Windows 10 and you can do this without a VM.

Install Windows Subsystem Linux 2 Ubuntu:

> **[Install WSL 2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install)**
>
> Installation instructions for WSL 2

Install Visual Studio 2 Insiders which allows you to code in your Windows 10 Environment to your Ubuntu Environment. VSCode Insiders is a different application then VSCode, so your default VSCode should remain unchanged.

> **[Download Visual Studio Code Insiders](https://code.visualstudio.com/insiders/)**
>
> For early adopters, you can get the latest release of VS Code each day with the Insiders Build. Available on Mac, Linux and Windows.

- Open a Command Prompt [Windows]
- Type `wsl` and now you should be in the Ubuntu Terminal
- Install Dfinity `sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"`  
or follow [https://sdk.dfinity.org/developers-guide/quickstart.html](https://sdk.dfinity.org/developers-guide/quickstart.html)
- cd into `hello` project.
- type `code .` which should open a VS Insider window.
- Open a new Terminal in VSCode Insiders and type `dfx start`
- Open another Terminal and install/run `hello` project

Note: When you open a terminal within VSCode Insiders, it should be in the same path as your `hello` project.

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [November 18, 2019, 12:07am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/4 "2019-11-18T00:07:50Z")

</div>

oh wow, thanks for sharing this! sure makes things a lot easier 🤔

---

<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:** [November 18, 2019, 12:43am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/5 "2019-11-18T00:43:15Z")

</div>

Excellent video!

Virtualbox is still a good catch-all solution across all Windows versions.

Yes Windows 10 users can use WSL if they like. But depending on how frugal you are with updates you might not have it on Windows 10 Home yet.

Some might like being able to dump a VM and start again too.

---

<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:** [November 18, 2019, 12:44am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/6 "2019-11-18T00:44:34Z")

</div>

Great guide. VSCode might have WSL integration in the main release now, so you may not need the insider build? Worth a check.

---

<div class="post-metadata">

**Author:** ![rckprtr](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/rckprtr/32/809_2.png) [@rckprtr](https://forum.dfinity.org/u/rckprtr)\
**Post date:** [November 18, 2019, 1:15am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/7 "2019-11-18T01:15:30Z")

</div>

Good conversation to start.

---

<div class="post-metadata">

**Author:** ![EdmundDFN](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/edmunddfn/32/42_2.png) [@EdmundDFN](https://forum.dfinity.org/u/EdmundDFN)\
**Post date:** [November 18, 2019, 3:35am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/8 "2019-11-18T03:35:48Z")

</div>

Epic tutorial!!! Thanks for sharing @cryptoschindler

---

<div class="post-metadata">

**Author:** ![Alexey](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alexey/32/41_2.png) [@Alexey](https://forum.dfinity.org/u/Alexey)\
**Post date:** [November 18, 2019, 4:52am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/9 "2019-11-18T04:52:54Z")

</div>

Thanks, Moritz 👋 You definitely have YouTube blogger skills 👍 Nice English and explanation of SDK running.

---

<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:** [November 18, 2019, 3:41pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/10 "2019-11-18T15:41:12Z")

</div>

Ok, so the main release of VSCode lets you do this now too (you might need to close VSCode after the first run and then run code . again). So thanks Rick, between these two guides all Windows devs should be covered.

You’ll know you’re connected when you can see WSL at the bottom left of the VSCode application window. You can always start and manage WSL connections from here too.

---

<div class="post-metadata">

**Author:** ![dukakis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dukakis/32/48_2.png) [@dukakis](https://forum.dfinity.org/u/dukakis)\
**Post date:** [November 19, 2019, 11:32pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/11 "2019-11-19T23:32:47Z")

</div>

Thanks for your contributions @cryptoschindler

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [November 24, 2019, 8:24pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/12 "2019-11-24T20:24:33Z")

</div>

if you dont want to go through the installation process of the virtual machine, you can just download a virtualbox image instead!

check out this very handy project 🙂  
[https://www.osboxes.org/virtualbox-images/](https://www.osboxes.org/virtualbox-images/)

make sure to read their FAQ for the username and password of the installation!

---

<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:** [November 26, 2019, 4:02pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/13 "2019-11-26T16:02:15Z")

</div>

A very clear step by step guide to getting Windows Subsystem for Linux set up and connected to VSCode (you can skip the python bit in the middle):

> **[Work in Windows Subsystem for Linux with Visual Studio Code](https://code.visualstudio.com/docs/remote/wsl-tutorial)**
>
> Work in Windows Subsystem for Linux with Visual Studio Code

Edit: link updated

---

<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:** [November 26, 2019, 4:05pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/14 "2019-11-26T16:05:53Z")

</div>

So for new readers here, there are 2 good options for Windows users:

- Installing Ubuntu on a VM using VirtualBox (all Windows versions).
- Installing Windows Subsystem for Linux and connecting to it with VSCode (Windows 10).

You can then install the DFINITY Canister SDK on the command line (terminal) in either of these.

---

<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:** [April 27, 2020, 10:02pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/15 "2020-04-27T22:02:27Z")

</div>

You might be getting errors with canister installs on WSL version 1 (the current non-insider build). It seems that the VSCode WSL server holds onto files while open. Killing the server frees the files up and canister installs run fine then, you can do this by closing the WSL connection from the bottom left of VSCode.

WSL v2 is in the next public Windows 10 build, expected in the next few weeks, which hopefully should resolve this.

---

<div class="post-metadata">

**Author:** ![senior.joinu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/senior.joinu/32/9240_2.png) [@senior.joinu](https://forum.dfinity.org/u/senior.joinu)\
**Post date:** [May 5, 2020, 9:58pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/16 "2020-05-05T21:58:55Z")

</div>

This is also possible to create dfx docker container and use it everywhere you need.

1. Download dfx’s `install.sh`
2. Remove or comment these lines from it (explained below):

```auto
    #need_cmd sudo
    #if ! confirm_license; then
    # echo "Please accept the license to continue."
    # exit
    #fi

```

1. Make a Dockerfile with something like this:

```auto
FROM ubuntu:18.04

RUN apt-get update
RUN apt-get install curl -y

COPY install.sh install.sh
RUN sh install.sh

WORKDIR /root/dfx
ENTRYPOINT ["/usr/local/bin/dfx"]

```

1. Then just use `docker run` with correct mounting

Unfortunately, to make it work, we should remove lines responsible for showing the license agreement, which we are not allowed to remove legally. So please, don’t use this method unless you know what are you doing. Why should we remove these lines? Because the agreement is interactive but docker doesn’t support interactive build. So we are absolutely not allowed to share a docker image like this.  
Maybe, it is possible to make legally correct docker image by including licence agreement process into Dockerfile itself (each time you run the container you should accept the agreement). This approach makes the license agreement a little annoying, but let’s anyone use dfx under any system supporting docker and also keeps it’s legal strength IMO.

I’m not a lawyer, just saying that from technical point of view this can be achieved easily.

---

<div class="post-metadata">

**Author:** ![zhugepangpang](https://avatars.discourse-cdn.com/v4/letter/z/e68b1a/32.png) [@zhugepangpang](https://forum.dfinity.org/u/zhugepangpang)\
**Post date:** [May 6, 2020, 12:58pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/17 "2020-05-06T12:58:00Z")

</div>

I’m ready to start learning！

---

<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 1, 2020, 11:22am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/18 "2020-06-01T11:22:54Z")

</div>

The latest public Windows 10 release resolves this (version 2004) by supporting WSL v2.

A guide to installing WSL v2 is here: [https://docs.microsoft.com/en-us/windows/wsl/install-win10](https://docs.microsoft.com/en-us/windows/wsl/install-win10)

---

<div class="post-metadata">

**Author:** ![atom](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@atom](https://forum.dfinity.org/u/atom)\
**Post date:** [August 25, 2020, 8:55pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/19 "2020-08-25T20:55:46Z")

</div>

Thank you, it was really useful! 🙂

---

<div class="post-metadata">

**Author:** ![Jessica](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jessica/32/2048_2.png) [@Jessica](https://forum.dfinity.org/u/Jessica)\
**Post date:** [June 3, 2021, 11:30pm UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/20 "2021-06-03T23:30:40Z")

</div>

I am so happy I found this post I think it’s going to be easier on me to install everything now . Thank u

---

<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 4, 2021, 12:18am UTC](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194/21 "2021-06-04T00:18:27Z")

</div>

Just make sure you work off the Linux home location. There are some issues when the location of the projects is on the mounted drives mapped to the Windows home location.

See [Trouble with local development on WSL2](https://forum.dfinity.org/t/trouble-with-local-development-on-wsl2/4688)

C.J

[Next page](https://forum.dfinity.org/t/dfx-on-windows-for-beginners/194.md?page=2)
