Install

On CentOS

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

Official Crystal rpm repository

To install latest stable Crystal release from the official Crystal repository hosted on the Open Build Service 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.

  • --version with major.minor or latest 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

Insert your distribution name and release as {REPOSITORY} in the following script and you are all set. You can find available options on the installation page at OBS.

cat > /etc/yum.repos.d/crystal.repo <<END
[crystal]
name=Crystal
type=rpm-md
baseurl=https://download.opensuse.org/repositories/devel:/languages:/crystal/{REPOSITORY}/
gpgcheck=1
gpgkey=https://download.opensuse.org/repositories/devel:/languages:/crystal/{REPOSITORY}/repodata/repomd.xml.key
enabled=1
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

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.