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 (4.11 or newer), macOS (11.0 or newer), 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
- Rust 1.78 or newer
- LLVM 17 or newer
- A C compiler such as GCC or clang
- Git, for managing packages using the
inko pkg
command
While using newer versions of LLVM may work, it's possible for a newer version to introduce breaking changes. As such, we recommend only using a newer version of LLVM if your platform doesn't offer a package for the version listed above.
The code generated by the compiler comes with the following system requirements:
- A 64-bits little-endian platform
- For AMD64: a CPU supporting x86-64-v2 or newer
- For ARM64: a CPU with Neon support
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
Nix
Inko is available in the unstable channel:
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
nix-channel --update
nix-shell -p 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:
Mode | Command | Executable | Runtime library |
---|---|---|---|
Debug | cargo build | ./target/debug/inko | ./target/debug/libinko.a |
Release | cargo 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
whereMODE
is eitherdebug
for debug builds orrelease
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 runningmake install
.PREFIX
: the path prefix to use for all files, defaults to/usr
. When combined withDESTDIR
, the value ofDESTDIR
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
Alpine
sudo apk add build-base rust cargo llvm17 llvm17-dev llvm17-static libstdc++-dev zlib-static zstd-static libxml2-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
echo -e "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main" | sudo tee /etc/apt/sources.list.d/llvm17.list
sudo apt-get update
sudo apt-get install --yes git build-essential llvm-17 llvm-17-dev libstdc++-11-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
macOS
brew install llvm@17 rust git
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
echo -e "deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic-17 main" | sudo tee /etc/apt/sources.list.d/llvm17.list
sudo apt-get update
sudo apt-get install --yes rustc cargo git build-essential llvm-17 llvm-17-dev libstdc++-11-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.