Skip to main content

Setting Up Linux

1. System Dependencies​

You will need to install a couple of system dependencies, such as a C compiler and webkit2gtk for desktop development. Below are commands for a few popular distributions:

sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev

2. Rust​

To install Rust on Linux, open a terminal and enter the following command:

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
note

We have audited this bash script, and it does what it says it is supposed to do. Nevertheless, before blindly curl-bashing a script, it is always wise to look at it first. Here is the file as a plain script: rustup.sh

The command downloads a script and starts the installation of the rustup tool, which installs the latest stable version of Rust. You might be prompted for your password. If the installation was successful, the following line will appear:

Rust is installed now. Great!

Make sure to restart your Terminal for the changes to take effect.

Android​

First, make sure to install the required rust android targets:

rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

To set up your Linux machine for Android development you need to download and install Android Studio from the official website.

1. Configure JDK​

Android Studio includes a JDK so you do not need to download a separate one. Set the JAVA_HOME environment variable to the location of the JDK:

export JAVA_HOME=/opt/android-studio/jbr

Note that on older Android Studio installations the jbr directory may still be called jre.

2. Install the Android SDK and NDK​

You can use the SDK Manager in Android Studio to install:

  • Android SDK Platform
  • Android SDK Platform-Tools
  • NDK (Side by side)
  • Android SDK Build-Tools
  • Android SDK Command-line Tools
note

You may need to tick Show Package Details in the bottom right corner to be able to see some of these components.

Now you need to set the ANDROID_HOME and NDK_HOME environment variables:

export ANDROID_HOME="$HOME/Android/Sdk"
export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105"

Note that the path might be slightly different based on the version of NDK you installed.

Managing The Rust Installation​

You should keep your Rust version up to date whenever possible to always benefit from the latest improvements. To update Rust, open a terminal and run the following command:

rustup update

rustup can also be used to uninstall Rust from your machine fully:

rustup self uninstall

Troubleshooting​

To check whether you have Rust installed correctly, open a shell and enter this command:

rustc --version

You should see the version number, commit hash, and commit date for the latest stable version that has been released in the following format:

rustc x.y.z (abcabcabc yyyy-mm-dd)

If you don't see this information, your Rust installation might be broken. Please consult Rust's Troubleshooting Section on how to fix this. If your problems persist, you can get help from the official Tauri Discord and GitHub Discussions.