Deploy the Playground Locally

Table of Contents


In this ThreeFold guide, we explore how to deploy the ThreeFold Playground locally on either Test net or Main net.

In brief, you will need to clone the Playground repository, install the prerequisites, adjust your network config file and run the playground. You will then be able to access the local playground by using a web browser. Make sure to have an Internet connection while running the playground.

Playground Prerequisites

The main prerequisites to run the playground are NodeJS and Yarn. You will also need Make to build the Playground executables.

If you plan on using a web server, you will need to install NGINX or Caddy and to use Make to build a production build.


NodeJS is an open-source, cross-platform JavaScript runtime environment.


Yarn is a package manager that doubles down as project manager.


Make is a build automation tool that builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program.


Nginx is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache.


Caddy is an extensible, cross-platform, open-source web server written in Go. At its core, Caddy is an extensible platform for deploying long-running services ("apps") using a single, unified configuration that can be updated on-line with a REST API.

Deploy the Playground Locally

  • Install the prerequisites

    • You can use Homebrew to install the prerequisites:
      • NodeJS (Use Node 18 for the current Playground)
        • brew install node@18
      • Yarn
        • brew install yarn
      • Make
        • brew install make
    • Clone the repository
      • git clone
        cd tfgrid-sdk-tf
    • Set the config.js file
      • Set the permissions to run the script
        • chmod u+x packages/playground/scripts/ 
      • Go to the public directory
        • cd packages/playground/public
      • Update the script for either Test or Main net
        • MODE=test ../scripts/
        • MODE=main ../scripts/
      • Go back to the playground directory
        • cd ..
    • Build the Playground
      • yarn install
        make build
  • Run the Playground in Development mode

    • make run project=playground
  • Open a browser and reach the local URL shown (usually localhost:5173)

Manual Configuration

If you do not want to use the script, you can also configure manually the file config.js.

You need to adjust the content of the file config.js with the path ./packages/playground/public of the repository tfgrid-sdk-ts. Simply replace the file content with the following matching the correct network.

Test Net

window.env = {
  NETWORK: "test",
  SUBSTRATE_URL: "wss://",

Main Net

window.env = {
  NETWORK: "main",

Fund Your TFChain Account

To test the Playground, you need some TFT in your TFChain wallet. You can learn more about TFT and how to acquire some tokens by reading this section of the TF Manual.

Exploring the Playground Locally

If you deploy on Test or Main networks, you can access the same experience as the official TF Playground website. Any workloads you deploy will be reflected on the matching Playground website. If you deploy a new weblet, you will see it in the Contracts section of the online Playground website version.

If you make any change to a weblet, you will be able to test it immediately. This is a good environment to test new weblets or adjust existing weblets.


You now have the basics to deploy the Playground locally and experience directly changes in the code. You could explore further the Playground in various ways.

For example, you could build a new Linux distro FList with the ThreeFold Zero-OS Hub and add it to the Micro VM weblet of the Playground. You could also create a whole new weblet starting from the template of another existing weblet.

Feel free to develop your own version of the Playground and to share your results with the ThreeFold community.

If you have any questions, you can ask around on the ThreeFold Forum.