Install Janus Webrtc Ubuntu Server 18.04.4


Ubuntu 18.04.4


E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/repo.mongodb.org_apt_ubuntu_dists_bionic_mongodb-org_4.0_multiverse_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.

=> Fix

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update

Install script

sudo apt install libmicrohttpd-dev libjansson-dev libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev libopus-dev libogg-dev libcurl4-openssl-dev liblua5.3-dev libconfig-dev pkg-config gengetopt libtool automake gtk-doc-tools doxygen graphviz libnanomsg-dev cmake -y --fix-missing

# Install libnice
cd ~
git clone
cd libnice
./configure --prefix=/usr
make && sudo make install

# Install libsrtp2
cd ~
tar xfv v2.2.0.tar.gz
cd libsrtp-2.2.0
./configure --prefix=/usr --enable-openssl
make shared_library && sudo make install

# Install usrsctp
cd ~
git clone
cd usrsctp
./configure --prefix=/usr && make && sudo make install

# Install libwebsockets
cd ~
git clone
cd libwebsockets
# If you want the stable version of libwebsockets, uncomment the next line
# git checkout v2.4-stable
mkdir build
cd build
# See re: LWS_MAX_SMP
make && sudo make install

# Install MQTT C
cd ~
git clone
cd paho.mqtt.c
make && sudo prefix=/usr make install

# Install RabbitMQ
cd ~
git clone
cd rabbitmq-c
git submodule init
git submodule update
mkdir build && cd build
make && sudo make install

# Install janus
cd ~
git clone
cd janus-gateway
./configure --prefix=/opt/janus
sudo make install
sudo make configs 

Config at



sudo /opt/janus/bin/janus

# run background:
# or use multi terminal
screen -S janus -d -m
screen -r janus
[CTRL+A+D to detach again]

API start at 


# Get server info

Websocket at


Setup ssl

cd ~
mkdir ssl
cd ssl

# Gen ssl certs:
openssl req -new -newkey rsa:4096 -nodes -keyout key.pem -out cert.csr
openssl x509 -req -sha256 -days 365 -in cert.csr -signkey key.pem -out cert.pem
chmod 600 cert.csr
chmod 600 cert.pem
chmod 600 key.pem

Update config

#Janus config
sudo nano /opt/janus/etc/janus/janus.jcfg
=> to
certificates: {
        cert_pem = "/home/nhancv/ssl/cert.pem"
        cert_key = "/home/nhancv/ssl/key.pem"
        #cert_pwd = "secretpassphrase" #secretpassphrase

#Http transport config
sudo nano /opt/janus/etc/janus/janus.transport.http.jcfg
=> to
general: {
        http = true # Whether to enable the plain HTTP interface
        port = 8088 # Web server HTTP port
        https = true # Whether to enable HTTPS (default=false)
        secure_port = 8089 # Web server HTTPS port, if enabled
certificates: {
        cert_pem = "/home/nhancv/ssl/cert.pem"
        cert_key = "/home/nhancv/ssl/key.pem"
        #cert_pwd = "secretpassphrase" #secretpassphrase

sudo /opt/janus/bin/janus

If you got error and can not proceed https on Chrome, just move to Firefox

To run demo


Install local webserver:

npm install -g local-web-server

Start local demo: 

cd janus-gateway/html
ws --http2

# Test at

# Note: You need to modify janus server point to your server address on specific js demo file. Such as: videocalltest.js

Leave a Reply

Your email address will not be published.Required fields are marked *