Setting Up Couchbase Rust SDK with rustup
Discover how to get up and running developing applications with the Couchbase Rust SDK — for those less familiar with Rust.
A simple Rust orientation intro for _non-_Rust folk who are evaluating the Couchbase Rust SDK.
|
Is This Page for You?
This page is to help evaluate the Couchbase Rust SDK, if Rust is not where you spend the majority of your working day. It is aimed at Software Architects, QE folk, managers, and anyone else who needs to run through using the Rust SDK without necessarily being comfortable with installing and developing with Rust. If this is not you, head back to the rest of the Couchbase Rust SDK documentation. |
Installing
First thing is to get up and running with a Rust environment.
This is done with rustup, which allows you to switch between versions, and try out nightly builds, as well as stable and beta releases.
These instructions apply to MacOS and to GNU/Linux. Windows use is beyond the scope of this guide — please see the Rust site.
Rustup
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
If you’ve installed rustup in the past, you can update it with:
$ rustup update
C Compiler
You will need a linker — which you most likely have installed already — and a C compiler, as several crates (Rust packages) depend on C code.
For Ubuntu, these packages are usually installed as part of build-essentials.
Otherwise, install your distribution’s prefered C compiler — usually gcc, but it may be clang.
On OSX:
$ xcode-select --install
PATH
The Rust toolchain — including rustc, cargo, and rustup — will be installed to the ~/.cargo/bin directory.
You will want to add this to your $PATH (using your platform’s preferred place for environmental variables, such as .bashrc).
Once you’ve add to your path, restart the console, and test the installation with:
$ rustc --version
Which should return something like:
rustc 1.94.0 (4a4ef493e 2026-03-02)
Now install the SDK or try our Quickstart Guide.
Further Help
One of the best introductions to Rust programming is The Rust Programming Language, by Steve Klabnik, Carol Nichols, and Chris Krycho (with contributions from the Rust Community).