Cardano Academy
Search…
3. Starting Plutus Playground

Start the Playground server

Go to Plutus repository root dir, then run nix-shell:
1
cd plutus
2
nix-shell
Copied!
This is gonna take a while, after downloading binary caches and building, you will see your command line having prefix [nix-shell:~/plutus]$
Go to the plutus-playground-client folder, and start the Playground server:
1
cd plutus-playground-client
2
plutus-playground-server
Copied!

Start the Playground client

Open another terminal, also go to Plutus root dir and enter nix-shell:
1
cd plutus
2
nix-shell
Copied!
Go to the plutus-playground-client folder, and start the Playground client:
1
cd plutus-playground-client
2
npm run start
Copied!
After you see Compiled successfully.in your console, the Playground should be running at port 8009.

Access to your Playground

If you are running the Playground at your local machine, you can open https://localhost:8009 in your browser, and you are good to go.
If there are security warnings in your browser, just ignore it and click continue to the page.
However, if you are running the Playground on one desktop/server/vm, and you want to access to it from another computer, you need to let Playground listen on 0.0.0.0:8009 rather than localhost:8009
What you need to do is, add host: '0.0.0.0', to plutus/plutus-playground-client/webpack.config.js file, it should look like this after editing:
1
devServer: {
2
contentBase: path.join(__dirname, "dist"),
3
compress: true,
4
host: '0.0.0.0',
5
port: 8009,
6
https: true,
7
proxy: {
8
"/api": {
9
...
Copied!
Go to your second nix-shell , abort the process by hitting Crtl+C and rerun npm run start .
Now you should be able to access your Playground with https://your-server-ip:8009
Have fun with your Playground! :D
If you are running the Playground on a cloud server, don't forget to open the port on the firewall.