Recommend Swiftly as install method on Linux (#925)

Any place we say to install Swift on Linux (deploy docs, getting started
etc) should use
[Swiftly](https://github.com/swift-server/swiftly/tree/main) instead of
directing people to download them from the install pages
This commit is contained in:
A 40 years old student 2023-11-01 19:56:31 +01:00 committed by GitHub
parent e40ba07ba7
commit 33812d6933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 53 deletions

View File

@ -71,52 +71,25 @@ ssh vapor@your_server_ip
Now that you've created a new Ubuntu server and logged in as a non-root user you can install Swift.
### Swift Dependencies
### Automated installation using Swiftly CLI tool (recommended)
Install Swift's required dependencies.
Visit the [Swiflty website](https://swift-server.github.io/swiftly/) for instructions on how to install Swiftly and Swift on Linux. After that, install Swift with the following command:
#### Basic usage
```sh
sudo apt-get update
sudo apt-get install binutils git gnupg2 libc6-dev libcurl4-openssl-dev
\ libedit2 libgcc-9-dev libpython3.8 libsqlite3-0 libstdc++-9-dev
\ libxml2-dev libz3-dev pkg-config tzdata unzip zlib1g-dev
```
$ swiftly install latest
### Download Swift Toolchain
Fetching the latest stable Swift release...
Installing Swift 5.9.1
Downloaded 488.5 MiB of 488.5 MiB
Extracting toolchain...
Swift 5.9.1 installed successfully!
This guide will install Swift 5.7.3. Visit the [Swift Releases](https://swift.org/download/#releases) page for a link to latest release. Copy the download link for Ubuntu 22.04.
$ swift --version
![Download Swift](../images/swift-download-ubuntu-copy-link.png)
Download and decompress the Swift toolchain.
```sh
wget https://download.swift.org/swift-5.7.3-release/ubuntu2204/swift-5.7.3-RELEASE/swift-5.7.3-RELEASE-ubuntu22.04.tar.gz
tar xzf swift-5.7.3-RELEASE-ubuntu22.04.tar.gz
```
!!! note
Swift's [Using Downloads](https://swift.org/download/#using-downloads) guide includes information on how to verify downloads using PGP signatures.
### Install Swift Toolchain
Move Swift somewhere easy to acess. This guide will use `/swift` with each compiler version in a subfolder.
```sh
sudo mkdir /swift
sudo mv swift-5.7.3-RELEASE-ubuntu22.04 /swift/5.7.3
```
Add Swift to `/usr/bin` so it can be executed by `vapor` and `root`.
```sh
sudo ln -s /swift/5.7.3/usr/bin/swift /usr/bin/swift
```
Verify that Swift was installed correctly.
```sh
swift --version
Swift version 5.9.1 (swift-5.9.1-RELEASE)
Target: x86_64-unknown-linux-gnu
```
## Install Vapor Using the Vapor Toolbox

View File

@ -1,25 +1,38 @@
# Install on Linux
To use Vapor, you will need Swift 5.6 or greater. This can be installed using the toolchains available on [Swift.org](https://swift.org/download/)
To use Vapor, you will need Swift 5.7 or greater. This can be installed using the CLI tool [Swiftly](https://swift-server.github.io/swiftly/) provided by the Swift Server Workgroup (recommended), or the toolchains available on [Swift.org](https://swift.org/download/).
## Supported Distributions and Versions
Vapor supports the same versions of Linux distributions that Swift 5.6 or newer versions supports.
!!! note
The supported versions listed below may be outdated at any time. You can check which operating systems are officially supported on the [Swift Releases](https://swift.org/download/#releases) page.
|Distribution|Version|Swift Version|
|-|-|-|
|Ubuntu|20.04|>= 5.6|
|Fedora|>= 30|>= 5.6|
|CentOS|8|>= 5.6|
|Amazon Linux|2|>= 5.6|
Vapor supports the same versions of Linux distributions that Swift 5.7 or newer versions supports. Please refer to the [official support page](https://www.swift.org/platform-support/) in order to find updated information about which operating systems are officially supported.
Linux distributions not officially supported may also run Swift by compiling the source code, but Vapor cannot prove stability. Learn more about compiling Swift from the [Swift repo](https://github.com/apple/swift#getting-started).
## Install Swift
### Automated installation using Swiftly CLI tool (recommended)
Visit the [Swiflty website](https://swift-server.github.io/swiftly/) for instructions on how to install Swiftly and Swift on Linux. After that, install Swift with the following command:
#### Basic usage
```sh
$ swiftly install latest
Fetching the latest stable Swift release...
Installing Swift 5.9.1
Downloaded 488.5 MiB of 488.5 MiB
Extracting toolchain...
Swift 5.9.1 installed successfully!
$ swift --version
Swift version 5.9.1 (swift-5.9.1-RELEASE)
Target: x86_64-unknown-linux-gnu
```
### Manual installation with the toolchain
Visit Swift.org's [Using Downloads](https://swift.org/download/#using-downloads) guide for instructions on how to install Swift on Linux.
### Fedora
@ -30,7 +43,7 @@ Fedora users can simply use the following command to install Swift:
sudo dnf install swift-lang
```
If you're using Fedora 30, you'll need to add EPEL 8 to get Swift 5.6 or newer versions.
If you're using Fedora 35, you'll need to add EPEL 8 to get Swift 5.7 or newer versions.
## Docker