- Creates an EC2 instance with a cloud-init script to install and configure Jitsi Meet.
- Creates a security group that acts as firewall to regulate web traffic to your Jitsi Meet instance.
- Creates a Route53 A Record under a previously hosted subdomain that points to this EC2 instance. E.g.
511066ad.meet.example.com
- Jitsi Meet server can be accessed at
https://<UUIDv4>.<hosted-subdomain>
E.g.https://511066ad.meet.example.com
- Anonymous meetings cannot be initiated on this setup. One needs a moderator username and password to be able to initiate meets.
- Registered domain and access to DNS Management
- Amazon AWS Account - Creating an AWS Account
- Terraform (required for local execution, can be skipped for Terraform Cloud) - Installing Terraform
- AWS CLI (required for local execution, can be skipped for Terraform Cloud) - Installing AWS CLI
It is recommended to use a subdomain E.g. meet.example.com for your videoconferencing needs, so that it would stay separate from your parent domain and any other services such as email, FTP, etc hosted on other subdomains.
We will use Amazon AWS Route53 for DNS Management of this subdomain. DNS A Records will be created each time fresh infrastructure is created and they will be removed each time the infrastructure is destroyed. For this, we will need to add a public hosted zone for our subdomain (E.g. meet.example.com).
AWS guide for creating a new hosted zone for your subdomain
Once created, your public hosted zone will list a set of nameservers.
E.g.
ns-1232.awsdns-26.org
ns-1704.awsdns-21.co.uk
ns-346.awsdns-43.com
ns-681.awsdns-21.net
We will need to add these records as NS Records for our subdomain. Jump to: Add NS Records for your subdomain
- Create an IAM User by navigating to Services -> IAM -> Users (left pane) -> Add User.
- Provide a name E.g. jitsi-user and select Programmatic Access as Access type. Click on Next:Permissions.
- Select Attach existing policies directly, then select the checkbox against AdministratorAccess and click on Next:Tags. Then click Next:Review.
- Review your settings. If everything looks good, click on Create User. This will create a new user.
Note the Access key ID and Secret access key. We will use this to configure AWS CLI. Jump to: Configure AWS CLI
- Navigate to DNS Management on your domain registrar's portal.
- Add a new record for each nameserver in your public hosted zone by selecting NS as the record type and value as the nameserver address E.g. ns-1323.awsdns-26.org
- Save all NS records.
- Verify DNS changes with the following command on your terminal/shell
dig NS meet.example.com
It should return AWS nameservers in response.
Fork this repository(https://github.com/mavenik/jitsi-terraform) on Github
- Sign Up or Sign In to Terraform Cloud
- Create a new workspace by clicking on +New Workspace. If you just signed up, you will be taken to workspace creation flow directly.
- Follow instructions to connect Github and select your fork of this repository.
- On Configure Settings tab of workspace creation, click on Advanced and type
aws
as Terraform Working Directory - Click on Create Workspace to finalize workspace creation
- After a workspace is created, you will be prompted to set variables for this workspace. Click on Configure variables.
- Under Terraform Variables, click on +Add variable to add variables from the list of variables. You could skip the optional variables. Click here to see the list of variables.
- Under Environment Variables, add AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables. Use values obtained after IAM user creation. Choose the checkbox against Sensitive to mask this information.
Within your workspace, click on Queue Plan to apply your Terraform configuration. By default, Terraform Cloud will ask for a confirmation before applying changes.
Within your workspace, navigate to Settings -> Destruction and Deletion and click on Queue destroy plan. You will be prompted for a confirmation by typing the workspace name and then again before destroying your infrastructure.
- On your Terminal/Shell, type
aws configure
- Enter your Access Key ID and Secret Key obtained after IAM user creation
- Enter default region name. E.g. ap-south-1
This will create a [default] set of credentials at ~/.aws/credentials
git clone https://github.com/mavenik/jitsi-terraform.git
cd jitsi-terraform/aws
- Copy
terraform.tfvars.example
as
cp terraform.tfvars.example terraform.tfvars
- Refer following table to edit relevant variable values
Variable | Description | Example |
---|---|---|
aws_profile | (Optional) Name of AWS profile created during aws configure |
default |
aws_region | Name of AWS Region where Jitsi server will be deployed | ap-south-1 for (Mumbai) |
email_address | Email used to generate SSL Certificates via Let's Encrypt | [email protected] |
admin_username | Moderator username for Jitsi. Anonymous meetings are disabled. | [email protected] |
admin_password | Password for moderator account | Pa$sw0rd |
enable_ssh_access | (Optional) Enable SSH access via pre-imported SSH key pair. | false |
ssh_key_name | SSH Key Pair name from AWS Console. Required for debugging via SSH access when enable_ssh_access is set. |
jitsi_key |
instance_type | Type of AWS instance for your Jitsi Meet server | m5.xlarge |
parent_subdomain | Subdomain under which Jitsi Meet will be hosted. | meet.example.com |
subdomain | (Optional) Subdomain under parent subdomain at which Jitsi Meet will be hosted | dev , test , stage |
Out of the box, Jitsi only supports streaming via YouTube. Based on this nifty hack, it is possible to bypass this limitation and stream to multiple endpoints simultaneously. It is also possible to record and stream at the same time.
The way this is achieved is by introducing an RTMP proxy with Nginx that pushes incoming RTMP stream from Jibri to pre-defined RTMP endpoints.
To stream, start all your streams on streaming services like Facebook, Periscope, YouTube, Twitch, etc to get your stream keys and RTMP endpoints.
Click on Start Live Streaming->Enter any dummy BUT VALID YouTube stream key E.g. cafe-dead-face-fab9
->Start streaming
Jitsi Meet requires a valid YouTube stream key, so we provide a dummy but valid one. Our proxy RTMP server then relays incoming stream to multiple pre-configured endpoints.
All recordings whether streamed or recorded, will be available at https://my-server.net/recordings/
E.g. https://511066ad.meet.example.com/recordings/
. This endpoint will require basic auth and use the same credentials as Moderator/Host username and password set using admin_username
and admin_password
variables respectively.
Variable | Description | Default |
---|---|---|
enable_recording_streaming | Enables recording and streaming capability with Jibri | false |
recorded_stream_dir | Base directory to save recorded meets. Should be accessible via www-data user or group | /var/www/html/recordings |
record_all_streaming | Implicitly records every streaming session if enabled | false |
facebook_stream_key | Stream key for Facebook | Empty string |
youtube_stream_key | Stream key for YouTube | Empty string |
twitch_ingest_endpoint | RTMP server or ingest endpoint for Twitch | rtmp://live-sin.twitch.tv/app |
twitch_stream_key | Stream key for Twitch | Empty string |
periscope_server_url | RTMP server URL for Periscope/Twitter | rtmp://in.pscp.tv:80/x |
periscope_stream_key | Stream key for Periscope/Twitter | Empty string |
rtmp_stream_urls | Generic RTMP URLs | [] |
- Initialize Terraform
terraform init
cd jitsi-terraform/aws
terraform apply
Type 'yes' when prompted and hit enter.
This will create the following resources:
- An Amazon EC2 instance
- A Route53 DNS A Record with
<UUIDv4>.<parent_subdomain>
or<subdomain>.<parent_subdomain>
E.g.511066ad.meet.example.com
ortest.meet.example.com
pointing to the public IPv4 address of newly created Amazon EC2 instance. - Security group that acts as a firewall for our EC2 instance. Allows traffic on
UDP 10000
(jitsi-videobridge)TCP 80
(HTTP)TCP 443
(HTTPS) andUDP 53
(DNS). SSH access can optionally be enabled by settingenable_ssh_access
variable to true.
The command will print address of server host and an HTTPS URL for your Jitsi Meet server. E.g. https://511066ad.meet.example.com
Please note that Jitsi Meet will take a few minutes to configure itself after terraform apply
has finished execution. Navigate to your web browser to check if Jitsi Meet was up and running.
cd jitsi-terraform/aws
terraform destroy
Type 'yes' when prompted and hit enter.
This will destroy all resources created in AWS during terraform apply
.