Static cURL binary built with the latest features, such as ECH, HTTP3, brotli, and zstd.
The script will automatically retrieve the latest version of each component.
Simply execute it to compile the most recent version.
Included components
- openssl
- libssh2
- nghttp3
- ngtcp2
- nghttp2
- brotli
- zstd
- zlib-ng (default) or zlib
- libidn2
- c-ares
- libpsl
- trurl
curl -V
- Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt mqtts pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
- Features: alt-svc asyn-rr AsynchDNS brotli ECH HSTS HTTP2 HTTP3 HTTPS-proxy HTTPSRR IDN IPv6 Largefile libz NTLM PSL SSL SSLS-EXPORT threadsafe TLS-SRP UnixSockets zstd
Download the latest release from the Releases page.
Extract the archive and use it.
The binary is built with GitHub Actions.
Starting from cURL 8.20.0, all builds use OpenSSL 4.x with ECH support enabled by default.
For older releases (before 8.20.0), two versions were provided: one with ECH support and one without.
curl-linux-ARCH-musl-VERSION: binaries for Linux, linked withmuslcurl-linux-ARCH-glibc-VERSION: binaries for Linux, linked withglibc, these binaries may have compatibility issues in certain system environmentscurl-linux-ARCH-dev-VERSION: binaries, headers and static library archives for Linux, linked withmusl(after curl v8.2.1)curl-macOS-ARCH-VERSION: binaries for macOScurl-macOS-ARCH-dev-VERSION: binaries, headers and static library archives for macOScurl-windows-ARCH-VERSION: binaries for Windowscurl-windows-ARCH-dev-VERSION: binaries, headers and library archives for Windows
For Linux glibc versions, if your system’s /etc/nsswitch.conf file is configured with passwd: compat, glibc will attempt to load libnss_compat.so, libnss_nis.so, libpthread.so, etc. These libraries may not be compatible with the statically linked glibc, and the program might crash.
Currently, there is no good solution for this issue, except for compiling glibc within the script.
In this case, it is recommended to use the musl version.
This script utilizes clang(glibc) and qbt-musl-cross-make(musl) for cross-compilation on Linux, mstorsjo/llvm-mingw for cross-compilation for Windows, providing support for the following architectures:
- Linux
- x86_64
- aarch64
- armv7
- armv5
- i686
- riscv64
- s390x
- mips64
- mips64el
- mips
- mipsel
- powerpc64le
- powerpc
- loongarch64
- macOS
- x86_64
- aarch64
- Windows
- x86_64
- aarch64
- i686
- armv7
- Install Docker, clone this Git repository, navigate to the repository directory, and then execute the following command:
sh curl-static-cross.sh
The script will create a container and compile the host architecture cURL only.
supported architectures
-
ARCHES:
"x86_64 aarch64 armv7 armv5 riscv64 s390x mips64 mips64el mips mipsel powerpc64le powerpc i686 loongarch64" -
If you need to specify more parameters, run:
docker run --network host --rm -v $(pwd):/mnt -w /mnt \ --name "build-curl-$(date +%Y%m%d-%H%M)" \ -e ARCHES="x86_64 aarch64 armv7 armv5 riscv64 s390x mips64 mips64el mips mipsel powerpc64le powerpc i686 loongarch64" \ -e TLS_LIB="openssl" \ -e LIBC="glibc" \ -e QBT_MUSL_CROSS_MAKE_VERSION="" \ -e CURL_VERSION="" \ -e OPENSSL_VERSION="" \ -e NGTCP2_VERSION="" \ -e NGHTTP3_VERSION="" \ -e NGHTTP2_VERSION="" \ -e ZLIB_LIB="zlib-ng" \ -e ZLIB_VERSION="" \ -e ZLIB_NG_VERSION="" \ -e LIBUNISTRING_VERSION="" \ -e LIBIDN2_VERSION="" \ -e LIBPSL_VERSION="" \ -e ARES_VERSION="" \ -e ENABLE_TRURL="true" \ -e TRURL_VERSION="" \ debian:latest sh curl-static-cross.sh
Run the following command to compile:
ARCHES="x86_64 arm64" \
TLS_LIB=openssl \
CURL_VERSION="" \
OPENSSL_VERSION="" \
NGTCP2_VERSION="" \
NGHTTP3_VERSION="" \
NGHTTP2_VERSION="" \
LIBIDN2_VERSION="" \
LIBUNISTRING_VERSION="" \
ZLIB_LIB="zlib-ng" \
ZLIB_VERSION="" \
ZLIB_NG_VERSION="" \
BROTLI_VERSION="" \
ZSTD_VERSION="" \
LIBSSH2_VERSION="" \
LIBPSL_VERSION="" \
ARES_VERSION="" \
bash curl-static-mac.sh-
Install Docker, clone this Git repository, navigate to the repository directory, and then execute the following command:
ARCHES="x86_64 i686 aarch64 armv7" sh curl-static-win.sh
script will create a Linux container and cross-compile cURL via LLVM MinGW toolchain. -
If you need to specify more parameters, run:
docker run --network host --rm -v $(pwd):/mnt -w /mnt \ --name "build-curl-$(date +%Y%m%d-%H%M)" \ -e ARCHES="x86_64 i686 aarch64 armv7" \ -e TLS_LIB="openssl" \ -e CURL_VERSION="" \ -e OPENSSL_VERSION="" \ -e NGTCP2_VERSION="" \ -e NGHTTP3_VERSION="" \ -e NGHTTP2_VERSION="" \ -e ZLIB_LIB="zlib-ng" \ -e ZLIB_VERSION="" \ -e ZLIB_NG_VERSION="" \ -e LIBUNISTRING_VERSION="" \ -e LIBIDN2_VERSION="" \ -e LIBPSL_VERSION="" \ -e ARES_VERSION="" \ -e ENABLE_TRURL="true" \ -e TRURL_VERSION="" \ mstorsjo/llvm-mingw:latest sh curl-static-win.sh
Supported Environment Variables list:
For all VERSION variables, leaving them blank will automatically fetch the latest version.
ARCHES: The list of architectures to compile. You can set one or multiple architectures from the following options: CompileTLS_LIB: The TLS library. Onlyopensslfor now.LIBC: The libc.glibc(default) ormusl, only affects Linux.QBT_MUSL_CROSS_MAKE_VERSION: The version of qbt-musl-cross-make, only affectsmusl. Check the releases on qbt-musl-cross-make/releasesCURL_VERSION: The version of cURL. If set todev, will fetch the latest source code of branchmasterfrom GitHub.OPENSSL_VERSION: The version of OpenSSL. If set todev, will fetch the branchOPENSSL_BRANCHfrom GitHub.OPENSSL_BRANCH: The branch that fetch from GitHub, this variable will be ignored ifOPENSSL_VERSIONis not set todev.NGTCP2_VERSION: The version of ngtcp2.NGHTTP3_VERSION: The version of nghttp3.NGHTTP2_VERSION: The version of nghttp2.LIBUNISTRING_VERSION: The version of libunistring.LIBIDN2_VERSION: The version of libidn2.LIBSSH2_VERSION: The version of libssh2.ZLIB_LIB: The zlib library.zlib-ng(default) orzlib.zlib-ngis built in zlib compatible mode (ZLIB_COMPAT=ON) as a drop-in replacement for zlib, with runtime CPU detection for SIMD optimizations.ZLIB_VERSION: The version of zlib, only affectsZLIB_LIB=zlib.ZLIB_NG_VERSION: The version of zlib-ng, only affectsZLIB_LIB=zlib-ng.BROTLI_VERSION: The version of brotli.ZSTD_VERSION: The version of zstd.LIBPSL_VERSION: The version of libpsl.ARES_VERSION: The version of c-ares.TRURL_VERSION: The version of trurl.ENABLE_TRURL: Compile trurl. The default value isfalse, set it totrueto enable. NOT available for macOS.ENABLE_DEBUG: Enable curl debugging. The default value isfalse, set it totrueto enable. This setting appends--enable-debugto the curl compilation options.
The compiled files will be saved in the current release directory.
- All builds now use OpenSSL 4.x with ECH (Encrypted Client Hello) enabled by default, so there is only one build variant per platform.
- The
ENABLE_ECHvariable has been removed. - For older releases (cURL < 8.20.0), two variants were provided (with and without ECH). OpenSSL 3.x can still be selected via
OPENSSL_VERSIONfor compatibility.
- The curl.se CA bundle (
cacert.pem, checksum-verified at build time) is embedded into every binary via--with-ca-embed. - The binaries no longer depend on a CA file path from the build machine (e.g. Debian's
/etc/ssl/certs/ca-certificates.crt), so HTTPS works out of the box on any distro, even without a system CA bundle. - Windows builds no longer ship a separate
curl-ca-bundle.crtfile; they use the same embedded bundle. cacert.pemis included in eachdevpackage, and its SHA256 is recorded in the release notes.- You can still override the trust store at runtime with
--cacert/--capathor theCURL_CA_BUNDLE/SSL_CERT_FILEenvironment variables.
- zlib-ng replaces zlib by default, providing faster gzip/deflate compression and decompression with SIMD optimizations (SSE/AVX, NEON, etc.) selected at runtime based on the CPU.
- It is built in zlib compatible mode (
ZLIB_COMPAT=ON), socurl -Vreports it aszlib/x.y.z.zlib-ng, and thedevpackage still provideslibz.aandzlib.h. - Set
ZLIB_LIB=zlibto build with the original zlib instead.
- Windows: built with
--enable-sspiand--enable-windows-unicode(SSPI authentication and Unicode file names/arguments). - macOS: built with
--with-apple-sectrustand--enable-ca-native, so certificates can also be verified via the Apple Security framework / system keychain.
- No more
Insufficient randomnesserrors: OpenSSL is now built with a privateopenssldir(/opt/static-curl/ssl) instead of/etc/ssl, so it no longer loads the host's/etc/ssl/openssl.cnf, which could break random seeding on some distros. - SMB and NTLM are explicitly enabled again, as they are disabled by default since cURL 8.20.0.
--libcurloption is enabled (--enable-libcurl-option), socurl --libcurl file.ccan generate libcurl source code.- Podman can be used as a drop-in replacement for Docker when building for Linux and Windows.