Installing Nu

There are lots of ways to get Nu up and running. You can download pre-built binaries from our release pageInstalling Nu - 图1 (opens new window), use your favourite package managerInstalling Nu - 图2 (opens new window), or build from source.

Pre-built binaries

Nu binaries are published for Linux, macOS, and Windows with each GitHub releaseInstalling Nu - 图3 (opens new window). Just download, extract the binaries, then copy them to a location on your PATH.

Package managers

Nu is available via several package managers:

Packaging statusInstalling Nu - 图5 (opens new window)

For macOS and Linux, HomebrewInstalling Nu - 图6 (opens new window) is a popular choice (brew install nushell).

For Windows:

Build from source

You can also build Nu from source. First, you will need to set up the Rust toolchain and its dependencies.

Installing a compiler suite

For Rust to work properly, you’ll need to have a compatible compiler suite installed on your system. These are the recommended compiler suites:

Installing Rust

If we don’t already have Rust on our system, the best way to install it is via rustupInstalling Nu - 图12 (opens new window). Rustup is a way of managing Rust installations, including managing using different Rust versions.

Nu currently requires the latest stable (1.60 or later) version of Rust. The best way is to let rustup find the correct version for you. When you first open rustup it will ask what version of Rust you wish to install:

  1. Current installation options:
  2. default host triple: x86_64-unknown-linux-gnu
  3. default toolchain: stable
  4. profile: default
  5. modify PATH variable: yes
  6. 1) Proceed with installation (default)
  7. 2) Customize installation
  8. 3) Cancel installation

Once we are ready, we press 1 and then enter.

If you’d rather not install Rust via rustup, you can also install it via other methods (e.g. from a package in a Linux distro). Just be sure to install a version of Rust that is 1.60 or later.

Dependencies

Debian/Ubuntu

You will need to install the “pkg-config” and “libssl-dev” package:

  1. apt install pkg-config libssl-dev

Linux users who wish to use the rawkey or clipboard optional features will need to install the “libx11-dev” and “libxcb-composite0-dev” packages:

  1. apt install libxcb-composite0-dev libx11-dev

RHEL based distros

You will need to install “libxcb”, “openssl-devel” and “libX11-devel”:

  1. yum install libxcb openssl-devel libX11-devel

macOS

Using HomebrewInstalling Nu - 图13 (opens new window), you will need to install “openssl” and “cmake” using:

  1. brew install openssl cmake

Build using crates.ioInstalling Nu - 图14 (opens new window)

Nu releases are published as source to the popular Rust package registry crates.ioInstalling Nu - 图15 (opens new window). This makes it easy to build+install the latest Nu release with cargo:

  1. > cargo install nu

That’s it! The cargo tool will do the work of downloading Nu and its source dependencies, building it, and installing it into the cargo bin path so we can run it.

If you want to install with more features, you can use:

  1. > cargo install nu --features=extra

Once installed, we can run Nu using the nu command:

  1. $ nu
  2. /home/jt/Source>

Building from the GitHub repository

We can also build our own Nu from the latest source on GitHub. This gives us immediate access to the latest features and bug fixes. First, clone the repo:

  1. > git clone https://github.com/nushell/nushell.git

From there, we can build and run Nu with:

  1. > cd nushell
  2. nushell> cargo build --workspace --features=extra && cargo run --features=extra

You can also build and run Nu in release mode:

  1. nushell> cargo build --release --workspace --features=extra && cargo run --release --features=extra

People familiar with Rust may wonder why we do both a “build” and a “run” step if “run” does a build by default. This is to get around a shortcoming of the new default-run option in Cargo, and ensure that all plugins are built, though this may not be required in the future.

Setting the login shell (*nix)

!!! Nu is still in development, and may not be stable for everyday use. !!!

To set the login shell you can use the chshInstalling Nu - 图16 (opens new window) command. Some Linux distributions have a list of valid shells located in /etc/shells and will disallow changing the shell until Nu is in the whitelist. You may see an error similar to the one below if you haven’t updated the shells file:

  1. chsh: /home/username/.cargo/bin/nu is an invalid shell

You can add Nu to the list of allowed shells by appending your Nu binary to the shells file. The path to add can be found with the command which nu, usually it is $HOME/.cargo/bin/nu.

Setting the default shell (Windows Terminal)

If you are using Windows TerminalInstalling Nu - 图17 (opens new window) you can set nu as your default shell by adding:

  1. {
  2. "guid": "{2b372ca1-1ee2-403d-a839-6d63077ad871}",
  3. "hidden": false,
  4. "icon": "https://www.nushell.sh/icon.png",
  5. "name": "Nu Shell",
  6. "commandline": "nu.exe"
  7. }

to "profiles" in your Terminal Settings (JSON-file). The last thing to do is to change the "defaultProfile" to:

  1. "defaultProfile": "{2b372ca1-1ee2-403d-a839-6d63077ad871}",

Now, nu should load on startup of the Windows Terminal.