English
Get started

← All templates · Social and community

Deploy NodeBB in one click

A forum for your community

A self-hosted alternative to Discourse and XenForo.

What is NodeBB?

NodeBB is open-source forum software, a self-hosted alternative to Discourse for a community of your own. It keeps the classic shape of categories, topics and replies, but new posts and notifications appear live, with no page reload. Members write in Markdown, mention each other with @, follow tags and send each other chat messages. A theme changes the look, and plugins add the rest, from single sign-on to spam filters.

People run NodeBB themselves to keep a community's posts and members on their own server, under the GPL-3.0 licence and with no price per member. It suits a club, a product's users or an open-source project that wants threads people can find again, rather than a chat that scrolls away. The catch: a new plugin or theme takes effect only after the forum rebuilds and restarts.

Hosting NodeBB on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at NodeBB. You fill in what it asks for and click Create project: Admin password.
  3. In a minute or two NodeBB is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about NodeBB

Is NodeBB free and open source?

Yes. NodeBB is licensed under GPL-3.0 and its code is on GitHub. Its makers also sell hosted forums, and a sublicense for anyone who needs to use it in a non-free product.

Does NodeBB work with Mastodon and the fediverse?

Yes, since version 4.0. NodeBB speaks ActivityPub, so people on Mastodon and other fediverse apps can follow a forum's categories and users and reply to its topics. New forums have it on, under Federation in the admin panel.

Does NodeBB have a mobile app?

It installs like one. A NodeBB forum is a Progressive Web App that members can add to their phone's home screen, and its bundled Web Push plugin sends notifications to those who turn them on in their profile.

How do permissions work in NodeBB?

Privileges are set for groups or single users, globally and per category: who can find a category, read its topics, post, reply, upload or moderate. A private staff area or a read-only announcements board is a few ticked boxes.

How do I set up email for NodeBB?

In the admin panel, open Settings > Email, tick Enable SMTP Transport, then pick a known service or enter your mail server's host, port and login. Until then the forum sends no email, not even password resets.

How much memory and disk does NodeBB need?

NodeBB is moderate: about half a gigabyte with Redis, which keeps every post in memory, and uploads grow the disk. On Pethost the Starter plan is enough for it, with room for other apps beside it.

NodeBB Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: nodebb (ghcr.io/nodebb/nodebb:4.x), redis (redis:8-alpine).

Volumes, in the nightly backup: config, uploads, build, node_modules, redis.

services:
  nodebb:
    image: ghcr.io/nodebb/nodebb:4.x
    restart: unless-stopped
    # The first start installs the forum with this admin, so the web installer the image would
    # open to whoever comes first never runs: without config.json the container exits instead.
    # NodeBB asks a terminal again for a password it refuses, so the setup has a time limit.
    entrypoint:
      - tini
      - --
      - sh
      - -ec
      - |
        if [ ! -f /opt/config/installed ]; then
          setup='{"trust_proxy": 1}' timeout 300 /usr/src/app/nodebb setup --config=/opt/config/config.json --skip-build
          test -f /opt/config/config.json
          touch /opt/config/installed
        fi
        test -f /opt/config/config.json
        exec entrypoint.sh
    environment:
      NODEBB_URL: ${URL}
      NODEBB_DB: redis
      NODEBB_DB_HOST: redis
      NODEBB_ADMIN_USERNAME: admin
      NODEBB_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      # Setup needs an address; it is stored as confirmed, and no mail is sent to it.
      NODEBB_ADMIN_EMAIL: [email protected]
    depends_on:
      redis:
        condition: service_healthy
    # Every folder the image declares as a volume; node_modules keeps the plugins installed later.
    volumes:
      - config:/opt/config
      - uploads:/usr/src/app/public/uploads
      - build:/usr/src/app/build
      - node_modules:/usr/src/app/node_modules

  # The forum's only database: every write goes to the append-only file.
  redis:
    image: redis:8-alpine
    restart: unless-stopped
    command: [redis-server, --appendonly, "yes", --loglevel, warning]
    volumes:
      - redis:/data
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping | grep -q PONG"]
      interval: 5s
      timeout: 3s
      retries: 12

volumes:
  config:
  uploads:
  build:
  node_modules:
  redis:

More in Social and community