Install Swift - Linux | Swift.org
Install Swift Linux macOS Windows 1. Install Swift via Swiftly
The Swiftly installer manages Swift and its dependencies. It supports switching between different versions and downloading updates. curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \ tar zxf swiftly-$(uname -m).tar.gz && \ ./swiftly init --quiet-shell-followup && \ . "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh" && \ hash -r curl -O https://download.swift.org/swiftly/linux/swiftly-(uname -m).tar.gz && \ tar zxf swiftly-(uname -m).tar.gz && \ ./swiftly init --quiet-shell-followup && \ set -q SWIFTLY_HOME_DIR && \ source "$SWIFTLY_HOME_DIR/env.fish" || source ~/.local/share/swiftly/env.fish License: Apache-2.0 PGP: Signature Instructions
Container
Official container images are available for compiling and running Swift on a variety of distributions.
Docker Hub
Instructions
- Select an Editor
Visual Studio Code
Visual Studio Code is a cross-platform and extensible editor that supports Swift through the Swift extension, which provides intelligent editor functionality as well as debugging and test support.
Install Swift extension
Documentation
Other editors
Any editor that supports the Language Server Protocol (LSP) can use SourceKit-LSP to provide intelligent editor functionality for Swift.
Learn more
- Build a Command-line Tool
Let’s write a small application with your new Swift development environment. Create a directory: mkdir MyCLI Change the directory: cd MyCLI Create a new project: swift package init --name MyCLI --type executable Run the program with swift run MyCLI You can continue to expand the program with additional features. Check out the getting started guide for command line tools. Build a Command-line Tool Guide
Swift SDK Bundles
Additional components for cross-compilation
Swift SDK for Static Linux
Copy install command
Download SDK | Signature (PGP)
Instructions
Swift SDK for WebAssembly
Copy install command
Download SDK | Signature (PGP)
Instructions
Swift SDK for Android
Copy install command
Download SDK | Signature (PGP)
Instructions
Development Snapshots
Swift snapshots are prebuilt binaries that are automatically created from the branch. These snapshots are not official releases. They have gone through automated unit testing, but they have not gone through the full testing that is performed for official releases.
Swiftly
Swiftly supports installing development snapshot toolchains. For example, you can install the latest available snapshot for the next major release using the “main-snapshot” selector and prepare your code for when it arrives.
swiftly install main-snapshot
swiftly install 6.3-snapshot
Instructions
Swift SDK Bundles
Additional components for cross-compilation
Static Linux SDK
Instructions
main
December 1, 2025
Copy install command
Download | Signature (PGP)
release/6.3
May 5, 2026
Copy install command
Download | Signature (PGP)
Swift SDK for WebAssembly
Instructions
main
May 4, 2026
Copy install command
Download | Signature (PGP)
release/6.3
May 5, 2026
Copy install command
Download | Signature (PGP)
Swift SDK for Android
Instructions
main
May 4, 2026
Copy install command
Download | Signature (PGP)
release/6.3
May 5, 2026
Copy install command
Download | Signature (PGP)
Alternate Install Options