Skip to main content
Docker is the easiest way to deploy a self-hosted instance of Fonoster. This guide will walk you through deploying the Fonoster services using Docker and Docker Compose.

Prerequisites

The only prerequisite for Fonoster is to have Docker installed on the host machine.

Step-by-step installation

1

Prepare the environment

Follow the next few steps to prepare the environment:
Create a new directory in your preferred location and change it. The root directory we will use in the guide is fonoster.
mkdir -p fonoster/config
cd fonoster
Copy the .env.example from the repository to the current directory and rename it to .env. This file contains all the environment variables that the services need to run.You can use the following commands to copy all the necessary files:
curl -o .env https://raw.githubusercontent.com/fonoster/fonoster/master/.env.example
curl -o ./compose.yaml https://raw.githubusercontent.com/fonoster/fonoster/master/compose.yaml
curl -o ./config/integrations.json https://raw.githubusercontent.com/fonoster/fonoster/master/config/integrations.example.json
curl -o ./config/envoy.yaml https://raw.githubusercontent.com/fonoster/fonoster/master/config/envoy.yaml
Then, open the .env file with your favorite editor and update the following variables:
  • ASTERISK_SIPPROXY_HOST: Set this variable to the IP address of the host machine.
  • ROUTR_EXTERNAL_ADDRS: Set this variable to the IP address of the host machine.
  • ROUTR_RTPENGINE_HOST: Set this variable to the IP address of the host machine.
The integrations.json file contains the credentials for the integrations (stt, tts, etc). You must update this file with the correct credentials for the integrations you want to use.
In addition to the previous variables, you should update all the secrets and ensure the .env file is safely stored.
2

Generate keys

Next, generate a set of public and private keys for the server. You can use the following command to generate the keys:
mkdir -p config/keys
openssl genpkey -algorithm rsa -out config/keys/private.pem -pkeyopt rsa_keygen_bits:2048
openssl rsa -pubout -in config/keys/private.pem -out config/keys/public.pem
chmod 644 config/keys/*
3

Confirm the directory structure

Your directory structure should look like this:
.
├── .env
├── compose.yaml
└── config
    ├── envoy.yaml
    ├── integrations.json
    └── keys
        ├── private.pem
        └── public.pem

3 directories, 6 files
If it looks different, go back and review your steps.
4

Start the server

Finally, run the following command to start the application:
docker compose up -d
After a few moments, you can interact with Fonoster using the API or SDK.