AWS now has arm servers available in their Elastic Compute Cloud (EC2).
For details on arm instance types available see -
For details on how to setup, deploy and connect to an AWS EC2 instance please refer to the official documentation.
In this example we are going to use a
Open a terminal and use
SSH to connect to your AWS instance.
ssh -i "********.pem" ******@ec2-*-**-***-**.us-east-2.compute.amazonaws.com # 1 - add the Swift-Arm repository ## you may need to install tools such as curl git etc. curl -s https://packagecloud.io/install/repositories/swift-arm/release/script.deb.sh | sudo bash # 2 - install Swift ## NOTE: The package name for Swift is swiftlang sudo apt install swiftlang
Create a quick project using the Swift Package Manager to test the Swift installation.
# 1 - create a project directory ~/$ mkdir hello ~/$ cd hello # 2 - use the swift package manager to initialize the project. ~/hello$ swift package init --type executable ## you should see the following Creating executable package: hello Creating Package.swift Creating README.md Creating .gitignore Creating Sources/ Creating Sources/hello/main.swift Creating Tests/ Creating Tests/LinuxMain.swift Creating Tests/helloTests/ Creating Tests/helloTests/helloTests.swift Creating Tests/helloTests/XCTestManifests.swift # 3 - build the project ~/hello$ swift build [4/4] Linking hello # 4 - run the project ~/hello$ swift run Hello, world!
Swift is now installed and ready to use on your AWS EC2.
Try some Server-Side Swift with Kitura