Install

On Ubuntu

In Ubuntu derived distributions, you can use the Official Crystal deb repository. Snapcraft and Linuxbrew are also available.

Official Crystal deb repository

To install latest stable Crystal release from the official Crystal repository hosted on Bintray run in your command line:

curl -fsSL https://crystal-lang.org/install.sh | sudo bash

The install script accepts optional arguments to install or update to a release of another channel.

  • --crystal with major.minor.patch, major.minor, or major.minor.patch-iteration values
  • --channel with stable, unstable, or nightly value
curl -fsSL https://crystal-lang.org/install.sh | sudo bash -s -- --channel=nightly

You can find more detailed information at the announcement post.

Manual setup

The deb repository declared with deb_distribution=all and deb_component is used for the channel.

  • The valid channels are stable, unstable, or nightly.

Replace the desired {CHANNEL} in the following script and you are all set.

echo "deb https://dl.bintray.com/crystal/deb all {CHANNEL}" | tee /etc/apt/sources.list.d/crystal.list

# Add repo metadata signign key (shared bintray signing key)
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
apt-get update

Once the repository is configured you’re ready to install Crystal:

sudo apt install crystal

The following packages are not required, but recommended for using the respective features in the standard library:

sudo apt install libssl-dev      # for using OpenSSL
sudo apt install libxml2-dev     # for using XML
sudo apt install libyaml-dev     # for using YAML
sudo apt install libgmp-dev      # for using Big numbers
sudo apt install libz-dev        # for using crystal play

When a new Crystal version is released you can upgrade your system using:

sudo apt update
sudo apt install crystal

Snapcraft

The Crystal snap requires to be run in classic confinement. If you have snapd installed you’re ready to install Crystal:

sudo snap install crystal --classic

You can also install the latest nightly build by using the edge channel.

sudo snap install crystal --classic --edge

Find further information at Crystal’s snapcraft page

Linuxbrew

If you have Linuxbrew installed you’re ready to install Crystal:

brew update
brew install crystal-lang

If you’re planning to contribute to the language itself you might find useful to install LLVM as well. So replace the last line with:

brew install crystal-lang --with-llvm

Done installing?

Learn

Found any issues?

Forum support.