To prepare your computer for Gleam development you’ll need to install Gleam, Erlang, and optionally install any Gleam plugins for your editor.
Installing Gleam
Precompiled for amd64 Linux, Windows, and macOS
The easiest way to install Gleam on Linux, Windows, and Apple macOS is to download a prebuilt version of the compiler from the GitHub release page.
macOS
Using Homebrew
With Homebrew installed run the following:
brew update
brew install gleam
Using MacPorts
With MacPorts installed run the following:
sudo port install gleam
Linux
Using Homebrew
With Homebrew installed run the following:
brew update
brew install gleam
asdf version manager
asdf is a tool for installing and managing multiple version of programming languages at the same time. Install the asdf-gleam plugin to manage Gleam with asdf.
Alpine Linux
Gleam is available in the Community repository of Alpine Linux as a package gleam
. Install it with:
apk add gleam
Arch Linux
Gleam is available through the Arch User Repository
as package gleam
. You can use your prefered helper
to install it or clone it for manual build from https://aur.archlinux.org/packages/gleam-git.
yay -S gleam
Gentoo Linux
Gleam is available in the official package manager, but may need to be unmasked. Install it with:
sudo echo "dev-lang/gleam ~amd64" >> /etc/portage/package.accept_keywords
emerge --ask dev-lang/gleam
Void Linux
Gleam is available as part of the official packages repository. Install it with:
sudo xbps-install gleam
FreeBSD
Gleam is available in ports, and also in binary packages. You may need
to use the latest
package repo, amend per instructions in
/etc/pkg/FreeBSD.conf
. See below for adjusting your PATH to use latest
Erlang/OTP runtime and not just the standard OTP21:
$ pkg install -r FreeBSD lang/gleam lang/erlang-runtime23
$ export PATH=/usr/local/lib/erlang23/bin:$PATH
OpenBSD
Gleam is available as a binary package. You can install it with:
$ doas pkg_add gleam
openSUSE
Gleam is available as part of the official packages repository. Install it with:
# zypper install gleam
There are also nightlies available at this home project
Android
Termux
Gleam is available as part of the official packages repository. Install it with:
pkg install gleam
Windows
Using Scoop
With Scoop installed on your computer run the following:
scoop install gleam
Build from source
The compiler is written in the Rust programming language and so if you wish to build Gleam from source you will need to install the Rust compiler.
# Download the Gleam source code git repository
cd /tmp
git clone https://github.com/gleam-lang/gleam.git --branch $THE_LATEST_VERSION
cd gleam
# Build the Gleam compiler. This will take some time!
make install
# Verify the compiler is installed
# Prints "gleam $VERSION"
gleam --version
Installing Erlang
Gleam compiles to Erlang code, so Erlang needs to be installed to run Gleam code. Some of the above package managers (e.g. Homebrew) will install Erlang alongside Gleam automatically.
Precompiled builds for many popular operating systems can be downloaded from the Erlang solutions website.
Once Erlang has been installed you can check it is working by typing erl
-version
in your computer’s terminal. You will see version information like
this if all is well:
erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 12.1.5
Linux
Using Homebrew
Homebrew will install Erlang alongside Gleam automatically, though it can be manually installed by running the following:
brew update
brew install erlang
Alpine Linux (Community repository)
apk add erlang
Arch Linux (Community repository)
pacman -S erlang
Gentoo Linux (already installed after installing gleam through emerge)
emerge --ask dev-lang/erlang
Fedora
dnf install elixir erlang
Debian, Ubuntu
# Add to /etc/apt/sources.list
deb http://binaries2.erlang-solutions.com/ubuntu/ jammy-esl-erlang-25 contrib
# Possible other lines depending on your `lsb_release -c`
# deb http://binaries2.erlang-solutions.com/debian/ bullseye-elixir-1.15 contrib
# deb http://binaries2.erlang-solutions.com/ubuntu/ bionic-mongooseim-6 contrib
# Add Erlang Solutions repo keys:
wget https://binaries2.erlang-solutions.com/GPG-KEY-pmanager.asc
sudo apt-key add GPG-KEY-pmanager.asc
# Update apt and install esl-erlang
sudo apt update
sudo apt install esl-erlang
macOS
Using Homebrew
Homebrew will install Erlang alongside Gleam automatically, though it can be manually installed by running the following:
brew update
brew install erlang
Using MacPorts
With MacPorts installed run the following:
sudo port install erlang
Windows
Using Chocolatey
With Chocolatey installed on your computer run the following:
choco install erlang
Using Scoop
With Scoop installed on your computer run the following:
scoop install erlang
Using version managers
asdf
The asdf version manager has a plugin for installing Erlang. Installation and usage instructions can be found here:
Installing rebar3
When using Erlang based dependencies (such as their web servers and HTTP clients) the rebar3 Erlang build tool may need to be installed. Install rebar3 by following the official rebar3 installation instructions.
Editor Plugins
Gleam plugins are available for several popular editors. If one exists for your editor of choice consider installing it for syntax highlighting and other niceties.
- Vim - https://github.com/gleam-lang/gleam.vim
- Emacs - https://github.com/gleam-lang/gleam-mode
- Visual Studio Code - https://github.com/gleam-lang/vscode-gleam
- Sublime Text - https://github.com/digitalcora/sublime-text-gleam
- Atom - https://github.com/itsgreggreg/language-gleam
- Gedit - https://github.com/DannyLettuce/gleam_gedit
What next?
Now you have installed Gleam check out the Language Tour for an overview of the Gleam language.