Skip to content

Instantly share code, notes, and snippets.

@linuxfemale
Created November 18, 2019 14:28
Show Gist options
  • Save linuxfemale/af8aa29f5809b39795b9a553a67e32af to your computer and use it in GitHub Desktop.
Save linuxfemale/af8aa29f5809b39795b9a553a67e32af to your computer and use it in GitHub Desktop.
Swift and Vapor on Ubuntu 18.04
Install Swift and Vapor on Ubuntu 18.04
https://youtu.be/-El30oW3_Wg
##Step 1 — Installing Swift
sudo apt-get update
sudo apt-get install clang libicu-dev libpython2.7
wget https://swift.org/builds/swift-5.1.2-release/ubuntu1804/swift-5.1.2-RELEASE/swift-5.1.2-RELEASE-ubuntu18.04.tar.gz
gpg --keyserver hkp://pool.sks-keyservers.net \
--recv-keys \
'7463 A81A 4B2E EA1B 551F FBCF D441 C977 412B 37AD' \
'1BE1 E29A 084C B305 F397 D62A 9F59 7F4D 21A5 6D5F' \
'A3BA FD35 56A5 9079 C068 94BD 63BC 1CFE 91D3 06C6' \
'5E4D F843 FB06 5D7F 7E24 FBA2 EF54 30F0 71E1 B235' \
'8513 444E 2DA3 6B7C 1659 AF4D 7638 F1FB 2B2B 08C4' \
'A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561' \
'8A74 9566 2C3C D4AE 18D9 5637 FAF6 989E 1BC1 6FEA'
wget https://swift.org/builds/swift-5.1.2-release/ubuntu1804/swift-5.1.2-RELEASE/swift-5.1.2-RELEASE-ubuntu18.04.tar.gz.sig
gpg --verify swift-5.1.2-RELEASE-ubuntu18.04.tar.gz.sig
tar xzf swift-5.1.2-RELEASE-ubuntu18.04.tar.gz
sudo mv swift-5.1.2-RELEASE-ubuntu18.04 /usr/share/swift
echo "export PATH=/usr/share/swift/usr/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
swift --version
swift
:exit
#Step 2 — Installing Vapor
curl -sL apt.vapor.sh -o apt.vapor.sh
less apt.vapor.sh
bash ./apt.vapor.sh
sudo apt-get install vapor
#Step 3 — Create a Vapor app
vapor new demo --template=web
#Step 4 — Compile and Run the Vapor Application
cd demo
vapor build
vapor run serve
http://localhost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment