My colleague Chris Ferris recently posted on how he got to run the Hyperledger Fabric natively on Mac. Knowing that I have a Windows machine he prompted me to try and do the same on Windows. So I did and here is what I can say about my experiment.


First, I need to say that in my case I have to put “natively” between quotes because the Windows machine I have is running Windows 7 and Docker doesn’t actually run natively on that version of Windows. Docker currently only runs natively on Windows 10. For older versions of Windows you have to use the Docker Toolbox which actually runs Docker in a linux VM.


If you haven’t installed VirtualBox yet you first need to do that. The installation is very straightforward, the only possible gotcha is that you need to make sure virtualization is on on your machine. This is set via the BIOS menu so if it doesn’t work you will need to reboot your machine to change that setting.

Having already installed VirtualBox on my machine I had that already taken care of.


As explained above I couldn’t run Docker natively on my machine so I installed Docker Toolbox. This was very straightforward. Once the installation ends you simply launch the “Docker Quickstart Terminal” and you’re on your way.

The command actually provisions a linux VM in VirtualBox with Docker. You can see the running VM by opening the VirtualBox Manager.

Note that on starting the Docker Quickstart Terminal I get an error message saying that bash: .bashrc: No such file or directory but that’s not a problem.

Hyperledger Fabric

You then need to create a file docker-compose.yml similar to the one Chris created for running on Mac.

To make it easy you can simply copy paste the following or copy compose-defaults.yml from the fabric distribution and then make the same two changes Chris discussed to 1) change the endpoint and 2) add a port mapping.

Your docker-compose.yml file should then contain the following:

  image: hyperledger/fabric-peer
    - "5000:5000"
    - CORE_VM_ENDPOINT=http://localhost:2375
    # TODO:  This is currently required due to BUG in variant logic based upon log level.
  # Startup of peer must be delayed to allow membersrvc to come up first
  command: sh -c "sleep 5; peer node start"
  #command: peer node start
  # Use these options if coverage desired for peers
  #image: hyperledger/fabric-peer-coverage
  #command: ./peer.test --test.coverprofile=coverage.cov node start
   image: hyperledger/fabric-membersrvc
   command: membersrvc

With this being done you can then fire up an Hyperledger Fabric peer with the following command:

docker-compose up

This will fetch the Hyperledger Fabric container from the cloud using Docker Hub and launch it within the VM that is running.

This may take a bit of time at first as it downloads the workload from the net but eventually you should start seeing log messages scrolling through your terminal window indicating that the Fabric peer is running and waiting for requests like this:

[36mvp_1          |[0m 21:06:38.558 [rest] StartOpenchainRESTServer -> INFO 030[0m Initializing the REST service on, TLS is disabled.
[36mvp_1          |[0m 21:06:44.558 [peer] ensureConnected -> INFO 031[0m Touch service indicates no dropped connections
[36mvp_1          |[0m [36m21:06:44.558 [peer] ensureConnected -> DEBU 032[0m Connected to: []
[36mvp_1          |[0m [36m21:06:44.558 [peer] ensureConnected -> DEBU 033[0m Discovery knows about: []
[36mvp_1          |[0m 21:06:50.558 [peer] ensureConnected -> INFO 034[0m Touch service indicates no dropped connections

Up to that point my experience had been so smooth it made me wonder if it was really running! So, I decided to go one step further and try to connect to it and check that it was indeed running.

Connecting to your peer

There are different ways one can interact with an Hyperledger Fabric peer but of course the easiest way to do a simpe test is to use the REST API. That’s the power of the web, all you need is a web browser.

One very simple request you can make to your peer is for the list of peers running in the network. This can normally be done by pointing your browser to: https://localhost:5000/network/peers

Unfortunately this is where things became difficult for me. First, I already knew that port 5000 isn’t available on Windows. It is used by the OS so you have to map it to a different port, say 3000.

At this point I thought all I had to do was to change my docker-compose.yml file to map port 3000 to 5000 but that didn’t work. It took me a while to understand but after many tries I figured it out so I’ll just give you the solution and spare you with my fruitless wandering.

What you need to understand is that in this setup, with the Docker Toolkit, you actually have two different levels of port mapping. First there is a mapping between the container and the linux VM docker runs in, then there is a mapping between the linux VM and Windows. The mapping specified in your docker-compose.yml file only affects the former. For the latter you need to set that on VirtualBox.

To set the second mapping launch the VirtualBox Manager.

Select the running VM called “default”. Click on “Settings”. Select “Network”.

Open the “Advanced” section and click on “Port Forwarding”. Click the “Adds new port forwarding rule” button on the right (the green diamond with a plus sign). Then set Host Port to 3000 and Guest Port to 5000.


Click Ok. That’s it.

Now, point your browser to https://localhost:3000/network/peers
You should get a page returned from your running peer listing one peer:


Congratulations! You have successfully connected to your peer.

18 comments on"Running Hyperledger Fabric “Natively” on Windows"

  1. Philip Bawa August 25, 2016

    Installed through your instructions in Ubuntu Xenial, but where are we supposed install docker-compose.yml?

    docker ps and docker-compose up are throwing blanks.

    • Philip Bawa August 25, 2016

      $ whereis docker
      copied the docker-compose.yml into all the paths
      Now from docker ps:

      root@philip-MXC061:/home/philip# docker ps
      /usr/bin/docker: line 1: vp:: command not found
      /usr/bin/docker: line 2: image:: command not found
      /usr/bin/docker: line 3: ports:: command not found
      /usr/bin/docker: line 4: -: command not found
      /usr/bin/docker: line 5: environment:: command not found
      /usr/bin/docker: line 6: -: command not found
      /usr/bin/docker: line 7: -: command not found
      /usr/bin/docker: line 9: -: command not found
      /usr/bin/docker: line 11: command:: command not found
      /usr/bin/docker: line 17: membersrvc:: command not found
      /usr/bin/docker: line 18: image:: command not found
      /usr/bin/docker: line 19: command:: command not found

    • You can just put that file anywhere you want, by default docker-compose will look for the file in the current directory. If you have it somewhere else you will need to tell docker-compose where to find it through command line options:

      docker-compose -f yourfile

  2. Sandeep Saxena November 25, 2016

    Excellent step by step guide @Lehors, thanks for that. Can you please also suggest on ways to connect through a proxy – where do i do the proxy config? Am running Windows 10 so the Virtual Box was not required and was able to run the peer on an open network as per the above instructions but when I came into my work env, and tried to startup, it would not – figure that’s a proxy issue but how do i deal with it?

  3. December 07, 2016

    please let me know how to setup hyperledger for making blockchains.
    I need step by step procedure for windows 7.
    ping me some docs on

  4. Rasmus Thorsøe January 19, 2017

    I am having some problems getting this running. The peer and the membersrvc appear to be running fine, i am getting the same console output as you. I changed the port forwarding in the .yml file to 3000:5000 (also tried 5000:3000 as i was not sure which one) . I also added the port forwarding in VirtualBox, as per the screenshot. However when i go to https://localhost:3000/network/peers i am getting connection reset/aborted. Any ideas as to what the problem might be? In the console it also does not seem like the peer has received anything.

  5. Hi, I am a beginner in blockchain technology.
    Could you please help me with installation process of hyperledger fabric on windows 7.
    I mean to say i am confused with what has to be installed and what not. i find so many dockers ,node.js sdks etc etc.
    It would be of great help if get to know the step by step process.

  6. alekseygrud March 02, 2017

    An excellent guide

  7. […] Execute o Hyperledger Fabric nativamente no Windows […]

  8. It is very helpful. Thanks.

  9. Matthias Kloppmann April 19, 2017

    Thanks for the instructions and comments, had most of it running already, but was struggling getting the ports opened up to my local (Win7) machine – now that works.
    My next step is to get a local instance of Fabric Composer to connect to it. I can see a connection profile embedded in the docker-compose.yml file (which I got from the Fabric Composer Getting Started tutorial), so that part should be obvious. However: Where do I have to physically put the connection profile on Windows? I know it needs to go into $HOME/.composer-connection-profiles, but what is the Win equivalent of that?

  10. […] started with this post. The post is clean and perfectly what I needed. It mentions that since native Docker is […]

Join The Discussion

Your email address will not be published. Required fields are marked *