Project

General

Profile

Install Mediasoup API on Ubuntu Bionic » History » Version 3

Olivier Bitsch, 04/15/2021 06:52 AM

1 1 Olivier Bitsch
# Install Mediasoup API on Ubuntu Bionic
2
3
This guide will provide the correct way to deploy mediasoup-api on public server.
4
5 2 Olivier Bitsch
### Install repository
6 1 Olivier Bitsch
7
~~~
8
echo "deb [trusted=yes] https://projects.iabsis.com/repository/mediasoup-api/debian bionic main" \
9
  > /etc/apt/sources.list.d/iabsis.list
10
11
cat > /etc/apt/auth.conf << EOF
12
machine projects.iabsis.com
13
login iabsis-apt
14
password <password>
15
EOF
16
~~~
17
18 2 Olivier Bitsch
###  Install package
19 1 Olivier Bitsch
20
~~~
21 2 Olivier Bitsch
apt install mediasoup-api nginx
22
~~~
23
24
### Configure Mediasoup
25
26
~~~
27
## Define random key here
28
JWT_SECRET=<change secret>
29
30
## Configure credentials used to consume mediasoup API
31
API_USER=<define login>
32
API_SECRET=<define password>
33
34
## Define here the public IP server
35
PUBLIC_IP=<define local server IP>
36
37
## If server is behind nat, you might need to advertise 
38
# the real public IP by commenting out this line.
39
;ANNOUNCED_IP=1.2.3.4
40
41
## You will need to open UDP port in the follow range, you
42
# can adjust the range if required.
43
RTC_MIN_PORT=40000
44
RTC_MAX_PORT=49000
45
46
## If this server is behind a reverse proxy, you might need to trust it
47
TRUST_PROXY=127.0.0.1
48
49
## The best practice is to use reverse proxy, but if you want
50
# this API to serve directly HTTPS, you might need to configure the
51
# following lines
52
HTTP_ONLY=true
53
LISTEN=3480
54
;CERT=/etc/mediasoup-api/sample.localhost.cert.pem
55
;KEY=/etc/mediasoup-api/sample.localhost.key.pem
56
LISTEN_REDIRECT=3481
57 1 Olivier Bitsch
~~~
58 3 Olivier Bitsch
59
### Enable mediasoup at boot
60
61
~~~
62
systemctl enable mediasoup-api
63
~~~