---
title: "Running LiveKit on AWS"
date: "2021-10-25"
authors: "Mathew Kamkar"
tags: "tutorial"
---

# Running LiveKit on AWS

> This article is now out of date. For up to date instructions, see [https://docs.livekit.io/deploy/vm](https://docs.livekit.io/deploy/vm)

[Watch the original video on Loom](https://www.loom.com/share/29cdfc2acc0c4354838604722afb5717)

It’s now been a few months since we launched [LiveKit](https://github.com/livekit/livekit), and we’ve noticed getting up and running can be tricky if you don’t have Kubernetes set up. While [deploying on Kubernetes using Helm](https://docs.livekit.io/transport/self-hosting/kubernetes/) remains the robust path for production deployments, we wanted an easier way to get started with LiveKit.

Thus, we’ve put together a Cloud-Config template which renders a fully-functional, LiveKit server deploy, only a few steps beyond launching an EC2 instance. Here’s how to get going:

1. Generate your LiveKit API key and secret, following the docs: [https://docs.livekit.io/guides/getting-started#generate-api-key-and-secret](https://docs.livekit.io/guides/getting-started#generate-api-key-and-secret)
2. Acquire a domain name and purchase an SSL certificate. For example, you can use [AWS Route 53](https://aws.amazon.com/route53/) to [register](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html) and manage your domain (example-domain.com), and [Namecheap](https://www.namecheap.com/) to [purchase an SSL certificate](https://www.namecheap.com/security/ssl-certificates/) for your desired subdomain (livekit.example-domain.com).
3. Download a cloud-init template from our current [VM deployment guide](https://docs.livekit.io/transport/self-hosting/vm/) (this article predates the consolidated [cloud-init](https://cloudinit.readthedocs.io/) flow in those docs).
4. Edit the Cloud-Config template:\
   \- Fill in the API key and secret with the ones you generated in step 1\
   \- Paste your SSL certificate and key from step 2
5. From the [AWS EC2 Console](https://console.aws.amazon.com/ec2/), [launch an instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/launching-instance.html). Choose the latest Ubuntu Server AMI, along with your desired instance type.
6. Paste your edited Cloud-Config template into the **User data** field, under the **Advanced Details** section.
7. In the **Configure Security Group** section, make sure to allow the following ports to your LiveKit Server instance:\
   \- TCP 22\
   \- TPC 443\
   \- TCP 7880\
   \- TCP 7881\
   \- UDP 7882
8. Launch your LiveKit Server instance.
9. Create an **A record** on your domain, pointing from your desired subdomain (livekit.example-domain.com) to the public address for your instance.
10. **Done!** For completeness:\
    \- Use the [LiveKit Connection Tester](https://www.livekit.com/connection-test) to make sure everything is working properly.\
    \- [Generate a token](https://docs.livekit.io/guides/access-tokens) using your desired method, and the “LiveKit URL” will look something like this: wss\://livekit.example-domain.com. You can join a chat on your own LiveKit Server instance, using our [React Example app](https://example.livekit.io/#/).

### Debugging

Should something go wrong, you can log in to your LiveKit instance with SSH. Here are some helpful troubleshooting commands:

```
systemctl status docker.service
systemctl status nginx.service
systemctl status docker.livekit-server@v0.13.service
tail /var/log/nginx/access.log
tail /var/log/nginx/error.log
```

***

For other simple deployment options, including deployment to Digital Ocean, and building a custom AMI, see the [LiveKit deployment guide](https://docs.livekit.io/deploy/vm/).

As always, don’t hesitate to send us a GitHub PR with any improvements, or ask questions in our [community Slack workspace](http://livekit.com/join-slack).