Setup nextcloud-spreed-signaling standalone server on Ubuntu

Setup nextcloud-spreed-signaling standalone server on Ubuntu

 · 3 min read

Hey there. I finally got i t to work. I will make some tutorial in the near future. For now, i’ll tell you what i did.
In my set up a have 2 vmware vms. One for nextcloud and the other for signaling. Both are running ubuntu 18.04. Initially i base my configurations in tow tutorials:
I did not use caddy nor the .deb packages for janus. I compiled everything by hand.
I struggle a bit with libnice. But cheking out the the branch latest-release did the trick. Then i ran:
./autogen.sh
./configure --prefix=/usr
make && sudo make install
Once a i had everythin in place, i hardcoded the internal ips for the signaling server and nextcloud in each host file (nextcloud and signaling):
10.1.1.1 nextcloud.example.com
10.1.1.2 signaling.example.com
I configured the RTP port range in janus (20000-40000), the min and max ports for coturn (49152-65535), and opened the folowing ports in my firewall (doin DNAT):
  • Janus: UDP: 20000-40000
  • coturn:
    • UDP 3478, 49152-65535
    • TCP 3478
    • SCTP: 3478
  • Signaling: TCP 443 (through nginx).
What i did not:
  • Configured the external ip in coturn nor janus. That’s only for 1:1 nat.
  • I did not use the udp endpoint for turn in the signaling configuration.
Now everything works fine.


Link No. 2 Below



Thanks to struktur AG, which released the open source version of the standalone signaling server for Nextcloud Talk, you can now run your own version of the Talk High Performance Backend. Awesome work and good move!
I’ve grabbed the sources immediately and built a HPB on one of my tiny VPS (VPS 200 G8 hosted by netcup).
Notice: Your setup might differ a lot (or won’t apply at all as your’re using different OS, Webserver, …). This is just a writeup of steps i took to make it work.
There’s also a pull request containing a dockerized setup.

Requirements

  • a Ubuntu server (despite the software should be available for other systems too, i’ll only cover Ubuntu)
  • Nextcloud with Talk installed and enabled (not necessarily the machine you want to run HPB on, my NC server is private while the signaling server is public)
  • a server with a public network interface (port forwarding works too)

Installation

Janus WebRTC Server

  • install the janus package from the repo (up to date backports for Ubuntu Bionic/Focal can be found here):
    • sudo apt install janus
  • create a random api key for turn server usage: openssl rand -base64 16 (will be used in nextcloud-spreed-signaling later)
  • edit /etc/janus/janus.jcfg (.cfg in older versions), search for turn_rest_api_key and insert the generated key
  • search for the line full_trickle = true and uncomment
  • edit /etc/janus/janus.transport.http.jcfg and set interface = "lo" in the general section
  • edit /etc/janus/janus.transport.websockets.jcfg and set interface = "lo" in the general section
  • restart janus service: systemctl restart janus (do not forget to enable on boot: systemctl enable janus)
Janus is listening on localhost interface and will be hidden by the HBP.

Coturn TURN Server

NATS server

The NATS messaging server can be installed in various ways. I’ve also created apt packages here which i’m using.

nextcloud-spreed-signaling server (HPB)

Either build the binary yourself (see here) or use my prebuilt ubuntu packages.
  • create /etc/signaling/server.conf and copy content from the example
  • create 2 random hex keys:
    • openssl rand -hex 16
  • adjust config file:
    • uncomment the http listener
    • add first random hex key to parameter hashkey below [sessions]
    • add second random hex key to parameter blockkey below [sessions]
    • add the apikey from janus first step to [turn] section’s apikey parameter
    • add the turn server (e.g. servers = turn:your.public.fqdn:3478?transport=tcp)
    • add url = ws://127.0.0.1:8188 to [mcu] sections url parameter
Start the standalone signaling server: systemctl restart signaling.
It is advised to listen on localhost and put a reverse proxy in front of the gateway. I’m using Caddy, see next section.

Caddy Reverse Proxy

  • grab latest debian package from Caddy releases
  • install caddy package apt-get -y install ./caddy_2.0.0_linux_<arch>.deb
  • edit /etc/caddy/Caddyfile and insert sections for janus and signaling server:
your.public.fqdn {
log
route /standalone-signaling/* {
uri strip_prefix /standalone-signaling
reverse_proxy http://127.0.0.1:8081
}
}

No comments yet

No comments yet. Start a new discussion.

Add Comment