NodeBB 설치 · 10 min read · Oct 14, 2025

우분투 22.04에 NodeBB 포럼 설치하는 방법

NodeBB는 Node.js 프레임워크로 구동되는 현대적인 포럼 소프트웨어입니다. MongoDB, PostgreSQL 또는 Redis 데이터베이스를 사용하여 데이터를 저장합니다. 실시간 알림 및 즉각적인 상호작용을 위해 웹 소켓을 활용합니다. 소셜 네트워크 통합, 플러그인 지원, 모바일 반응형 및 전체 REST 읽기/쓰기 API와 같은 현대적인 기능을 갖추고 있습니다.

NodeBB는 오픈 소스 자가 호스팅 프로젝트와 클라우드 서비스로 제공됩니다. 이 튜토리얼에서는 우분투 22.04 서버에서 Nginx를 사용하여 NodeBB 포럼을 설치하는 방법을 배웁니다. 우분투 22.04는 MongoDB를 공식적으로 지원하지 않으므로 PostgreSQL을 사용하여 데이터를 저장합니다.

전제 조건

  • 최소 1GB의 RAM을 갖춘 우분투 22.04 서버.
  • sudo 권한이 있는 비루트 사용자.
  • 간단한 방화벽(UFW)이 활성화되어 실행 중입니다.
  • 서버를 가리키는 완전한 도메인 이름(FQDN), 예: forum.example.com.
  • 모든 것이 업데이트되었습니다. $ sudo apt update && sudo apt upgrade

1단계 - 방화벽 구성

패키지를 설치하기 전에 첫 번째 단계는 HTTP 및 HTTPS 연결을 허용하도록 방화벽을 구성하는 것입니다.

방화벽 상태를 확인합니다.

$ sudo ufw status

다음과 같은 내용을 볼 수 있어야 합니다.

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)

HTTP 및 HTTPS 포트를 허용합니다.

$ sudo ufw allow http
$ sudo ufw allow https

확인을 위해 다시 상태를 확인합니다.

$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
443                        ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)

2단계 - PostgreSQL 설치

PostgreSQL 설치의 첫 번째 단계는 GPG 키를 추가하는 것입니다.

$ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /usr/share/keyrings/postgresql-key.gpg >/dev/null

APT 저장소를 소스 목록에 추가합니다.

$ sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/postgresql-key.gpg arch=amd64] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

시스템 저장소를 업데이트합니다.

$ sudo apt update

이제 PostgreSQL을 설치할 수 있습니다.

$ sudo apt install postgresql postgresql-contrib

PostgreSQL 서비스의 상태를 확인합니다.

$ sudo systemctl status postgresql
? postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sat 2022-09-10 06:25:11 UTC; 13s ago
    Process: 12083 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 12083 (code=exited, status=0/SUCCESS)
        CPU: 1ms

Sep 10 06:25:11 nodebb systemd[1]: Starting PostgreSQL RDBMS...
Sep 10 06:25:11 nodebb systemd[1]: Finished PostgreSQL RDBMS.

3단계 - PostgreSQL 구성

Postgres 기본 관리 사용자 postgres의 비밀번호를 설정해야 합니다. 먼저 Postgres 셸에 로그인합니다.

$ sudo -u postgres psql

비밀번호를 변경하기 위해 다음 명령을 입력합니다.

postgres=# \password postgres

새 비밀번호를 입력하라는 메시지가 표시됩니다.

Enter new password for user "postgres":
Enter it again:

NodeBB용 새 사용자를 만듭니다.

postgres=# CREATE ROLE nbbuser WITH LOGIN ENCRYPTED PASSWORD 'YourNodeBBPassword';

NodeBB용 새 데이터베이스를 만듭니다.

postgres=# CREATE DATABASE nodebbdb OWNER nbbuser;

셸을 종료하려면 \q를 입력합니다.

postgres=# \q

4단계 - Node.js 설치

Nodebb 포럼은 Node.js 프레임워크를 사용하여 작성되었으므로 작동하려면 이를 설치해야 합니다.

LTS(v16.x) 버전의 Nodejs를 설치하기 위해 다음 명령을 실행합니다.

$ curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
$ sudo apt install nodejs

Node.js 및 NPM 설치를 확인합니다.

$ node -v
v16.17.0
$ npm -v
8.15.0

5단계 - Git 설치

NodeBB를 설치하기 전에 Git을 설치해야 합니다. Git을 설치하기 위해 다음 명령을 실행합니다.

$ sudo apt install git

Git의 초기 구성을 수행하기 위해 다음 명령을 실행합니다.

$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"

6단계 - NodeBB 설치

NodeBB를 루트 사용자로 실행하는 것은 권장되지 않습니다. 비밀번호 없이 권한이 없는 시스템 사용자를 생성합니다.

$ sudo adduser nodebb --disabled-password

다른 모든 옵션은 건너뜁니다.

NodeBB 포럼이 위치할 디렉토리를 생성합니다.

$ sudo mkdir /var/www/html/nodebb -p

폴더의 소유권을 새로 생성한 사용자에게 변경합니다.

$ sudo chown -R nodebb:nodebb /var/www/html/nodebb

새로 생성한 사용자로 로그인합니다.

$ sudo su - nodebb

NodeBB 설치 디렉토리로 이동합니다.

$ cd /var/www/html/nodebb

NodeBB를 설치하기 위해 먼저 GitHub 저장소를 클론해야 합니다.

NodeBB를 /var/www/nodebb 디렉토리에 클론합니다. 명령 끝의 점은 현재 디렉토리를 참조합니다.

$ git clone -b v2.x https://github.com/NodeBB/NodeBB.git .

여기서 우리는 NodeBB의 최신 안정 버전이 포함된 v2.x 브랜치를 클론했습니다. NodeBB의 최신 브랜치는 NodeBB의 최신 브랜치 페이지에서 확인할 수 있습니다.

NodeBB는 명령줄 유틸리티와 함께 제공됩니다. NodeBB를 설치하기 위해 다음 명령을 사용합니다.

$ ./nodebb setup

기본값을 선택하려면 Enter를 누릅니다.

2022-09-10T10:10:27.957Z [2633] - info: NodeBB Setup Triggered via Command Line

Welcome to NodeBB v2.5.2!

This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
Press enter to accept the default setting (shown in brackets).
URL used to access this NodeBB (http://localhost:4567) https://forum.example.com
Please enter a NodeBB secret (44fd62bc-5047-4414-a4ca-83105740b624)
Would you like to submit anonymous plugin usage to nbbpm? (yes) no
Which database to use (mongo) postgres
2022-09-10T10:10:43.237Z [2633] - info:
Now configuring postgres database:
Host IP or address of your PostgreSQL instance (127.0.0.1)
Host port of your PostgreSQL instance (5432)
PostgreSQL username nbbuser
Password of your PostgreSQL database
PostgreSQL database name (nodebb) nodebbdb
Enable SSL for PostgreSQL database access (false)
........

NodeBB에 접근하는 데 사용되는 URL의 값으로 포럼에 접근할 최종 URL을 선택합니다. 서버 IP를 통해 포럼에 접근할 경우 해당 IP를 입력하거나 포럼의 전체 도메인을 입력합니다. 여기서는 https://forum.example.com을 입력합니다. 익명 플러그인 사용 제출에 대한 질문에는 no를 선택합니다. 데이터베이스 유형으로 postgres를 입력합니다.

그런 다음 Enter를 눌러 기본 호스트 IP 및 포트를 선택하고 PostgreSQL 사용자 이름을 입력합니다. 이는 이전에 MongoDB를 구성할 때 해당 사용자 이름에 대해 선택한 비밀번호를 입력하는 것입니다. 데이터베이스 nodebbdb를 선택해야 합니다.

관리자 사용자 및 해당 세부 정보를 생성하라는 메시지도 표시됩니다.

.....
2022-09-10T10:11:14.121Z [2633] - warn: No administrators have been detected, running initial user setup

Administrator username navjot
Administrator email address [email protected]
Password
Confirm Password
.....
....
2022-09-10T10:14:28.160Z [2633] - info: [build] Asset compilation successful. Completed in 118.777sec.

     =================================================================================================================================================================

NodeBB Setup Completed. Run "./nodebb start" to manually start your NodeBB server.

설정이 완료되면 NodeBB를 시작하기 위해 다음 명령을 실행합니다.

$ ./nodebb start
Starting NodeBB
  "./nodebb stop" to stop the NodeBB server
  "./nodebb log" to view server output
  "./nodebb help" for more commands

NodeBB 사용자에서 로그아웃합니다.

$ exit

7단계 - NodeBB를 시스템 서비스로 실행

NodeBB 서비스는 시스템 재부팅 후 실행되지 않습니다. NodeBB를 매번 시작하지 않도록 시스템 서비스로 설치해야 합니다.

먼저 NodeBB 서비스를 중지합니다. NodeBB 디렉토리로 전환한 다음 sudo -u 명령을 사용하여 명령을 직접 실행합니다.

$ cd /var/www/html/nodebb  
$ sudo -u nodebb ./nodebb stop

nodebb.service systemd 유닛 구성 파일을 생성하고 편집하기 위해 다음 명령을 실행합니다.

$ sudo nano /etc/systemd/system/nodebb.service

편집기에 다음 코드를 붙여넣습니다.

[Unit]
Description=NodeBB
Documentation=https://docs.nodebb.org
After=system.slice multi-user.target postgresql.service

[Service]
Type=simple
User=nodebb

StandardError=syslog
SyslogIdentifier=nodebb

Environment=NODE_ENV=production
WorkingDirectory=/var/www/html/nodebb
ExecStart=/usr/bin/env node loader.js --no-silent --no-daemon
Restart=always

[Install]
WantedBy=multi-user.target

여기서는 6단계에서 생성한 사용자 이름을 nodebb로 선택하고 NodeBB를 설치한 경로를 선택했습니다.

NodeBB 서비스를 활성화합니다.

$ sudo systemctl enable nodebb

NodeBB 서비스를 시작합니다.

$ sudo systemctl start nodebb

서비스 상태를 확인합니다.

$ sudo systemctl status nodebb
? nodebb.service - NodeBB
     Loaded: loaded (/etc/systemd/system/nodebb.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-09-11 21:41:07 UTC; 2s ago
       Docs: https://docs.nodebb.org
   Main PID: 26844 (node)
      Tasks: 18 (limit: 2237)
     Memory: 94.1M
        CPU: 2.114s
     CGroup: /system.slice/nodebb.service
             ??26844 node loader.js --no-silent --no-daemon
             ??26855 /usr/bin/node /var/www/html/nodebb/app.js

Sep 11 21:41:07 forum systemd[1]: Started NodeBB.
Sep 11 21:41:07 forum nodebb[26844]: NodeBB v2.5.2 Copyright (C) 2013-2022 NodeBB Inc.
Sep 11 21:41:07 forum nodebb[26844]: This program comes with ABSOLUTELY NO WARRANTY.
Sep 11 21:41:07 forum nodebb[26844]: This is free software, and you are welcome to redistribute it under certain conditions.
Sep 11 21:41:07 forum nodebb[26844]: For the full license, please visit: http://www.gnu.org/copyleft/gpl.html
Sep 11 21:41:07 forum nodebb[26844]: Clustering enabled: Spinning up 1 process(es).
Sep 11 21:41:08 forum nodebb[26855]: 2022-09-11T21:41:08.002Z [4567/26855] - info: Initializing NodeBB v2.5.2 https://forum.example.com

8단계 - Nginx 설치

우분투 22.04는 이전 버전의 Nginx를 제공합니다. 최신 버전을 설치하려면 공식 Nginx 저장소를 다운로드해야 합니다.

Nginx의 서명 키를 가져옵니다.

$ curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null

Nginx의 안정 버전 저장소를 추가합니다.

$ echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg arch=amd64] \
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

시스템 저장소를 업데이트합니다.

$ sudo apt update

Nginx를 설치합니다.

$ sudo apt install nginx

설치를 확인합니다.

$ nginx -v
nginx version: nginx/1.22.0

Nginx 서버를 시작합니다.

$ sudo systemctl start nginx

9단계 - SSL 설치

SSL 인증서를 생성하기 위해 Certbot을 설치해야 합니다. Ubuntu의 저장소를 사용하여 Certbot을 설치하거나 Snapd 도구를 사용하여 최신 버전을 가져올 수 있습니다. 우리는 Snapd 버전을 사용할 것입니다.

우분투 22.04는 기본적으로 Snapd가 설치되어 있습니다. 다음 명령을 실행하여 Snapd 버전이 최신인지 확인합니다.

$ sudo snap install core
$ sudo snap refresh core

Certbot을 설치합니다.

$ sudo snap install --classic certbot

Certbot 명령이 /usr/bin 디렉토리에서 실행될 수 있도록 기호 링크를 생성하는 다음 명령을 사용합니다.

$ sudo ln -s /snap/bin/certbot /usr/bin/certbot

SSL 인증서를 생성하기 위해 다음 명령을 실행합니다.

$ sudo certbot certonly --nginx --agree-tos --no-eff-email --staple-ocsp --preferred-challenges http -m [email protected] -d forum.example.com

위 명령은 서버의 /etc/letsencrypt/live/forum.example.com 디렉토리에 인증서를 다운로드합니다.

Diffie-Hellman 그룹 인증서를 생성합니다.

$ sudo openssl dhparam -dsaparam -out /etc/ssl/certs/dhparam.pem 4096

SSL 갱신이 잘 작동하는지 확인하려면 프로세스의 드라이런을 수행합니다.

$ sudo certbot renew --dry-run

오류가 없으면 모든 준비가 완료된 것입니다. 인증서는 자동으로 갱신됩니다.

10단계 - Nginx 구성

편집을 위해 /etc/nginx/nginx.conf 파일을 엽니다.

$ sudo nano /etc/nginx/nginx.conf

include /etc/nginx/conf.d/*.conf; 줄 앞에 다음 줄을 추가합니다.

server_names_hash_bucket_size  64;

파일을 저장하려면 Ctrl + X를 누르고 프롬프트가 표시되면 Y를 입력합니다.

편집을 위해 /etc/nginx/conf.d/nodebb.conf 파일을 생성하고 엽니다.

$ sudo nano /etc/nginx/conf.d/nodebb.conf

다음 코드를 붙여넣습니다. forum.example.com을 귀하의 도메인 이름으로 바꾸십시오. 포럼의 업로드 크기를 설정하기 위해 client_max_body_size의 값이 25MB로 설정되어 있는지 확인하십시오.

server {
  listen 80 default_server;
  server_name forum.example.com;
  return 301 https://$server_name$request_uri;
}

server {
   listen 443 ssl http2;
   server_name forum.example.com;

   http2_push_preload on; # Enable HTTP/2 Server Push

   ssl_certificate /etc/letsencrypt/live/forum.example.com/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/forum.example.com/privkey.pem;
   ssl_trusted_certificate /etc/letsencrypt/live/forum.example.com/chain.pem;
   ssl_session_timeout 1d;

   # Enable TLS versions (TLSv1.3 is required upcoming HTTP/3 QUIC).
   ssl_protocols TLSv1.2 TLSv1.3;

   # Enable TLSv1.3's 0-RTT. Use $ssl_early_data when reverse proxying to
   # prevent replay attacks.
   #
   # @see: https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_early_data
   ssl_early_data on;

   ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384';
   ssl_prefer_server_ciphers on;
   ssl_session_cache shared:SSL:50m;

   # OCSP Stapling ---
   # fetch OCSP records from URL in ssl_certificate and cache them
   ssl_stapling on;
   ssl_stapling_verify on;
   ssl_dhparam /etc/ssl/certs/dhparam.pem;
   client_max_body_size 25M;

   gzip            on;
   gzip_min_length 1000;
   gzip_proxied    off;
   gzip_types      text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;

   add_header X-Early-Data $tls1_3_early_data;

   location / {       
       # Socket.IO Support
       proxy_set_header Connection "upgrade";
       proxy_set_header Upgrade $http_upgrade;
       proxy_http_version 1.1;

       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-NginX-Proxy true;
       proxy_set_header X-Frame-Options SAMEORIGIN;

       proxy_pass http://127.0.0.1:4567;  # no trailing slash
       proxy_redirect off;
   }

   location @nodebb {
       proxy_pass http://127.0.0.1:4567;
   }

   location ~ ^/assets/(.*) {
       root /var/www/html/nodebb/;
       try_files /build/public/$1 /public/$1 @nodebb;
   }
}

# This block is useful for debugging TLS v1.3. Please feel free to remove this
# and use the "$ssl_early_data" variable exposed by NGINX directly should you
# wish to do so.
map $ssl_early_data $tls1_3_early_data {
  "~." $ssl_early_data;
  default "";
}

파일을 저장하려면 Ctrl + X를 누르고 프롬프트가 표시되면 Y를 입력합니다.

Nginx 구성을 확인합니다.

$ sudo nginx -t

Nginx 서버를 재시작합니다.

$ sudo systemctl restart nginx

11단계 - 포럼에 접근하고 구성하기

브라우저에서 https://forum.example.com URL을 방문하여 포럼에 접근할 수 있습니다. 다음 페이지가 표시됩니다.

NodeBB 포럼 홈페이지

로그인 페이지를 클릭하고 6단계에서 생성한 관리자 자격 증명을 입력합니다.

NodeBB 로그인 페이지

로그인됩니다. 다음으로 메뉴 바의 오른쪽 아이콘을 클릭하여 관리 패널에 접근합니다.

여기에서 포럼을 관리할 수 있습니다. 테마와 플러그인을 설치하여 확장할 수 있습니다.

NodeBB 포럼 관리자 대시보드

테마와 플러그인을 설치한 후에는 여기에서 보여지는 대로 관리자 대시보드의 오른쪽 상단 버튼을 사용하여 포럼을 재구성하고 재시작해야 합니다.

포럼 사용자가 이메일을 받을 수 있도록 대시보드 >> 설정 >> 이메일로 이동하여 이메일 서비스를 구성해야 합니다. 최적의 이메일 전송 설정을 보장하기 위해 다음 설정을 선택하십시오.

NodeBB 포럼 이메일 설정

페이지를 아래로 스크롤하여 드롭다운에서 사용자 지정 메일러를 선택하거나 SMTP 서비스가 목록에 없으면 사용자 지정 메일러를 사용합니다. 이 튜토리얼에서는 SES 서비스를 사용하고 있습니다.

NodeBB 포럼 SMTP 설정

설정을 저장하려면 오른쪽 하단의 플로피 디스크 아이콘을 클릭합니다.

페이지 하단으로 스크롤하여 테스트 이메일을 보냅니다. 기본적으로 금지된 이메일 템플릿이 전송됩니다. 다른 메일 템플릿을 선택하여 테스트할 수 있습니다. 우리는 환영 이메일을 보낼 것입니다.

NodeBB 포럼 이메일 테스트

설정이 확인된 테스트 이메일을 받게 됩니다.

NodeBB 포럼 테스트 이메일

결론

이것으로 PostgreSQL 데이터베이스와 Nginx를 사용하여 우분투 22.04 서버에 NodeBB 포럼을 설치하는 튜토리얼이 마무리됩니다. 질문이 있으시면 아래 댓글로 남겨주세요.

Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.