selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
Ferrite Telegram Server logo

Self-host Ferrite Telegram Server

Self-hosted MTProto server for Telegram clients

AlphaOpen SourceAGPL-3.0
Updatedlast month
LanguageC#
Setup difficultyAdvanced
Stars
177
Port
5222 (MTProto over TCP and WebSocket)
Install with Docker
Official Telegram iOS client exchanging messages and media through FerriteOfficial Telegram iOS client in a Ferrite basic groupOfficial Telegram Android client in a Ferrite voice callOfficial Telegram Android client receiving video through a Ferrite call

What is Ferrite Telegram Server?

Ferrite is a .NET server implementing the MTProto protocol used by Telegram. It enables running the official Telegram mobile applications against a privately operated backend. The server provides messaging capabilities including private conversations, groups, channels, and supergroups. It handles media file transfers and supports secret chats with end-to-end encryption. Voice and video calling works for both individual and group conversations. Data storage options range from simple local files to distributed systems including Cassandra, Redis, Kafka, object storage, and Elasticsearch. Deployment options include a standalone .NET process, a Docker container, or a complete distributed stack via .NET Aspire. All configuration is done through environment variables prefixed with FERRITE_. The code is licensed under AGPL-3.0-or-later and has no connection to Telegram Messenger Inc.

Should you self-host Ferrite Telegram Server?

Ferrite Telegram Server scores 39/100 on selfhost.directory (how scoring works) and ranks #88 of 110 in Chat. It has 177 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is advanced: plan for several services and some ongoing maintenance. It is AGPL-3.0-licensed and written mostly in C#.

Its closest alternative on selfhost.directory is Zulip (82/100, 26 125 stars). It scores higher overall, so compare the two before you pick. See Ferrite Telegram Server vs Zulip side by side.

Features

  • Group callsRequires mediasoup worker
  • Media upload and download
  • MTProto protocol support
  • Multi-layer API support
  • Multiple Storage Backends
  • Official Telegram client compatibilityRequires rebuilding clients with custom keys
  • One-to-one and group messaging
  • Secret chats (E2EE)
  • Voice and video calls

Ferrite Telegram Server README

How to install Ferrite Telegram Server

Install Ferrite Telegram Server with Docker

Docker

docker build -f deploy/Dockerfile.ferrite -t ferrite . docker run --rm -p 5222:5222
-e FERRITE_PUBLIC_ADDRESS=203.0.113.10
-e FERRITE_PORT=5222
-e FERRITE_DATA_PATH=/data
-v ferrite-data:/data ferrite

Built from deploy/Dockerfile.ferrite

How to configure Ferrite Telegram Server

  • FERRITE_CASSANDRA_HOSTS127.0.0.1Cassandra hosts (comma-separated)

    Cassandra hosts (comma-separated)

  • FERRITE_CASSANDRA_KEYSPACEferriteCassandra keyspace

    Cassandra keyspace

  • FERRITE_CASSANDRA_PORT9042Cassandra port

    Cassandra port

  • FERRITE_DATA_PATHdataRoot directory for local state

    Root directory for local state

  • FERRITE_ELASTICSEARCH_URLElasticsearch URL

    Elasticsearch URL

  • FERRITE_GROUP_CALL_AUTH_SECRETShared secret for mediasoup worker

    Shared secret for mediasoup worker

  • FERRITE_GROUP_CALL_CONTROL_URLMediasoup worker control endpoint

    Mediasoup worker control endpoint

  • FERRITE_KAFKA_CONFIGURATION127.0.0.1:9092Kafka bootstrap servers

    Kafka bootstrap servers

  • FERRITE_NODE_IDnode.guidStable node GUID; set explicitly when running more than one node

    Stable node GUID; set explicitly when running more than one node

  • FERRITE_PORT5222TCP port for MTProto and WebSocket

    TCP port for MTProto and WebSocket

  • FERRITE_PUBLIC_ADDRESS10.0.2.2Address advertised to clients in the datacenter list

    Address advertised to clients in the datacenter list

  • FERRITE_REDIS_CONFIGURATION127.0.0.1:6379Redis connection string

    Redis connection string

  • FERRITE_S3_ACCESS_KEYminioadminS3 access key

    S3 access key

  • FERRITE_S3_SECRET_KEYminioadminS3 secret key

    S3 secret key

  • FERRITE_S3_SERVICE_URLhttp://127.0.0.1:9000S3-compatible object storage endpoint

    S3-compatible object storage endpoint

  • FERRITE_STORAGE_PROFILELocalOverall backend set (Local or Distributed)

    Overall backend set (Local or Distributed)

    values: Local, Distributed

  • FERRITE_TURN_ENABLEDoffEnable TURN server for relayed calls

    Enable TURN server for relayed calls

    values: on, off

  • FERRITE_TURN_SECRETStatic-auth secret for TURN server

    Static-auth secret for TURN server

More in Instant Messaging

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…