This guide helps you to set up LiveKit server on a virtual machine on AWS EC2 or Digital Ocean.
To start, you'll need:
- A valid self-generated LiveKit API key, following the instructions in the Getting Started guide.
- A valid SSL certificate and private key, which can be purchased anywhere that sells SSL certificates such as Namecheap.
- Ability to add a DNS record pointing to your new LiveKit Server.
Deploy with Cloud Init
This is the easiest method for deploying LiveKit Server. You can deploy a LiveKit Server using a vanilla Linux image and Cloud Init configuration file.
- Digital Ocean
LiveKit Server can be deployed with either Amazon Linux 2 or Ubuntu. Use the
cloud-init.<platform>.yaml file corresponding to your desired platform:
- Download one of the above
cloud-init.<platform>.yamlfiles. Edit it to include your LiveKit Server configuration, SSL certificate, and SSL private key.
- Open the AWS Console and navigate to EC2.
- Launch an instance.
- Choose the latest "Amazon Linux 2" or "Ubuntu Server" AMI.
- In the "Step 3: Configure Instance Details" screen, copy and paste text from your modified
cloud-init.yamlfile from step 1 into the "User data" field, under the "Advanced Details" section.
- Launch your instance as usual.
- Download the cloud-init.ubuntu.yaml file. Edit it to include your LiveKit Server configuration, SSL certificate, and SSL private key.
- Log on to Digital Ocean and navigate to Droplets.
- Create a Droplet.
- Choose the latest "Ubuntu" image.
- Under "Select additional options" section, check the "User data" option. Copy and paste text from your modified
cloud-init.ubuntu.yamlfile from step 1 into the "User data" field, under the "Advanced Details" section.
- Launch your droplet as usual.
In addition to the required ports listed above, you'll also want to open up the following ports:
- TCP 22 - SSH
- TPC 443 - SSL terminated WebSocket
- UDP 7882 - RTC UDP
If something is not working as expected, SSH in to your server and use the following commands to investigate:
systemctl status docker.service
systemctl status nginx.service
systemctl status firstname.lastname@example.org