When running locally how to give my own secret key...
# ask-ai
m
When running locally how to give my own secret key for live kit server
t
Thanks for reaching out, Rahib. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you please help me understand a bit better? Are you asking about setting a custom secret key for authentication, like when generating access tokens? Or is this about a different part of the LiveKit server setup? Also, it would be great to know if you’re running the server locally using a particular environment or tool. I’m here to help you through this!
m
Yeah like api key and secret. I am setting it using docker. Running both livekit and sip server locally
Currently the default value is devkey right.
t
Absolutely! When you're running the LiveKit server in development mode (for example, using
livekit-server --dev
), the default API key is
devkey
and the default API secret is
secret
. These defaults are set up automatically to make local testing easier for you. If you have any questions or need help with this, feel free to ask!
Hi there! To help you set a custom API key and secret for the LiveKit server when running locally with Docker, here’s a simple guide to walk you through the steps: 1. For the LiveKit Server If you’re running the LiveKit server in development mode (like with
livekit-server --dev
), it conveniently uses default credentials for you: • API Key:
devkey
• API Secret:
secret
These defaults are perfect for local testing, so you don’t have to worry about setting them manually right now. 2. For Dependent Services (e.g., SIP, Egress, Ingress) If you want to configure the API key and secret for services like SIP, Egress, or Ingress, you have two friendly options: using a configuration file or environment variables. Let’s explore both! Using a Configuration File
Copy code
api_key: your-api-key
api_secret: your-api-secret
ws_url: <ws://host.docker.internal:7880>  # or the appropriate IP for Linux
redis:
  address: host.docker.internal:6379     # or the appropriate IP for Linux
Simply mount this file into your container when you run it. For example:
Copy code
docker run --rm \
  -e EGRESS_CONFIG_FILE=/out/config.yaml \
  -v ~/livekit-egress:/out \
  livekit/egress
Using Environment Variables If you prefer, you can set the API key and secret directly as environment variables like this:
Copy code
docker run --rm \
  -e LIVEKIT_API_KEY=your-api-key \
  -e LIVEKIT_API_SECRET=your-api-secret \
  -e LIVEKIT_WS_URL=<ws://host.docker.internal:7880> \
  livekit/egress
Just swap out
your-api-key
and
your-api-secret
with the credentials you want to use. 3. For Production When you’re ready to move to production, I recommend checking out the LiveKit deployment guides. They’ll help you manage your credentials securely and smoothly. If you have any questions or need further help, feel free to ask. I’m here to support you every step of the way! Sources: Running LiveKit locally | LiveKit Docs | Self-hosting the Egress Service | LiveKit Docs | Self-hosting the Ingress Service | LiveKit Docs | README.md
156 Views