# Introducing swiftly, a new Swift toolchain installer and manager

**URL:** <https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254>\
**Category:** Community Showcase\
**Tags:** linux, tools, command-line-tool\
**Created:** [September 13, 2023, 4:05am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254 "2023-09-13T04:05:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/patrick/32/10881_2.png) [@patrick](https://forums.swift.org/u/patrick)\
**Post date:** [September 13, 2023, 4:05am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/1 "2023-09-13T04:05:47Z")

</div>

# swiftly 0.1.0

We are excited to announce the 0.1.0 release of [swiftly](https://github.com/swift-server/swiftly), a new Swift toolchain manager developed by the SSWG!

## What is swiftly?

swiftly is a CLI tool for installing, managing, and switching between Swift toolchains, written in Swift. swiftly is designed to be extremely easy to install and get running (installation is usually just a bash one-liner), and its command interface is intended to be flexible while also being simple to use.

swiftly currently supports the following features:

- Installing Swift toolchains, either releases or snapshots
  - toolchains can be installed by name, or portions of the name can be left out and swiftly will fetch the most recently produced matching toolchain

- Switching which installed toolchain is active (i.e. which one is discovered via `$PATH`)
- Uninstalling toolchain(s)
- Listing installed toolchains

In the future, swiftly will supporting updating installed toolchains and listing toolchains that are available for install.

Right now, swiftly only supports Linux, but the medium term plan is to also support macOS and in long term to support all platforms that Swift runs on.

For more information about swiftly, check out the [README](https://github.com/swift-server/swiftly/blob/main/README.md).

## Installation

As mentioned before, swiftly's installation is designed to be extremely fast and easy. In fact, pasting the following one-liner into your shell is all you need to get started:

```shell
curl -L https://swift-server.github.io/swiftly/swiftly-install.sh | bash

```

The installation script will first display a prompt allowing you to customize the installation (the defaults should be fine for most users), and then it will proceed with downloading the swiftly binary and installing it. As part of this, any system dependencies required by Swift itself will also be installed via the system's package manager (this is enabled by default but can optionally be disabled).

The landing page at [https://swift-server.github.io/swiftly](https://swift-server.github.io/swiftly) also contains these instructions in case you need them in the future or want to share them with a friend.

## Example usage

```swift
$ swiftly install latest

Fetching the latest stable Swift release...
Installing Swift 5.8.1
Downloaded 488.5 MiB of 488.5 MiB
Extracting toolchain...
Swift 5.8.1 installed successfully!

$ swift --version

Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: x86_64-unknown-linux-gnu

```

## Feedback/suggestions/bug reports

While this does mark the first public release of swiftly, it is still in early development, so any feedback, feature requests, and bug reports would be greatly appreciated! To do so, please file an issue on [swiftly's GitHub repository](https://github.com/swift-server/swiftly), or just respond with your initial thoughts in this thread. Thanks in advance!

## FAQ

#### Why not install Swift through the package manager (e.g. `apt` or `yum`)?

[Swift.org](http://Swift.org) currently provides experimental [`.rpm` and `.deb`](https://forums.swift.org/t/rpm-and-debs-for-swift-call-for-the-community/49117) packages that allow you to install Swift via your package manager. While these are an effective way to install and update a single version of Swift, they aren't well suited to the task of installing multiple Swift toolchains that you can easily switch between. swiftly's target audience are Swift developers that switch between versions for the purposes of testing their libraries and applications. The `.deb` and `.rpm` also currently don't provide support for snapshot toolchains.

#### How is this different from [swiftenv](https://github.com/kylef/swiftenv)?

swiftenv is an existing Swift version manager which already has much of the functionality that swiftly will eventually have. It's an awesome tool, and if it's part of your workflow then we encourage you to keep using it! That said, swiftly is/will be different a few ways:

- swiftly is being built as a community driven effort led by the Swift Server Workgroup, and through this collaboration, swiftly may eventually become an official installation tool for Swift toolchains and use new [swift.org](http://swift.org) APIs for fetching releases and snapshots (note: this is planned for the future, swiftly currently uses GitHub APIs for this).

- swiftly will be written in Swift, which we think is important for maintainability and encouraging community contributions.

- swiftly is optimized for ease of installation--it can be done with a bash one-liner similar to Homebrew and rustup.

- swiftly has first-class support for installing and managing snapshot toolchains.

---

<div class="post-metadata">

**Author:** ![svanimpe](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/svanimpe/32/38963_2.png) [@svanimpe](https://forums.swift.org/u/svanimpe)\
**Post date:** [September 13, 2023, 11:08am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/2 "2023-09-13T11:08:06Z")

</div>

Can Swiftly be added to the [Swift.org](http://Swift.org) installation instructions?

Currently, Docker is front and center there for Linux. If I'm a beginner wishing to learn Swift, I would be under the impressions that whatever this Docker thing is, it's the official way to install Swift, and I'd be lost forever, as those instructions just assume the reader already has Docker installed, and knows how to use it.

---

<div class="post-metadata">

**Author:** ![0xTim](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/0xtim/32/27968_2.png) [@0xTim](https://forums.swift.org/u/0xTim)\
**Post date:** [September 13, 2023, 11:42am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/3 "2023-09-13T11:42:05Z")

</div>

Yes it should definitely be added to the list of options - as for whether it's the default option is something the language team and/or the SWWG need to discuss.

There are also security implications for linking to stuff outside of [Swift.org](http://Swift.org) that need to be discussed

---

<div class="post-metadata">

**Author:** ![ktoso](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ktoso/32/44526_2.png) [@ktoso](https://forums.swift.org/u/ktoso)\
**Post date:** [September 13, 2023, 12:04pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/4 "2023-09-13T12:04:50Z")

</div>

This is super awesome and I've been using it for a while already! I love plopping onto a random VM and just hitting a macro key on keyboard to type out the `curl -L https://swift-server.github.io/swiftly...` and here I go -- ready to reproduce specific swift version bug reports etc 🥳

Probably good to give it a little bit of time so people can try it on various platforms and then promote to recommended main method? Though @patrick can speak to level of confidence we have right now more than myself I think.. 🙂

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/patrick/32/10881_2.png) [@patrick](https://forums.swift.org/u/patrick)\
**Post date:** [September 13, 2023, 2:08pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/5 "2023-09-13T14:08:08Z")

</div>

@ktoso put it pretty well--it's still early days for swiftly, so I think we want to let users try it out for a bit and let it mature some before we explore including it as an official installation path. That said, the hope is definitely for it to get there!

---

<div class="post-metadata">

**Author:** ![jhoughjr](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jhoughjr/32/27949_2.png) [@jhoughjr](https://forums.swift.org/u/jhoughjr)\
**Post date:** [September 15, 2023, 12:43pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/6 "2023-09-15T12:43:51Z")

</div>

On that note, I was working on an orange pi 5 plus running Armbian 12 and it appears the install script just bails with unsupported platform. I think maybe that check could be disabled so people could experiment with getting it running with more distros perhaps since swift works on Debian and Ubuntu on arm or has in the past for me.

---

<div class="post-metadata">

**Author:** ![hassila](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/hassila/32/22647_2.png) [@hassila](https://forums.swift.org/u/hassila)\
**Post date:** [September 15, 2023, 12:47pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/7 "2023-09-15T12:47:56Z")

</div>

So what are the thoughts on "shared computer" installs, currently it seems to be per-user ?

---

<div class="post-metadata">

**Author:** ![Geordie\_J](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/geordie_j/32/839_2.png) [@Geordie\_J](https://forums.swift.org/u/Geordie_J)\
**Post date:** [September 17, 2023, 9:01pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/8 "2023-09-17T21:01:27Z")

</div>

This looks interesting, thanks for your work on this! Is there any scope to use this to install custom toolchains? For our workflow it'd be valuable to be able to install different SwiftWasm toolchains for example. If not, would you be open to contributions with that goal in mind?

---

<div class="post-metadata">

**Author:** ![Max\_Desiatov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/max_desiatov/32/20654_2.png) [@Max\_Desiatov](https://forums.swift.org/u/Max_Desiatov)\
**Post date:** [September 17, 2023, 9:15pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/9 "2023-09-17T21:15:40Z")

</div>

I don't think that swiftly is something that would be suitable for installing cross-compilation toolchains. For those you should use the new `swift experimental-sdk install` command introduced in Swift 5.9. With swiftly you'd install the top-level toolchain though, one that provides the `swift` command itself with the `experimental-sdk` subcommand.

---

<div class="post-metadata">

**Author:** ![Geordie\_J](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/geordie_j/32/839_2.png) [@Geordie\_J](https://forums.swift.org/u/Geordie_J)\
**Post date:** [September 18, 2023, 2:10pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/10 "2023-09-18T14:10:40Z")

</div>

Thanks, `experimental-sdk install` sounds interesting. Could you point me to more info about it? This is the first I've heard of it

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/patrick/32/10881_2.png) [@patrick](https://forums.swift.org/u/patrick)\
**Post date:** [September 18, 2023, 2:12pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/11 "2023-09-18T14:12:08Z")

</div>

I think it's probably best if we don't disable the platform detection, but what we can do is provide users with the option of selecting a supported platform to use for downloads if the detected one isn't supported. For exampe, I imagine when installing on debian, a user could just choose the latest Ubuntu and be fine. I filed [Allow installation on unsupported platforms · Issue #60 · swift-server/swiftly · GitHub](https://github.com/swift-server/swiftly/issues/60) for this, thanks for the feedback!

---

<div class="post-metadata">

**Author:** ![Max\_Desiatov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/max_desiatov/32/20654_2.png) [@Max\_Desiatov](https://forums.swift.org/u/Max_Desiatov)\
**Post date:** [September 18, 2023, 2:14pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/12 "2023-09-18T14:14:28Z")

</div>

> [@Geordie\_J](#):
>
> Thanks, `experimental-sdk install` sounds interesting. Could you point me to more info about it? This is the first I've heard of it

This is the same `swift sdk` command as specified in [SE-0387](https://github.com/apple/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md#swift-sdk-installation-and-configuration), albeit with `experimental-` prefix until we can declare it fully ready for general use.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/patrick/32/10881_2.png) [@patrick](https://forums.swift.org/u/patrick)\
**Post date:** [September 18, 2023, 2:17pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/13 "2023-09-18T14:17:03Z")

</div>

The default values for SWIFTLY\_HOME\_DIR and SWIFTLY\_BIN\_DIR are user-specific, but during installation you can configure them to be system-wide.

e.g. the following should do a system-level install of swiftly and its managed toolchains.

```swift
Select one of the following:
1) Proceed with the installation (default)
2) Customize the installation
3) Cancel
> 2
Enter the swiftly data and configuration files directory (default $HOME/.local/share/swiftly): 
> /usr/local/share
Enter the swiftly executables installation directory (default $HOME/.local/bin): 
> /usr/local/bin
Modify login config ($HOME/.profile)? (Y/n)
> y
Install system dependencies? (Y/n)
> n
Current installation options:

    Data and configuration files directory: /usr/local/share
        Executables installation directory: /usr/local/bin
      Modify login config ($HOME/.profile): true
               Install system dependencies: false

```

Note that you may want to use a bin directory other than `/usr/local/bin`, since Swift toolchains include a lot of other binaries in them that might clash with existing installations that your system is relying on (e.g. `clang`).

---

<div class="post-metadata">

**Author:** ![mackoj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mackoj/32/42395_2.png) [@mackoj](https://forums.swift.org/u/mackoj)\
**Post date:** [September 19, 2023, 7:39am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/16 "2023-09-19T07:39:34Z")

</div>

Hi,

I'm trying to run it in a Github Actions is there a way to go around this configuration phase ?

Thanks,

---

<div class="post-metadata">

**Author:** ![futurejones](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/futurejones/32/13428_2.png) [@futurejones](https://forums.swift.org/u/futurejones)\
**Post date:** [September 19, 2023, 8:55am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/17 "2023-09-19T08:55:33Z")

</div>

Hi,  
I am trying install swift on Linux Mint but the installer is failing saying it is an unsupported OS.  
Linux Mint is basically Ubuntu 22.04 and uses the the standard Ubuntu apt repositories, so there is no reason why it shouldn't work.  
I have tried several other desktop Linux distro's and they all fail as unsupported OS's.

Are you planning on supporting any of the popular Linux Ubuntu based distributions?

---

<div class="post-metadata">

**Author:** ![Nobody1707](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nobody1707/32/2169_2.png) [@Nobody1707](https://forums.swift.org/u/Nobody1707)\
**Post date:** [September 19, 2023, 8:33pm UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/18 "2023-09-19T20:33:06Z")

</div>

Sweet, I can't wait till I can just `zypper in swiftly`, then `swiftly update` just like with `rustup`.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/patrick/32/10881_2.png) [@patrick](https://forums.swift.org/u/patrick)\
**Post date:** [September 20, 2023, 3:13am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/19 "2023-09-20T03:13:28Z")

</div>

You can pass the `-y` (or `--disable-confirmation`) flag to `swiftly-install.sh`, and it'll skip through all the prompts and just use the defaults, if that's the issue you're running into.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/patrick/32/10881_2.png) [@patrick](https://forums.swift.org/u/patrick)\
**Post date:** [September 20, 2023, 3:22am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/20 "2023-09-20T03:22:38Z")

</div>

The toolchains are all downloaded directly from [swift.org](http://swift.org), so we can only "officially" support the platforms listed there. That said, swiftly (and those toolchains) will likely happily run on a bunch of other platforms. The plan is to allow users to select a platform from the supported ones to use in the event that theirs isn't one of them, which should help with this (see [Allow installation on unsupported platforms · Issue #60 · swift-server/swiftly · GitHub](https://github.com/swift-server/swiftly/issues/60)).

In the meantime, you can just download the `swiftly-install.sh` script and modify it to use Ubuntu 22.04, and swiftly should install just fine.

If you apply the following patch, it should do the trick:

```diff
diff --git a/install/swiftly-install.sh b/install/swiftly-install.sh
index d2eb3a3..20c11bd 100755
--- a/install/swiftly-install.sh
+++ b/install/swiftly-install.sh
@@ -287,8 +287,12 @@ case "$ID" in
         ;;
 
     *)
- echo "Error: Unsupported platform: $PRETTY_NAME"
- exit 1
+ docker_platform_name="ubuntu"
+ package_manager="apt-get"
+ export DEBIAN_FRONTEND=noninteractive
+ PLATFORM_NAME="ubuntu2204"
+ PLATFORM_NAME_FULL="ubuntu22.04"
+ docker_platform_version="22.04"
         ;;
 esac
 

```

This will probably work for other debian-based distributions too (you may need to switch which Ubuntu version though).

---

<div class="post-metadata">

**Author:** ![harlanhaskins](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/harlanhaskins/32/333_2.png) [@harlanhaskins](https://forums.swift.org/u/harlanhaskins)\
**Post date:** [September 20, 2023, 3:26am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/21 "2023-09-20T03:26:02Z")

</div>

This won't cover Debian, but you should be able to read `ID_LIKE` out of the `os-release` file, many distributions that are derived from e.g. Ubuntu (like Pop!\_OS or Linux Mint) report Ubuntu and Debian in the `ID_LIKE` field.

---

<div class="post-metadata">

**Author:** ![futurejones](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/futurejones/32/13428_2.png) [@futurejones](https://forums.swift.org/u/futurejones)\
**Post date:** [September 20, 2023, 4:00am UTC](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254/22 "2023-09-20T04:00:14Z")

</div>

@patrick I think you are missing the point.  
Any distribution that uses the official Ubuntu repositories is already "officially" supported by [swift.org](http://swift.org). e.g Linux Mint == Ubuntu 22.04.  
So "swiftly" should "officially" support these distributions out of the box.  
We are not talking about "unsupported platforms" here.  
You are already reading the os-release file in the install script so it should be a quick an easy fix to recognize these distributions.

[Next page](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254.md?page=2)
