Skip to content

Instantly share code, notes, and snippets.

@bohnmedia
Last active April 2, 2021 13:02
Show Gist options
  • Save bohnmedia/e2ae1c14a9b6b4974c21979e65c0e8ed to your computer and use it in GitHub Desktop.
Save bohnmedia/e2ae1c14a9b6b4974c21979e65c0e8ed to your computer and use it in GitHub Desktop.
Install Janus-Server
1. UBUNTU
a. Install Ubuntu 18.04.5 LTE
b. sudo apt-get update
c. sudo apt-get upgrade
2. INSTALL DEPENDENCIES
a. sudo apt-get --yes install git libmicrohttpd-dev libjansson-dev libssl-dev libsrtp0-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 cmake ninja-build python3 python3-pip
3. INSTALL MESON
a. sudo pip3 install meson
b. sudo reboot
4. INSTALL LIBNICE
a. git clone https://gitlab.freedesktop.org/libnice/libnice
b. cd libnice
c. meson --prefix=/usr build && ninja -C build && sudo ninja -C build install
5. INSTALL LIBSRTP
a. cd ~
b. wget https://github.com/cisco/libsrtp/archive/v2.3.0.tar.gz
c. tar xfv v2.3.0.tar.gz
d. cd libsrtp-2.3.0
e. ./configure --prefix=/usr --enable-openssl
f. make shared_library
g. sudo make install
6. INSTALL USRSCTP
a. cd ~
b. git clone https://github.com/sctplab/usrsctp
c. cd usrsctp
d. ./bootstrap
e. ./configure --prefix=/usr
f. make
g. sudo make install
7. INSTALL WEBSOCKETS
a. cd ~
b. git clone https://github.com/warmcat/libwebsockets.git
c. cd libwebsockets
d. git checkout v4.1-stable
e. mkdir build
f. cd build
g. cmake -DLWS_MAX_SMP=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" ..
h. make
i. sudo make install
8. INSTALL JANUS
a. cd ~
b. git clone https://github.com/meetecho/janus-gateway.git
c. cd janus-gateway
d. sh autogen.sh
e. ./configure --prefix=/opt/janus
f. make
g. sudo make install
h. sudo make configs
9. INSTALL NGINX
a. sudo apt install nginx
10. CONFIGURE DOMAIN
a. cd /etc/nginx/sites-available
b. cp default <domain.name>.conf
c. sudo nano <domain.name>.conf
d. # root /var/www/html/demos;
d. # server_name <domain.name>;
e. # save and exit
f. cd ../sites-enabled
g. rm default
h. ln -s ../sites-available/<domain.name>.conf
i. cd /var/www/html
j. ln -s /opt/janus/share/janus/demos
k. nginx -t && nginx -s reload
11. INSTALL LETSENCRYPT CERTIFICATE
a. sudo apt-get install certbot python3-certbot-nginx
b. sudo certbot --nginx -d <domain.name>
12. ADD CERTIFICATE TO JANUS
a. cd /opt/janus/etc
b. sudo nano janus.transport.http.jcfg
# https = true
# secure_port = 8089
# cert_pem = "/etc/letsencrypt/live/<domain.name>/fullchain.pem"
# cert_key = "/etc/letsencrypt/live/<domain.name>/privkey.pem"
# save and exit
c. sudo nano janus.transport.http.jcfg
# wss = true
# wss_port = 8989
# cert_pem = "/etc/letsencrypt/live/<domain.name>/fullchain.pem"
# cert_key = "/etc/letsencrypt/live/<domain.name>/privkey.pem"
# save and exit
13. CREATE JANUS SERVICE
a. sudo nano /etc/systemd/system/janus.service
b. # insert code:
[Unit]
Description=Janus WebRTC Server
After=network.target
[Service]
Type=simple
ExecStart=/opt/janus/bin/janus -o
Restart=on-abnormal
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
c. sudo systemctl enable janus
d. sudo systemctl start janus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment