The following is intended for guidance on installing this software on a fresh vanilla install of Ubuntu 20.04 or better
The following are expected to already be established
- A server or virtual private server with Ubuntu 20.04 installed
- A domain name registered
- DNS a records for the domain pointing to the server IP address
- An
A
record for wildcard*
pointing to the IP address - An
A
record forstun
pointing to the IP address - An
A
record forturn
pointing to the IP address
- An
- Any supplemental domains may be setup with CNAME or forwarding to the base domain
- You should have the root account credentials to the box, or an account with sudo permissions
If you have the root account credentials, but not a user account, SSH in as the root user
ssh root@<ip address>
Provide the password for the account when prompted.
Add a new user
Add a new user
adduser <theusername>
Provide password, press enter through prompts.
Add a group for ssh users
addgroup sshusers
Add users to sshusers group and sudo group
usermod -a -G sshusers root
usermod -a -G sshusers <theusername>
usermod -a -G sudo <theusername>
Add SSH public key for user just added
mkdir -p /home/<theusername>/.ssh
nano /home/<theusername>/.ssh/authorized_keys
Paste in the contents of that users ~/.ssh/id_rsa.pub
from the connecting system
Save and exit
Modify SSH config to allow groups
nano /etc/ssh/sshd_config
Add the following line at the end, save and exit
AllowGroups sshusers
Restart SSH
systemctl restart sshd
Exit and Relogin as the user created
> ssh <theusername>@ip
If successful, it will pick up the SSH public key
Python3, Git, JPEG Development Library, ImageMagic and Inkscape, JQ and Netcat
sudo apt-get update
sudo apt-get install -y python3 python3-venv git libjpeg-dev zlib1g-dev imagemagick inkscape jq netcat
Fail2Ban
sudo apt-get install -y fail2ban
UFW
sudo apt-get install ufw
Configure UFW
sudo ufw allow ssh
sudo ufw enable
Configure File Limits
sudo nano /etc/systemd/user.conf
Find DefaultLimitNOFILE
, uncomment and set value
DefaultLimitNOFILE=65535
Save and exit
Notify changes
sudo sh -c 'sysctl fs.inotify.max_user_watches=524288 && sysctl -p'
Set limits
sudo /etc/security/limits.conf
At bottom add the following
user soft nproc 10000
user hard nproc 10000
user soft nofile 10000
user hard nofile 10000
Save and exit
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
And then add user support
sudo usermod -a -G docker <theusername>
Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
These common tools are also required for Jams
sudo apt install nodejs
node -v
sudo apt install npm
sudo npm install -g yarn
Install newer version of node
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
Install the repo
cd ~
git clone https://github.com/diamsa/jam.git
cd ~/jam/deployment
cp .env.example .env
hostname -I
# make note of the reported IP addresses
nano .env
-
Set the
JAM_HOST
value to the domain name -
Set the
COMPOSE_PROFILES
value toweb,coturn,metrics,sfu
-
Uncomment the
GRAFANA_ADMIN_PASSWORD
line and set a value -
Uncomment the
JAM_SFU
line -
Set the
JAM_SFU_EXTERNAL_IP
value to the external ip address reported from hostname -I.
Press CTRL+O, CTRL+X to save and exit
Edit the turnserver.conf file
nano ~/jam/deployment/turnserver.conf
-
Set the
realm
value to the domain name -
Set the
external-ip
value to the external ip address reported from hostname -I
Press CTRL+O, CTRL+X to save and exit
Edit the jam-config.json file
nano ~/jam/resources/jam-config.json
- Near the top of the file, update the domain name for the fields in the
urls
section.
Press CTRL+O, CTRL+X to save and exit
Build the UI
cd ~/jam/ui
yarn
Create Docker Images
cd ~/jam/ui
docker build -t diamsa/ui:stable .
cd ~/jam/pantry
docker build -t diamsa/pantry:stable .
Start Docker
cd ~/jam/deployment
docker-compose up -d