Skip to content

Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server

Netcloud24
Cloud Infrastructure Expert
NetCloud24 Expert Guides Open the dedicated video page

Video transcript: NetCloud24 Expert Guides. Practical knowledge for a reliable cloud. Cloud and VPS expertise, security, performance, and step-by-step tutorials. Learn, deploy, and keep building with NetCloud24.

 

Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server

NodeBB est un logiciel de forum open-source puissant, construit sur Node.js. Ce guide vous expliquera comment installer NodeBB sur un serveur Ubuntu 24.04, le configurer avec MongoDB et utiliser Nginx comme proxy inverse.

Étape 1 : Mettre à jour le système

Commencez par mettre à jour la liste des paquets et mettre à jour les paquets installés. Ouvrez un terminal et exécutez les commandes suivantes :

sudo apt update && sudo apt upgrade -y

Étape 2 : Installer les dépendances

Installez les dépendances nécessaires, notamment Git, Node.js, MongoDB et Nginx :

sudo apt install git curl nginx mongodb -y

Ensuite, installez Node.js en ajoutant le dépôt NodeSource, puis installez Node.js :

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install nodejs

Étape 3 : Installer et configurer MongoDB

Démarrez le service MongoDB et activez-le au démarrage :

sudo systemctl start mongodb
sudo systemctl enable mongodb

Créez un utilisateur MongoDB et une base de données pour NodeBB :

mongo

use nodebb
db.createUser({user: "nodebbuser", pwd: "yourpassword", roles: ["readWrite"]})
exit
        

Étape 4 : Installer NodeBB

Clonez le dépôt NodeBB et accédez au répertoire :

git clone -b v1.x.x https://github.com/NodeBB/NodeBB.git nodebb
cd nodebb

Installez les dépendances NodeBB avec npm :

Visual overview of Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server
Visual overview: Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server
npm install --production

Étape 5 : Configurer NodeBB

Exécutez le script de configuration de NodeBB pour configurer le forum :

./nodebb setup

Vous serez invité à entrer plusieurs paramètres comme les informations de la base de données, l’URL et les détails de l’administrateur. Assurez-vous d’utiliser les identifiants MongoDB que vous avez créés plus tôt.

Étape 6 : Configurer Nginx comme proxy inverse

Pour configurer Nginx comme proxy inverse, créez un fichier de configuration pour NodeBB :

sudo nano /etc/nginx/sites-available/nodebb

Ajoutez la configuration suivante :


server {
    listen 80;

    server_name your_domain.com;

    location / {
        proxy_pass http://localhost:4567;
        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 Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_redirect off;
    }
}
        

Activez la configuration et redémarrez Nginx :

sudo ln -s /etc/nginx/sites-available/nodebb /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Étape 7 : Démarrer NodeBB

Démarrez NodeBB en utilisant la commande suivante :

./nodebb start

Vous pouvez maintenant accéder à votre forum NodeBB en visitant votre domaine dans un navigateur.

Conclusion

Félicitations ! Vous avez installé avec succès NodeBB avec un proxy Nginx sur votre serveur Ubuntu 24.04. Votre forum est maintenant prêt à l’emploi. Si vous utilisez un serveur distant, assurez-vous que votre pare-feu et vos paramètres réseau sont correctement configurés pour autoriser l’accès externe.

Windows VPS Deutschland

Windows VPS España

Key topics covered in Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server
Key topics covered in this NetCloud24 guide.

Windows VPS Nederland

Windows VPS Italia

Windows VPS Portugal

VPS Windows Italia

Windows VPS

Windows VPS

Windows VPS Sverige

Windows VPS Norge

Windows VPS

Practical checklist for Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server
Practical checklist for applying the guidance in this article.

Windows VPS Türkiye

Windows RDS (Remote Desktop Services)

Windows VPS

Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server
Comment installer NodeBB avec Nginx Proxy sur Ubuntu 24.04 Server
Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.