Manual Quickstart

Learn how to create a Vapor project without the Toolbox using just Swift 3 and the Swift Package Manager.

This document assumes that you have Swift 3.1 installed.


If you'd prefer to use the Toolbox, follow the toolbox guide here.

Make new project using SwiftPM

Open your terminal


For our example, we'll be using the Desktop folder.

cd ~/Desktop
mkdir Hello
cd Hello
swift package init --type executable

Your folder should look like this:

├── Package.swift
├── Sources
│   └── main.swift
└── Tests

Edit Package.swift

Open your Package.swift file:

open Package.swift

And add Vapor as a dependency. Here's how your file will look.


import PackageDescription

let package = Package(
    name: "Hello",
    dependencies: [
        .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2)


We try to keep this document up to date, however, you can view latest releases here.

Edit main.swift

A simple hello world:

import Vapor

let drop = Droplet()

drop.get("hello") { req in
  return "Hello Vapor"


Compile & Run

The first build command can take a while to fetch dependencies.

swift build
.build/debug/Hello serve


If different, replace Hello above with the name of your executable (as defined in Package.swift).


Compiling in Swift's release mode and setting Vapor's environment to production will make your app more secure and performant.

swift build --configuraiton release
.build/release/Hello serve --env=production


Go to your favorite browser and visit http://localhost:8080/hello