p5.party sketches need to connect to a server in order to synchronize their data.

You don’t necessarily need to set up your own server. You can get started with p5.party using the p5.party example server. If you are new to p5.party take a look at connecting to the server before you consider setting up your own.

If you are running a class or want to ensure long term availability you can set up your own server pretty easily. You don't need to set up a server for each sketch, a single server can support many sketches at once. If you are teaching a class or running a workshop with p5.party, you can set up a single server ahead of time for everyone to share. If you are using p5.party on your own, you'll need to set up your own server.

<aside> 🧟 Currently, p5.party uses a deepstream server for the backend. Be aware that deepstream is in maintenance mode and may receive minimal updates moving forward. I'm unsure what this might mean for p5.party. It might mean that migrating to p5.party to another backend will be needed down the road. For now though, deepstream has proven to be a reliable, stable back end.

</aside>

The easiest way to set up your own server for p5.party is to fork the p5.party repo—which includes a preconfigured deepstream server—and use Heroku to host it. Heroku is a cloud platform that supports multiple languages and makes the process of deploying apps easier. With Heroku you don't need to set up your own server hardware or software, you can run an app in a software container right from a Github repo.

<aside> 🧟 Heroku is phased out their free hosting tier near the end of 2022. As of 2024, hosting on heroku is around $8/month

</aside>

To set up your own server follow the directions below. These directions assume you are somewhat familiar with Git and Github already.

  1. Fork jbakse/p5.party repository on Github. See here for more information on forking repositories.
  2. Create a Heroku account and log in.
  3. From the main dashboard select New » Create New App
    1. Enter a name for your app in App name You'll need to pick your own, unique name.
    2. Your account name should already appear in the App owner field.
    3. Choose the region closest to you and your users.
    4. Click Create app.
  4. You should be taken to the Deploy tab for the project.
    1. Select Github as the Deployment method
    2. If you belong to multiple github organizations, select the one you used to fork the repo.
    3. Type part of the name of your fork and hit Search. You should see your fork in the resulting list.
    4. Click the Connect button next to your fork.
    5. In Manual deploy, verify that the master branch is selected and then click Deploy Branch.
    6. Heroku will pull the source from your branch and launch the server. This may take a few minutes.
    7. If all went well, you should now have your own server running on Heroku. Click Open app to open the server in the browser.
      1. If starting the server worked, you will see "Endpoint not found".
      2. If it was unsuccessful you will see "There's nothing here, yet".
  5. Point your p5.party sketch at the new server.
    1. Use the domain of your server—something like yourserver.herokuapp.com—when you call partyConnect() in your sketch.

That's it! Hopefully your sketch is now working with your new server!