« Self-hosted video conference for friends in 20 min
May 11, 2020 • ☕️ 3 min read
Might be useful for dummies (like me) who want to host video conference for fun/privacy/speed/restrictions/price/other reasons and don’t want to spend a lot of time learning all these things.
Why
Why to host your “private” video conference app? To influence connection speed (at least, be able to do it by host location, optimizations, control of users count, etc.). To have more confidence in privacy. To have no “free plan” restrictions. To have fun 😀
Why not to implement it by yourself? Well, actually, why not?! I think that’s a really interesting choice (plenty of examples). But if you have limited time and need more features than just video call, it makes sense to consider something already implemented.
Why Jitsi as a video conferencing tool? Open source, many github stars, nice reviews, no big brother (I hope), many features (multiple peers, chat, screen sharing, private chats, authentication, live streaming), etc.
Why Digital Ocean as a hosting? Easy to set up (understandable UI, many tutorials), close to my country (i.e. probably better speed), reliable (by reviews and self experience), not expensive (60-day free trial, after trial starting from 5$, huge free outbound data transfer).
Why Freenom as a domain name registrar? Because it provides free domains for 1 year.
P.S. I don’t have really good experience in all these tools. So, this tutorial is just for fast setup and usage that works for a couple of my friends.
Let’s start (3 steps)
Step 1. Create Digital Ocean droplet from template image
1.Check that you have an account in Digital Ocean. If not — sign up and login. It will give you 100$ trial for 2 months.
2. Click the following link to start wizard — https://cloud.digitalocean.com/droplets/new?image=opentradestatist-jitsiserver-18-04&size=c-2-4gib. (Image that is used in wizard is not mine, so great thanks to the person who developed it).
3. Select CPU/RAM + plan — depends on how many peers in total you want to support. For example, if you have 9 peers, choose at least CPU-Optimized plan 4GB RAM — 2 CPUs for no lagging conference.
4. Select Datacenter region — closest region to your peers location (e.g. Frankfurt for me). It’s really important, cause entire traffic for 3 and more peers will go to this server and will be transmitted from this server to all peers.
5. Add SSH keys — add your local ssh key from ~/.ssh/id_rsa.pub
to configure droplet by SSH in future. (Run ssh-keygen -t rsa
if you don’t have id_rsa.pub
)
6. Leave other fields default (if you want).
7. Click Create Droplet.
8. Wait for ~1 minute (you’ll see loading bar) until you see created droplet and IP address (_here is mine — _46.101.162.23).
9. You can issue http://your-ip (e.g. on http://46.101.162.23) in the browser to see nginx welcome page.
Step 2. Create domain
This step is required because WebRTC (protocol for communication that is used by Jitsi) doesn’t work with http IP only. Don’t even try to skip this step!
1.Check that you have an account in any domain name registrar (e.g. Freenom, Namecheap, Godaddy, etc.). If not — sign up and login. Freenom is going to be used in further steps.
Be aware that Freenom free domains will expire after 12 months and might be suspended within this period in some specific cases.
2. If you logged in to Freenom, go to https://my.freenom.com/domains.php and check availability of your desired free domain, e.g. alexconference.tk.
3. Click Get it now! and Checkout.
4. Change Period from 3 months free to 12 months free.
5. Click Use DNS, input IP address twice to A record and click Continue.
6. Agree to the Terms & Conditions and click Complete Order
7. After several minutes issue http://yourdesireddomain (http://alexconference.tk in my case) and you’ll see nginx welcome page.
Be worried! It can take even one day! But usually takes ~5 mins.
Step 3. Install Jitsi
- Open terminal and access droplet console with your IP address:
ssh root@46.101.162.23
2. Check that your domain is ready to use:
dig alexconference.tk A +short
You’ll see your IP. If you don’t see your IP wait for a couple of minutes. Usually it takes around 5 mins. But, again, can take an entire day..
3. Run script to install Jitsi. Script is located in /home/root
, as mentioned here. Takes ~1 min.
./01_videoconf.sh
4. Input your domain (e.g. alexconference.tk) when prompted and click Enter.
5. Choose Generate a new self-signed certificate and click Enter.
6. Wait for the script to be finished.
7. Run script to install SSL certificate (takes ~1 min).
./02_https.sh
8. Enter your email address.
9. Wait for the script to be finished.
THAT’S ALL!
Go to https domain (e.g. https://alexconference.tk) and have fun using your self-hosted video-conference.
P.S. You can monitor machine load in Digital Ocean graphs section or by monitoring tools (like htop or dockprom).
P.S.2. To entirely remove everything simply destroy your droplet from Digital Ocean and cancel your domain from Freenom.
References
- Jitsi Meet online — https://meet.jit.si/
- Digital Ocean Jitsi server — https://marketplace.digitalocean.com/apps/jitsi-server
- Docker Jitsi Docs — https://github.com/jitsi/docker-jitsi-meet
- Jitsi bandwidth requirements — https://docs.google.com/spreadsheets/d/1dJfyR2P915DO12C42S7iF1LIn393_copIX-p7K0ovYo/edit#gid=1170100212
- Jitsi performance people’s experience — https://community.jitsi.org/t/recommended-server-specs-for-2020
- Self-hosted Jitsi server with authentication — https://dev.to/noandrea/self-hosted-jitsi-server-with-authentication-ie7
- Video tutorial to host a Jitsi Meet Server — https://www.youtube.com/watch?v=IQRwtUamHQU
- NPM trends in open source video conferencing — https://www.npmtrends.com/janus-vs-kurento-utils-vs-mediasoup-vs-medooze-media-server