CINXE.COM

Install Rust - Rust Programming Language

<!doctype html> <html lang="en-US"> <head> <meta charset="utf-8"> <title> Install Rust - Rust Programming Language </title> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="description" content="A language empowering everyone to build reliable and efficient software."> <!-- Twitter card --> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="@rustlang"> <meta name="twitter:creator" content="@rustlang"> <meta name="twitter:title" content="Install Rust"> <meta name="twitter:description" content="A language empowering everyone to build reliable and efficient software."> <meta name="twitter:image" content="https://www.rust-lang.org/static/images/rust-social.jpg"> <!-- Facebook OpenGraph --> <meta property="og:title" content="Install Rust" /> <meta property="og:description" content="A language empowering everyone to build reliable and efficient software."> <meta property="og:image" content="https://www.rust-lang.org/static/images/rust-social-wide.jpg" /> <meta property="og:type" content="website" /> <meta property="og:locale" content="en_US" /> <!-- styles --> <link rel="stylesheet" href="/static/styles/a11y-dark.css"/> <link rel="stylesheet" href="/static/styles/vendor_10880690442070639967.css"/> <link rel="stylesheet" href="/static/styles/fonts_8049871103083011125.css"/> <link rel="stylesheet" href="/static/styles/app_1609526410131002304.css"/> <!-- favicon --> <link rel="apple-touch-icon" sizes="180x180" href="/static/images/apple-touch-icon.png?v=ngJW8jGAmR"> <link rel="icon" sizes="16x16" type="image/png" href="/static/images/favicon-16x16.png"> <link rel="icon" sizes="32x32" type="image/png" href="/static/images/favicon-32x32.png"> <link rel="icon" type="image/svg+xml" href="/static/images/favicon.svg"> <link rel="manifest" href="/static/images/site.webmanifest?v=ngJW8jGAmR"> <link rel="mask-icon" href="/static/images/safari-pinned-tab.svg?v=ngJW8jGAmR" color="#000000"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-config" content="/static/images/browserconfig.xml?v=ngJW8jGAmR"> <meta name="theme-color" content="#ffffff"> <!-- Custom Highlight pack with: Rust, Markdown, TOML, Bash, JSON, YAML, and plaintext. --> <script src="/static/scripts/highlight.pack.js" defer></script> <script src="/static/scripts/init.js" defer></script> </head> <body> <nav class="flex flex-row justify-center justify-end-l items-center flex-wrap ph2 pl3-ns pr3-ns pb3"> <div class="brand flex-auto w-100 w-auto-l self-start tc tl-l"> <a href="/" class="brand"> <img class="v-mid ml0-l" alt="Rust Logo" src="/static/images/rust-logo-blk.svg"> <span class="dib ml1 ml0-l">Rust</span> </a> </div> <ul class="nav list w-100 w-auto-l flex flex-none flex-row flex-wrap justify-center justify-end-l items-center pv2 ph0 ph4-ns"> <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/tools/install">Install</a></li> <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/learn">Learn</a></li> <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://play.rust-lang.org/">Playground</a></li> <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/tools">Tools</a></li> <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/governance">Governance</a></li> <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/community">Community</a></li> <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://blog.rust-lang.org/">Blog</a></li> </ul> <div class=" w-100 w-auto-l flex-none flex justify-center pv4 pv-0-l languages"> <div class="select"> <label for="language-nav" class="hidden">Language</label> <select id="language-nav" data-current-lang="en-US"> <option title="English (en-US)" value="en-US">English (en-US)</option> <option title="Español (es)" value="es">Español (es)</option> <option title="Français (fr)" value="fr">Français (fr)</option> <option title="Italiano (it)" value="it">Italiano (it)</option> <option title="日本語 (ja)" value="ja">日本語 (ja)</option> <option title="Português (pt-BR)" value="pt-BR">Português (pt-BR)</option> <option title="Русский (ru)" value="ru">Русский (ru)</option> <option title="Türkçe (tr)" value="tr">Türkçe (tr)</option> <option title="简体中文 (zh-CN)" value="zh-CN">简体中文 (zh-CN)</option> <option title="正體中文 (zh-TW)" value="zh-TW">正體中文 (zh-TW)</option> </select> </div> </div> </nav> <main> <header class="mt3 mt2-ns mb4 mb5-ns tc tl-ns"> <div class="w-100 mw-none ph3 mw8-m mw9-l center f3"> <h1>Install Rust</h1> </div> </header> <section id="rustup" class="green"> <div class="w-100 mw-none ph3 mw8-m mw9-l center f3"> <header> <h2>Using rustup (Recommended)</h2> <div class="highlight"></div> </header> <div class="row"> <div id="platform-instructions-unix" class="instructions db"> <p>It looks like you’re running macOS, Linux, or another Unix-like OS. To download Rustup and install Rust, run the following in your terminal, then follow the on-screen instructions. See <a href="https://forge.rust-lang.org/infra/other-installation-methods.html">"Other Installation Methods"</a> if you are on Windows.</p> <pre><code class="db w-100 copyable">curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></pre> </div> <div id="platform-instructions-win" class="instructions dn"> <p>It looks like you’re running Windows. To start using Rust, download the installer, then run the program and follow the onscreen instructions. You may need to install the <a href="https://visualstudio.microsoft.com/visual-cpp-build-tools/">Visual Studio C++ Build tools</a> when prompted to do so. If you are not on Windows see <a href="https://forge.rust-lang.org/infra/other-installation-methods.html">"Other Installation Methods"</a>.</p> <div class="mw9 center ph3-ns"> <div class="cf ph2-ns"> <div class="fl w-100 w-50-ns pa2"> <a href="https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-init.exe" class="button button-secondary">Download <span class="nowrap">rustup-init.exe</span> <span class="nowrap">(32-bit)</span></a> </div> <div class="fl w-100 w-50-ns pa2"> <a href="https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe" class="button button-secondary">Download <span class="nowrap">rustup-init.exe</span> <span class="nowrap">(64-bit)</span></a> </div> </div> </div> <h3 class="mt4">Windows Subsystem for Linux</h3> <p>If you’re a Windows Subsystem for Linux user run the following in your terminal, then follow the on-screen instructions to install Rust.</p> <pre><code class="db w-100 copyable">curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></pre> </div> <div id="platform-instructions-default" class="instructions dn"> <div> <p> To install Rust, if you are running a Unix such as WSL, Linux or macOS,<br> run the following in your terminal, then follow the on-screen instructions. </p> <pre><code class="db w-100 copyable">curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></pre> </div> <hr class="white-hr" /> <div> <p> If you are running Windows,<br>download and run <a href="https://win.rustup.rs">rustup‑init.exe</a> then follow the on-screen instructions. </p> </div> </div> </div> <script type="text/javascript" src="/static/scripts/app_7421438271980368202.js"></script> </div> </section> <section id="installation-notes" class="white"> <div class="w-100 mw-none ph3 mw8-m mw9-l center f3"> <header> <h2>Notes about Rust installation</h2> <div class="highlight"></div> </header> <div> <h3>Getting started</h3> <p> If you're just getting started with Rust and would like a more detailed walk-through, see our <a href=" /learn/get-started ">getting started</a> page. </p> <div class="platform-specific win dn"> <h3>Windows considerations</h3> <p> On Windows, Rust additionally requires the MSVC build tools for Visual Studio 2013 or later. See <a href="https://rust-lang.github.io/rustup/installation/windows-msvc.html"> MSVC prerequistes</a> </p> <p> For further information about configuring Rust on Windows see the <a href="https://rust-lang.github.io/rustup/installation/windows.html"> Windows-specific <code>rustup</code> documentation</a>. </p> </div> <h3>Toolchain management with <code>rustup</code></h3> <p> Rust is installed and managed by the <a href="https://rust-lang.github.io/rustup/"><code>rustup</code></a> tool. Rust has a 6-week <a href="https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md"> rapid release process </a> and supports a <a href="https://forge.rust-lang.org/release/platform-support.html">great number of platforms</a>, so there are many builds of Rust available at any time. <code>rustup</code> manages these builds in a consistent way on every platform that Rust supports, enabling installation of Rust from the beta and nightly release channels as well as support for additional cross-compilation targets. </p> <p> If you've installed <code>rustup</code> in the past, you can update your installation by running <code>rustup update</code>. </p> <p> For more information see the <a href="https://rust-lang.github.io/rustup/"> <code>rustup</code> documentation</a>. </p> <h3>Configuring the <code>PATH</code> environment variable</h3> <p> In the Rust development environment, all tools are installed to the <span class="platform-specific not-win di"> <code>~/.cargo/bin</code> </span> <span class="platform-specific win dn"> <code>%USERPROFILE%\.cargo\bin</code> </span> directory, and this is where you will find the Rust toolchain, including <code>rustc</code>, <code>cargo</code>, and <code>rustup</code>. </p> <p> Accordingly, it is customary for Rust developers to include this directory in their <a href="https://en.wikipedia.org/wiki/PATH_(variable)"> <code>PATH</code> environment variable</a>. During installation <code>rustup</code> will attempt to configure the <code>PATH</code>. Because of differences between platforms, command shells, and bugs in <code>rustup</code>, the modifications to <code>PATH</code> may not take effect until the console is restarted, or the user is logged out, or it may not succeed at all. </p> <p> If, after installation, running <code>rustc --version</code> in the console fails, this is the most likely reason. </p> <h3>Uninstall Rust</h3> <p> If at any point you would like to uninstall Rust, you can run <code>rustup self uninstall</code>. We'll miss you though! </p> </div> </div> </section> <section id="other-methods" class="purple"> <div class="w-100 mw-none ph3 mw8-m mw9-l center f3"> <header> <h2>Other installation methods</h2> <div class="highlight"></div> </header> <p> The installation described above, via <code>rustup</code>, is the preferred way to install Rust for most developers. However, Rust can be installed via other methods as well. </p> <a href="https://forge.rust-lang.org/infra/other-installation-methods.html" class="button button-secondary"> Learn more </a> </div> </section> </main> <footer> <div class="w-100 mw-none ph3 mw8-m mw9-l center f3"> <div class="flex flex-column flex-row-ns pv0-l"> <div class="flex flex-column mw8 w-100 measure-wide-l pv2 pv5-m pv2-ns ph4-m ph4-l" id="get-help"> <h4>Get help!</h4> <ul> <li><a href="/learn">Documentation</a></li> <li><a href="http://forge.rust-lang.org">Rust Forge (Contributor Documentation)</a></li> <li><a href="https://users.rust-lang.org">Ask a Question on the Users Forum</a></li> </ul> <div class="languages"> <div class="select"> <label for="language-footer" class="hidden">Language</label> <select id="language-footer"> <option title="English (en-US)" value="en-US">English (en-US)</option> <option title="Español (es)" value="es">Español (es)</option> <option title="Français (fr)" value="fr">Français (fr)</option> <option title="Italiano (it)" value="it">Italiano (it)</option> <option title="日本語 (ja)" value="ja">日本語 (ja)</option> <option title="Português (pt-BR)" value="pt-BR">Português (pt-BR)</option> <option title="Русский (ru)" value="ru">Русский (ru)</option> <option title="Türkçe (tr)" value="tr">Türkçe (tr)</option> <option title="简体中文 (zh-CN)" value="zh-CN">简体中文 (zh-CN)</option> <option title="正體中文 (zh-TW)" value="zh-TW">正體中文 (zh-TW)</option> </select> </div> </div> </div> <div class="flex flex-column mw8 w-100 measure-wide-l pv2 pv5-m pv2-ns ph4-m ph4-l"> <h4>Terms and policies</h4> <ul> <li><a href="/policies/code-of-conduct">Code of Conduct</a></li> <li><a href="/policies/licenses">Licenses</a></li> <li><a href="https://foundation.rust-lang.org/policies/logo-policy-and-media-guide/">Logo Policy and Media Guide</a></li> <li><a href="/policies/security">Security Disclosures</a></li> <li><a href="https://foundation.rust-lang.org/policies/privacy-policy/">Privacy Notice</a></li> <li><a href="/policies">All Policies</a></li> </ul> </div> <div class="flex flex-column mw8 w-100 measure-wide-l pv2 pv5-m pv2-ns ph4-m ph4-l"> <h4>Social</h4> <div class="flex flex-row flex-wrap items-center"> <a rel="me" href="https://social.rust-lang.org/@rust" target="_blank"><img src="/static/images/mastodon.svg" alt="Mastodon" title="Mastodon" /></a> <a href="https://twitter.com/rustlang" target="_blank"><img src="/static/images/twitter.svg" alt="twitter logo" title="Twitter"/></a> <a href="https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA" target="_blank"><img class="pv2" src="/static/images/youtube.svg" alt="youtube logo" title="YouTube"/></a> <a href="https://discord.gg/rust-lang" target="_blank"><img src="/static/images/discord.svg" alt="discord logo" title="Discord"/></a> <a href="https://github.com/rust-lang" target="_blank"><img src="/static/images/github.svg" alt="github logo" title="GitHub"/></a> </div> </div> </div> <div class="attribution"> <p> Maintained by the Rust Team. See a bug? <a href="https://github.com/rust-lang/www.rust-lang.org/issues/new/choose">File an issue!</a> </p> <p>Looking for the <a href="https://prev.rust-lang.org">previous website</a>?</p> </div> </div> </footer> <script src="/static/scripts/languages.js"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10