Setting Up the p5.js Web Editor for Local Development: A Beginner-Friendly Guide

I am a developer from Nepal who loves playing with tech.
Search for a command to run...

I am a developer from Nepal who loves playing with tech.
No comments yet. Be the first to comment.
Have you ever translated something, only to find out later that the original text changed while you were working? Or worse — that a whole new page existed and nobody told you? For that, I built stub f
Before starting out, let me quickly share what we're building today. Open codesandbox.io or visit gsap-svg-path-animation.netlify.app. Seems interesting, let's start. Introduction You might have visited some websites where when you scroll, things mov...

Build a countdown social media og:image using nextjs and vercel/og

In the fast-paced world of web development, creating an engaging and seamless user experience is important. One effective way to achieve this is by implementing a loading animation on your website. In this tutorial, we'll explore the step-by-step pro...

The p5.js Web Editor is an intuitive, browser-based platform for creative coding with JavaScript. It allows artists, designers, and educators to dive into coding visually, without needing to set up any development environment. But what if you're a developer who wants to run the editor locally, contribute to its development, or customize it for your creative platform?
In this blog, we'll walk through the entire process of setting up the p5.js Web Editor locally, breaking it down into digestible steps—each explained with the “why,” not just the “how.” Whether you're contributing to open source for the first time or just want to tinker with a cool tool, this guide is for you.
If you want the official guide, you can visit this link: https://github.com/processing/p5.js-web-editor/blob/develop/contributor_docs/README.md. If you have a problem with this, follow this guide.
Running the p5.js Web Editor locally can benefit you in many ways:
✅ Customize or extend its features
✅ Contribute back to the open-source project
✅ Debug and explore the code (understand how real software is written)
✅ Work offline or in educational settings with limited (unstable) internet access
Let’s get started!
Before starting, please make sure you’ve a few tools installed on your system. These are the foundational pieces every JavaScript developer should be familiar with.
The editor is a Node.js application, so make sure you have:
Node.js v16.14.2
npm v8.5.0
To check the versions of node, use this command:
node -v
To check the version of npm, use this command:
npm -v
If you see a different version than the versions mentioned above, I recommend that you change to the mentioned version. There are multiple ways to do that. If you’re on linux, you might like this article:
Or, take this article and video attached as a guide.
However, I highly recommend using nvm (Node Version Manager) so you can manage multiple Node versions with ease.
To install nvm, open your terminal and run:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
After installing nvm, restart your terminal and then:
nvm install 16.14.2
nvm use 16.14.2
Verify:
node -v # Should show v16.14.2
npm -v # Should show v8.5.0
We’ll work with a fork of the original p5.js Web Editor repository so you can push your changes later if you want.
Click the Fork button (top right)
After forking, clone your copy to your machine:
git clone https://github.com/YOUR_USERNAME/p5.js-web-editor.git
Replace
YOUR_USERNAMEwith your github account username that you used to fork the repository.
After you clone the repository on your local system, let’s move to the folder inside:
cd p5.js-web-editor
Now, to view the code or to perform any operations on it, we need to open it up the code in an editor. I prefer VS Code, which is free to use. If you don’t have download it from here. However, if you have then you can use the following command on your terminal to open up the project inside the code editor.

Once you press Enter, you should see something like this:

Here’s a quick overview to make you feel at home in the codebase:
server/: Express backend server for authentication, file handling, etc.
client/: React-based frontend for the web editor
.env: Environment variables for sensitive settings
package.json: Declares dependencies, scripts, and metadata
If you try to start the server, you’ll receive an error message. That’s because the editor uses many libraries and dependencies. Installing them is straightforward:
npm install
This reads the package.json file and downloads all required modules into the node_modules directory.
If you run into issues, try cleaning the cache and reinstalling:
npm cache clean --force
rm -rf node_modules
npm install
Now that we have all the required packages, we can try starting the server. If you look at the package.json file, then you’ll find the start command:
npm start
However, this will give you some error. At the end of the message, you’ll find this: [nodemon] app crashed - waiting for file changes before starting... and on top it says: Error: Parameter "key" is required. To resolve this problem, you need to follow the following steps.
The Web Editor stores sketches and user information in a MongoDB database.
Follow the official guide for your OS:
👉 https://docs.mongodb.com/manual/installation/
Once installed, start the service:
mongod --dbpath /your/custom/path
Or, if you’ve a Mac, then you can install Homebrew to install any packages. If you don’t have Homebrew, paste the following command on your terminal to install it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Or, you can install the homebrew with the new .pkg installer. The instructions are here.
Here is how you can install and run MongoDB using brew:
brew tap mongodb/brew
Then
brew install mongodb-community
Finally, start the server with
brew services start mongodb-community
🧪 Tip: You can use MongoDB Compass to visually inspect your database and collections.
The project uses a .env file to store settings like database connections and GitHub OAuth credentials.
You don’t have to configure everything to run the app locally, but you still need a .env file.
cp .env.example .env
The above command makes a copy of .env.example file into .env file. You can open .env in a text editor and make changes later if you need GitHub login or production features.
With everything set, you can now start the server:
npm start
By default, the app will be available at:
You should see a fully working p5.js Web Editor interface!

During development, you might want to reset your database:
npm run reset-local-db
This clears all data and resets the state. Very handy for testing new features!
npm install✅ Try:
sudo chown -R $USER:$GROUP ~/.npm
✅ Check if MongoDB is running:
ps aux | grep mongod
✅ Or try restarting:
brew services restart mongodb-community
✅ You need to register a GitHub OAuth App and add your CLIENT_ID and CLIENT_SECRET to your .env.
If you’re planning to contribute, here are a few bonus tips:
Follow the code style and naming conventions in the existing codebase.
Open pull requests only after thoroughly testing your changes.
Be respectful and follow the code of conduct.
The p5.js Web Editor is more than just a playground—it's an ecosystem that empowers artists, students, and coders to express themselves through code. You gain full access to its engine room by running it locally, and play with it.
💬 Got stuck or found a bug in this guide? Feel free to leave a comment or contact me. If you find a bug in the p5.js web editor, open an issue on GitHub.
Happy hacking! 💻✨