Install

On Red Hat

In Red Hat derived distributions, you can use the Official Crystal rpm repository. Linuxbrew is also available.

Official Crystal rpm 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 url of the repo is https://dl.bintray.com/crystal/rpm/{DISTRO}/{ARCH}/{CHANNEL}.

  • The valid {DISTRO} values are el6 and all.
  • The only supported {ARCH} for rpm is x86_64.
  • The valid {CHANNEL} values are stable, unstable, or nightly.

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

cat > /etc/yum.repos.d/crystal.repo <<END
[crystal]
name=Crystal
baseurl=https://dl.bintray.com/crystal/rpm/{DISTRO}/x86_64/{CHANNEL}
gpgcheck=0
repo_gpgcheck=1
gpgkey=http://bintray.com/user/downloadSubjectPublicKey?username=bintray
END

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

sudo yum install crystal

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

sudo yum update crystal

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.