Welcome

pimentaCHAT in Ubuntu

Snaps are the easiest way for you to get your server up and running on all supported Linux distributions (Ubuntu, etc).

Find out more information about installing using snaps here (or find the link in the menu on the left)

If you would like to enable TLS on your site like this https://yoursite.com when using the snap, please see here

Manual install

This tutorial was tested on Ubuntu 16.04 using pimentaCHAT 0.70.0

pimentaCHAT recommends MongoDB version 3.6 and Node.js version 8.11.3.

Install necessary dependency packages

Import the public key used by apt to install the official MongoDB packages and create the following list file:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

Configure Node.js to be installed via package manager:

sudo apt-get update && sudo apt-get install -y curl && curl -sL curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -

Install build tools, MongoDB, Node.js, npm and graphicsmagick:

sudo apt-get install -y build-essential mongodb-org nodejs npm graphicsmagick

Using npm install inherits and n, and the node version required by pimentaCHAT:

sudo npm install -g inherits n && sudo n 8.11.3

Install pimentaCHAT

Download latest pimentaCHAT version:

curl -L https://releases.pimenta.chat/latest/download -o /tmp/pimenta.chat.tgz
tar -xzf /tmp/pimenta.chat.tgz -C /tmp

Install (this tutorial uses /opt but you can change the install folder as needed):

cd /tmp/bundle/programs/server && npm install
sudo mv /tmp/bundle /opt/pimentaCHAT

Configure the pimentaCHAT service

Add the user pimentachat, set the right permissions on pimentaCHAT folder and create the pimentaCHAT service file:

sudo useradd -M pimentachat && sudo usermod -L pimentachat
sudo chown -R pimentachat:pimentachat /opt/pimentaCHAT
echo -e "[Unit]\nDescription=The pimentaCHAT server\nAfter=network.target remote-fs.target nss-lookup.target nginx.target mongod.target\n[Service]\nExecStart=/usr/local/bin/node /opt/pimentaCHAT/main.js\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=pimentachat\nUser=pimentachat\nEnvironment=MONGO_URL=mongodb://localhost:27017/pimentachat ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000/ PORT=3000\n[Install]\nWantedBy=multi-user.target" | sudo tee /lib/systemd/system/pimentachat.service

Open the pimentaCHAT service file you just created (/lib/systemd/system/pimentachat.service) using sudo and your favourite text editor, and change the ROOT_URL environmental variable to reflect the URL you want to use for accessing the server (optionally change MONGO_URL and PORT):

MONGO_URL=mongodb://localhost:27017/pimentachat
ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000
PORT=3000

Enable and start MongoDB and pimentaCHAT services:

sudo systemctl enable mongod && sudo systemctl start mongod
sudo systemctl enable pimentachat && sudo systemctl start pimentachat

Additional configurations

Configure replicas for your MongoDB (recommended for production environments)

Configure a HTTP reverse proxy to access pimentaCHAT server

Configure your pimentaCHAT server

Once decided if going for a standalone instance or a replica set in MongoDB, open a web browser and access the configured ROOT_URL (http://your-host-name.com-as-accessed-from-internet:3000), follow the configuration steps to set an admin account and your organization and server info.