---
title: "NodeBB на Pethost в один клик"
description: "Форум для вашего сообщества. Шаблон для Pethost: через минуту-две приложение работает на вашей машине — по своему адресу с HTTPS и с ночными бэкапами."
---

[← Все шаблоны](https://pethost.dev/ru/templates/)

# NodeBB на Pethost в один клик

Форум для вашего сообщества

[Задеплоить на Pethost](https://console.pethost.dev/?template=nodebb)

## Что произойдет

1. Вы входите в Pethost или создаете аккаунт — с passkey, через GitHub или Google.
2. Машины еще нет? Вы выбираете тариф, и мы готовим машину для вас. Ссылка ждет в вашем браузере, пока машина не будет готова.
3. Окно «Новый проект» открывается на этом приложении. Вы заполняете то, что оно просит, и нажимаете «Создать проект»: **Пароль администратора**.
4. Через минуту-две приложение работает по своему адресу с HTTPS. Его секреты создаются случайно, а данные попадают в ночной бэкап.
5. Это проект как любой другой: его compose.yaml, .env, логи и терминал — в панели, а ваш агент может его изменить, откатить или восстановить.

## Первые шаги

Войдите как admin с паролем, который вы задали; первый запуск собирает форум и занимает несколько минут. Зарегистрироваться может любой: кто может присоединиться, задается в Admin > Settings > Users. Почта, в том числе сброс паролей, заработает, когда в Admin > Settings > Email будет указан SMTP-сервер.

## Что запускается

Шаблон — это этот compose.yaml и переменные, которые он пишет в .env проекта. Pethost запускает файл так, как он написан.

```
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: admin@example.com
    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:
```

[compose.yaml](https://pethost.dev/templates/nodebb/compose.yaml)[Открыть на GitHub](https://github.com/pethost-dev/templates/tree/main/nodebb)

Pethost · Stephan Gomer · NIP 1133096755

[Шаблоны](https://pethost.dev/ru/templates/) [О нас](https://pethost.dev/about/) [Блог](https://pethost.dev/blog/) [Условия](https://pethost.dev/terms/) [Конфиденциальность](https://pethost.dev/privacy/) [Возвраты](https://pethost.dev/refunds/) [API](https://pethost.dev/docs/api/) [CLI](https://pethost.dev/docs/cli/) [Плагин](https://github.com/pethost-dev/plugin) [support@pethost.dev](mailto:support@pethost.dev)
