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

Container

Official container images are available for compiling and running Swift on a variety of distributions.

2. 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.

Other editors

Any editor that supports the Language Server Protocol (LSP) can use SourceKit-LSP to provide intelligent editor functionality for Swift.

3. 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.

Swift SDK Bundles

Additional components for cross-compilation

Static Linux

WebAssembly




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.2-snapshot

Static Linux SDK

Instructions

main

September 7, 2025
Static Linux SDK - Cross compile to Linux.

release/6.2

September 10, 2025
Static Linux SDK - Cross compile to Linux.

Swift SDK for WebAssembly

Instructions

main

September 14, 2025
Swift SDKs for WebAssembly

release/6.2

September 10, 2025
Swift SDKs for WebAssembly