You're looking at the documentation for the "main" branch, click here to view the documentation for the latest stable release.

Installation

Inko's native code compiler is written in Rust and uses LLVM as its backend. The generated machine code links against a small runtime library, also written in Rust.

This guide covers the steps needed to get Inko installed on your platform of choice.

Supported platforms

Inko supports Linux, macOS, and FreeBSD (13.2 or newer). Inko might also work on other platforms, but we only provide support for the listed platforms. Windows isn't supported.

Requirements

  • A 64-bits little-endian platform
  • Rust 1.70 or newer
  • LLVM 17
  • A C compiler such as GCC or clang
  • Git, for managing packages using the inko pkg command

Cross-platform

The easiest way to install Inko is to use Inko's own version manager: ivm. ivm supports all the platforms officially supported by Inko.

When installing Inko using ivm, you must first install the dependencies listed here.

Once ivm is installed, you can install Inko as follows:

ivm install latest

ivm installs Inko from source, so you'll need to install the necessary dependencies for your platform first.

This installs the latest known version. If you want to install a specific version, run the following instead (where X.Y.Z is the version you want to install):

ivm install X.Y.Z

For more details on how to use ivm and switch versions, refer to the ivm guide.

Docker

If you are using Docker or Podman, you can use our official Docker/Podman images. These images are published on GitHub.com.

To install a specific version, run the following (replacing X.Y.Z with the version you want to install):

docker pull ghcr.io/inko-lang/inko:X.Y.Z # Using Docker
podman pull ghcr.io/inko-lang/inko:X.Y.Z # Using Podman

You can then run Inko as follows:

docker run inko-lang/inko:X.Y.Z inko --version # Using Docker
podman run inko-lang/inko:X.Y.Z inko --version # Using Podman

We also build a container for every commit on the main branch, provided the tests are passing. If you like to live dangerously, you can use these as follows:

# Using Docker:
docker pull ghcr.io/inko-lang/inko:main
docker run inko-lang/inko:main inko --version

# Using Podman:
podman pull ghcr.io/inko-lang/inko:main
podman run inko-lang/inko:main inko --version

Arch Linux

Inko is available in the AUR:

yay -S inko     # Latest stable release
yay -S inko-git # Latest Git commit

Fedora

Inko is available as a Copr repository:

sudo dnf install dnf-plugins-core
sudo dnf copr enable yorickpeterse/inko
sudo dnf install inko

FreeBSD

Inko is available as a port:

sudo pkg install inko

macOS

Inko is available in Homebrew:

brew install inko

From source

When building from Git, first clone the repository:

git clone https://github.com/inko-lang/inko.git
cd inko

Or use a release tarball:

VER='0.15.0' # Replace this with the latest version of Inko

mkdir $VER
curl https://releases.inko-lang.org/$VER.tar.gz -o $VER.tar.gz
tar -C $VER -xf $VER.tar.gz
cd $VER

You can then compile Inko as follows:

ModeCommandExecutableRuntime library
Debugcargo build./target/debug/inko./target/debug/libinko.a
Releasecargo build --release./target/release/inko./target/release/libinko.a

In both cases the standard library in std/src is used. You can customise the standard library and runtime library paths by setting these environment variables when running cargo build:

  • INKO_STD: the full path to the directory containing the standard library modules, defaults to ./std/src.
  • INKO_RT: the full path to the directory containing the runtime libraries to link the generated code against, defaults to ./target/MODE where MODE is either debug for debug builds or release for release builds.

If you are building a package, it's recommended to use the provided Makefile instead, as this simplifies the process of moving the necessary files in place and using the right paths. To compile a release build of Inko, run make and make install to install the files. This process can be customised by setting the following Make variables:

  • DESTDIR: the directory to install files into when running make install.
  • PREFIX: the path prefix to use for all files, defaults to /usr. When combined with DESTDIR, the value of DESTDIR prefixes this value.

For example:

make PREFIX=/usr/local
make install DESTDIR=./package-root PREFIX=/usr/local

The PREFIX variable must be set for both the make and make install commands, but DESTDIR is only necessary for make install.

Dependencies

When building from source or using ivm, you'll need to install the necessary dependencies.

Arch Linux

sudo pacman -Sy llvm rust git base-devel

Arch Linux being a rolling release distribution means the llvm package could be upgraded to a newer (and incompatible) version of LLVM. If this is the case, you'll need to change the package name to e.g. llvm17 and install it from the AUR.

Alpine

Due to this bug in the llvm-sys crate, compiling the compiler for musl targets (which includes Alpine) fails with the error "could not find native static library rt, perhaps an -L flag is missing?".

sudo apk add build-base rust cargo llvm17 llvm17-dev llvm17-static git

Debian

Debian 13:

sudo apt-get install --yes rust cargo git build-essential llvm-17 llvm-17-dev libstdc++-11-dev libclang-common-17-dev zlib1g-dev libzstd-dev

Debian 12:

curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main"
sudo apt-get update
sudo apt-get install --yes git build-essential llvm-17 llvm-17-dev libstdc++-10-dev libclang-common-17-dev zlib1g-dev libpolly-17-dev libzstd-dev

For older versions, refer to LLVM's Debian/Ubuntu packages page and adjust the add-apt-repository accordingly.

For Debian 12 and older, the version of Rust is too old, so you'll need to use rustup to install Rust.

Fedora

For Fedora 40 and newer:

sudo dnf install gcc make rust cargo llvm17 llvm17-devel llvm17-static libstdc++-devel libstdc++-static libffi-devel zlib-devel git

For Fedora 39:

sudo dnf install gcc make rust cargo llvm llvm-devel llvm-static libstdc++-devel libstdc++-static libffi-devel zlib-devel git

Older versions of Fedora aren't supported.

FreeBSD

sudo pkg install llvm17 rust git

You may have to set the LIBRARY_PATH variable as follows:

export LIBRARY_PATH="/usr/local/lib"

Without this the linker may fail to find the zstd and libffi libraries, which are needed by LLVM on FreeBSD.

macOS

brew install llvm@17 rust git

You may have to set LIBRARY_PATH as follows:

export LIBRARY_PATH="$(brew --prefix llvm@17)/lib:$(brew --prefix zstd)/lib"

You may also have to add the LLVM bin directory to your PATH as follows:

export PATH="$(brew --prefix llvm@17)/bin:$PATH"

Without setting these variables, it's possible building of Inko fails due to the build process not finding the necessary LLVM libraries.

See this Homebrew issue for details on why this might be necessary.

Ubuntu

For Ubuntu 24.04 and newer:

sudo apt-get install --yes rustc cargo git build-essential llvm-17 llvm-17-dev libstdc++-11-dev libclang-common-17-dev zlib1g-dev libzstd-dev

For 23.10:

curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository "deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic-17 main"
sudo apt-get update
sudo apt-get install --yes rustc cargo git build-essential llvm-17 llvm-17-dev libstdc++-10-dev libclang-common-17-dev zlib1g-dev libpolly-17-dev libzstd-dev

For older versions, refer to LLVM's Debian/Ubuntu packages page and adjust the add-apt-repository accordingly.