Install Nanocl on MacOS
Quick install
curl -fsSL https://download.next-hat.com/scripts/get-nanocl.sh | sh
This script will download and install the latest version of Nanocl for your platform.
It doesn't require root privileges. Since it install it in your home directory,
under the ~/.nanocl directory. And add a ~/.nanocl/env file in your shell profile to
have the nanocl command in your PATH. But then the command will only be available for your user.
The script will fallback to build from source from crates.io if no prebuilt binary is available for your platform. Therefore no man pages will be installed in this case.
Manual install
Get the CLI tarball
You can grab the nanocl tarball directly from the GitHub releases page.
You can also use the following commands to download and extract the tarball:
curl -LO https://github.com/next-hat/nanocl/releases/download/nanocl-0.18.0/nanocl_0.18.0_mac_aarch64.tar.gz
tar -xzf nanocl_0.18.0_mac_aarch64.tar.gz
Extracted directory layout:
.
├─ bin/
│ └─ nanocl (the nanocl binary)
└─ share/
└─ man/
└─ man1/ (multiple man pages for nanocl and its subcommands)
We now need to move the nanocl binary and it's man pages to appropriate locations.
sudo mv ./bin/nanocl /usr/local/bin
sudo mv ./share/man/man1/* /usr/local/share/man/man1
Compile from source
You need to install PostgreSQL first using Homebrew:
brew install libpq
brew link --force libpq
If there is no release binary for your platform, you can compile Nanocl from source using Cargo.
Prerequisites:
- Install Rust toolchain: https://www.rust-lang.org/tools/install
- Ensure OpenSSL and PostgreSQL client libraries are available
cargo install nanocl
Verify installation
Once all these steps are done, you can verify that Nanocl is correctly installed by checking its version:
nanocl --version
Now be sure to follow the post installation steps to install nanocl components.