Install Swift 3: Ubuntu
To install Vapor, you just need to have Swift 3 installed.
Download
Installing Swift on Linux only takes a few minutes and supports 14.04 and 15.10. Only the download section differs.
Swift Version Manager
If you work on multiple Swift 3 projects, you may want to follow "Install Swift 3 (Swiftenv)" instead.
Download (14.04 - Trusty Tahr)
# Download Swift
curl -O https://swift.org/builds/development/ubuntu1404/swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a/swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a-ubuntu14.04.tar.gz
# Untar
tar -zxf swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a-ubuntu14.04.tar.gz
# Rename
mv swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a-ubuntu14.04 swift
Download (15.10 - Wily Werewolf)
# Download
wget https://swift.org/builds/development/ubuntu1510/swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a/swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a-ubuntu15.10.tar.gz
# Untar
tar -zxf swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a-ubuntu15.10.tar.gz
# Rename
mv swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a-ubuntu15.10 swift
Install Dependencies
Depending on your flavor of Ubuntu, you may need to install some additional tools for the compiler. We'll err on the safe side and install everything you should need.
sudo apt-get update
sudo apt-get install clang libicu-dev binutils git
Install
There are two methods to installing Swift. Either add it to your PATH, or move it into your bin.
# Add to path
echo "export PATH=/path/to/swift/usr/bin:\"\${PATH}\"" >> ~/.bashrc
# Reload path
source ~/.bashrc
Absolute Path
Make sure to replace
/path/to/swift/with an absolute path to your Swift installation.
Verify
Check whether your installation worked.
swift --version
# Apple Swift version 3.0-dev (LLVM b010debd0e, Clang 3e4d01d89b, Swift 7182c58cb2)
Updated less than a minute ago
