Skip to content
Pug Network Docs Open the app

Self-hosting

Deploy on Render

The fastest path to your own Pug Network instance: connect a fork to Render, set one option, and you have a live deployment in a few minutes. No database, no secrets, no extra services.

Heads up

The repository is a monorepo. The JavaScript implementation lives in the pugnetwork-js subdirectory. You must set Render's "Root Directory" to pugnetwork-js or Render will not find render.yaml or package.json.

First-time deploy with a Render Blueprint

  1. Fork or connect the pugnetwork-socket repository to your Render account.
  2. In the Render dashboard, click New → Web Service.
  3. Select the repository.
  4. Set Root Directory to pugnetwork-js before saving. This is the critical step.
  5. Render reads render.yaml from inside that subdirectory and auto-fills npm install and npm start.
  6. Confirm the environment variables (see below — there are only two, and one is automatic).
  7. Click Create Web Service.

Every subsequent git push to the connected branch triggers an automatic redeploy.

Migrating an existing service

If you already have a Render service pointing to the repository root from before the monorepo reorganization, do this once:

  1. Open the Render dashboard and select your service.
  2. Go to Settings → Build & Deploy.
  3. Find Root Directory and set it to pugnetwork-js.
  4. Click Save Changes.
  5. Trigger a manual deploy (or push a commit) to confirm the new root is used.

The build log should then show:

==> Running 'npm install' from /opt/render/project/src/pugnetwork-js

No changes to render.yaml, package.json, or server.js are required — the file contents are byte-identical to before the move.

Environment variables

VariableRequiredNotes
NODE_VERSION Yes 20 (matches render.yaml).
PORT No Render injects this automatically.

That's everything. There is no database to provision, no API key to set, no S3 bucket to wire up. If a DATABASE_URL is still set on an existing service from before the metrics endpoint was removed, it is silently ignored — delete it from the dashboard for tidiness.

Render-specific notes

Local development

cd pugnetwork-js
npm install
npm run dev

Server starts on http://localhost:3000. No database, no secrets, no external services. The build is fully self-contained.

Considering the Go build instead?

If you want zero runtime dependencies, a single static binary, and the option to run on OpenBSD with kernel-enforced sandboxing, see Self-host the Go build.