Centrifugo server is written in the Go language. It's open-source software, and the source code is available on Github.
Install from the binary release
For local development, you can download the prebuilt Centrifugo binary release (i.e., a single all-contained executable file) for your system.
Binary releases are available on Github. Download the latest release for your operating system, unpack it, and you are done. Centrifugo is pre-built for:
- Linux 64-bit (linux_amd64)
- Linux 32-bit (linux_386)
- Linux ARM 64-bit (linux_arm64)
- MacOS (darwin_amd64)
- MacOS on Apple Silicon (darwin_arm64)
- Windows (windows_amd64)
- FreeBSD (freebsd_amd64)
- ARM v6 (linux_armv6)
Archives contain a single statically compiled binary
centrifugo file that is ready to run.
If you are unsure which distribution you need, then on Linux or MacOS you can use the following command to download and unpack the
centrifugo binary to your current working directory:
curl -sSLf https://centrifugal.dev/install.sh | sh
See the version of Centrifugo:
Centrifugo requires a configuration file with several secret keys. If you are new to Centrifugo, then there is a genconfig command which generates a minimal configuration file to get started:
This creates a configuration file config.json with some auto-generated option values in the current directory (by default).
It's possible to generate a file in YAML or TOML format, for example:
./centrifugo genconfig -c config.toml
With a configuration file, you can finally run a Centrifugo instance:
We will talk about configuration in detail in the next sections.
You can also put or symlink
centrifugo into your
bin OS directory and run it from anywhere:
Centrifugo server has a docker image available on Docker Hub.
docker pull centrifugo/centrifugo
docker run --ulimit nofile=262144:262144 -v /host/dir/with/config/file:/centrifugo -p 8000:8000 centrifugo/centrifugo:v5 centrifugo -c config.json
Note that docker allows setting
nofile limits in command-line arguments, which is quite important to handle many simultaneous persistent connections and not run out of the open file limit (each connection requires one file descriptor). See also infrastructure tuning chapter.
Pin to the exact Docker Image tag in production, for instance:
centrifugo/centrifugo:v5.0.0. This will help to avoid unexpected problems during redeployment process.
Create configuration file
command: centrifugo -c config.json
Kubernetes Helm chart
See our official Kubernetes Helm chart. Follow instructions in a Centrifugo chart README to bootstrap Centrifugo inside your Kubernetes cluster.
RPM and DEB packages for Linux
Every time we make a new Centrifugo release we upload rpm and deb packages for popular Linux distributions on packagecloud.io.
At moment, we support versions of the following distributions:
- 64-bit Debian 10 Buster
- 64-bit Debian 11 Bullseye
- 64-bit Ubuntu 18.04 Bionic
- 64-bit Ubuntu 20.04 Focal Fossa
- 64-bit Ubuntu 20.04 Jammy
- 64-bit Centos 7
Centrifugo also works on 32-bit architecture, but we don't support packaging for it since 64-bit is more convenient for servers today.
With brew on macOS
If you are developing on macOS then you can install Centrifugo over
brew tap centrifugal/centrifugo
brew install centrifugo
Build from source
You need Go language installed. Then:
git clone https://github.com/centrifugal/centrifugo.git