Core libraries such as glibc frequently break compatibility with older systems. For this reason, you must build your Tauri application using the oldest base system you intend to support. A relatively old system such as Ubuntu 18.04 is more suited than Ubuntu 22.04, as the binary compiled on Ubuntu 22.04 will have a higher requirement of the glibc version, so when running on an older system, you will face a runtime error like
/usr/lib/libc.so.6: version 'GLIBC_2.33' not found. We recommend using a Docker container or GitHub Actions to build your Tauri application for Linux.
Tauri allows your app to be packaged as a
.deb (Debian package) file. The Tauri CLI bundles your application binary and additional resources in this format if you build on Linux. Please note that
.deb packages can only be created on Linux as cross-compilation doesn't work yet.
The stock Debian package generated by the Tauri bundler has everything you need to ship your application to Debian-based Linux distributions, defining your application's icons, generating a Desktop file, and specifying the dependencies
libgtk-3-0, along with
libappindicator3-1 if your app uses the system tray.
GUI apps on macOS and Linux do not inherit the
$PATH from your shell dotfiles (
.zshrc, etc). Check out Tauri's fix-path-env-rs crate to fix this issue.
Tauri 애플리케이션을 빌드하고 단일 실행 파일로 묶으려면 간단하게 다음 명령을 실행하면 됩니다:
npm run tauri build
yarn tauri build
pnpm tauri build
cargo tauri build
이는, 프론트엔드를 빌드(
beforeBuildCommand이 설정되었다면) 하고, Rust 바이너리를 컴파일하며, 외부 바이너리들과 리소스들을 모아 최종적인 플랫폼에 맞는 번들과 설치 프로그램을 생성합니다.
사용자 정의 파일들
Tauri exposes a few configurations for the Debian package in case you need more control.
If your app depends on additional system dependencies you can specify them in
tauri.conf.json > tauri > bundle > deb > depends.
To include custom files in the Debian package, you can provide a list of files or folders in
tauri.conf.json > tauri > bundle > deb > files. The configuration object maps the path in the Debian package to the path to the file on your filesystem, relative to the
tauri.conf.json file. Here's an example configuration:
"/usr/share/README.md": "../README.md", // copies the README.md file to /usr/share/README.md
"usr/share/assets": "../assets/" // copies the entire assets directory to /usr/share/assets
AppImage is a distribution format that does not rely on the system installed packages and instead bundles all dependencies and files needed by the application. For this reason, the output file is larger but easier to distribute since it is supported on many Linux distributions and can be executed without installation. The user just needs to make the file executable (
chmod a+x MyProject.AppImage) and can then run it (
AppImages are convenient, simplifying the distribution process if you cannot make a package targeting the distribution's package manager. Still, you should carefully use it as the file size grows from the 2-6MBs range to 70+MBs.
If your app plays audio/video you need to enable
tauri.conf.json > tauri > bundle > appimage > bundleMediaFramework. This will increase the size of the AppImage bundle to include addition
gstreamer files needed for media playback. This flag is currently only supported on Ubuntu build systems.