---
title: "Installation | Micdrop"
description: "Set up Micdrop server with WebSocket support for real-time voice conversations."
url: "https://micdrop.dev/docs/server/installation"
---

*   [Getting Started](/docs/getting-started)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    

[Micdrop](/) › [Documentation](/docs/getting-started)

# Installation

Set up Micdrop server with WebSocket support for real-time voice conversations.

## Package Installation

Terminal window

```
npm install @micdrop/server
```

## Basic WebSocket Server

Create a simple voice server using the Node.js WebSocket library:

### 1\. Install Dependencies

Terminal window

```
# Install Micdrop server and WebSocketnpm install @micdrop/server wsnpm install -D @types/ws
# Install AI providersnpm install @micdrop/openai @micdrop/gladia @micdrop/elevenlabs
```

### 2\. Create `server.ts`

```
import { MicdropServer } from '@micdrop/server'import { ElevenLabsTTS } from '@micdrop/elevenlabs'import { GladiaSTT } from '@micdrop/gladia'import { OpenaiAgent } from '@micdrop/openai'import { WebSocketServer } from 'ws'
const wss = new WebSocketServer({ port: 8081 })
wss.on('connection', (socket) => {  // Setup AI components  const agent = new OpenaiAgent({    apiKey: process.env.OPENAI_API_KEY || '',    systemPrompt: 'You are a helpful voice assistant. Keep responses concise.',  })
  const stt = new GladiaSTT({    apiKey: process.env.GLADIA_API_KEY || '',  })
  const tts = new ElevenLabsTTS({    apiKey: process.env.ELEVENLABS_API_KEY || '',    voiceId: process.env.ELEVENLABS_VOICE_ID || '',  })
  // Create voice conversation handler  new MicdropServer(socket, {    firstMessage: 'Hello! How can I help you today?',    agent,    stt,    tts,  })})
console.log('🎤 Micdrop server running on ws://localhost:8081')
```

Of course you can use any other providers, see [AI Integrations](/docs/ai-integration) for more details.

### 3\. Environment Setup

Create a `.env` file:

Terminal window

```
OPENAI_API_KEY=your_openai_api_key_hereELEVENLABS_API_KEY=your_elevenlabs_api_key_hereELEVENLABS_VOICE_ID=your_preferred_voice_idGLADIA_API_KEY=your_gladia_api_key_here
```

### 4\. Run Server

Terminal window

```
# Install tsx for TypeScript executionnpm install -g tsx
# Run the servertsx server.ts
# Or compile and runnpx tsc server.tsnode server.js
```

[Previous← Server (Node.js)](/docs/server)[NextWith Fastify →](/docs/server/with-fastify)

On this page

*   [Package Installation](#package-installation)
*   [Basic WebSocket Server](#basic-websocket-server)
*   [1\. Install Dependencies](#1-install-dependencies)
*   [2\. Create server.ts](#2-create-serverts)
*   [3\. Environment Setup](#3-environment-setup)
*   [4\. Run Server](#4-run-server)
