Getting Started on Akkeris with Go

Table of Contents


In this tutorial you will deploy a golang app in minutes.

Hang on after the tutorial for a few minutes to find out how Akkeris works and other information so you can make the most out of Akkeris and its dev tooling.

Before we proceed make sure you're comfortable with Terminal concepts and have access to a terminal on Windows, macOS, or Linux. If you need to brush up on your terminal skills read through this terminal guide first.

You'll also need to ensure you have (at a bare minimum) golang (1.11+) installed (for the CLI system). Be sure to check our prerequisites to ensure you can make the most out of Akkeris.

Set up

In this step you will install the Akkeris Command Line Interface (CLI), or AppKit as its sometimes referred to. You will use the CLI to manage and scale your applications, to provision add-ons, to install plugins from other engineers on your teams, to view the logs of your application as it runs on Akkeris, to pull logs from legacy apps, as well as to help run your application locally.

Install Akkeris:

npm -g install akkeris

Note, if you receive an error about insufficient permissions you may need to run sudo npm -g install akkeris instead.

Then type:


Hi! It looks like you might be new here. Lets take a second
to get started, you will need your akkeris auth and apps host
in addition to your login and password.

Akkeris Auth Host (
Akkeris Apps Host (
Profile updated!
Username: first.lastname
Password: ******
Logging you in ...  ✓

Note that after you login you may see a list of commands available.

Create the app

In this step, you will prepare a simple application that can be deployed.

aka apps:create -s voltron -o test
Creating app ⬢ smile195-voltron ...  ✓ 

This will create a new app with a randomly generated name smile195 in the spacevoltron, assigned to our testing organization. You can pass a parameter to specify your own app name.

Your application name may vary, keep a note of your randomly generated app name as you'll need it later, you can also create an app with a specific name by passing it in as an arguement to the command above.

Now deploy the image to the app:

aka releases:create -a smile195-voltron docker://
Deploying ⬢ docker:// to smile195-voltron  ...  ✓

You can watch the app logs (including its build and release) with the command below. Remember to press CTRL+C to stop watching the logs once the release is created:

aka logs -t -a smile195-voltron
2018-12-07T21:06:16Z smile195-voltron akkeris/build: 215d07f62914: Verifying Checksum
2018-12-07T21:06:16Z smile195-voltron akkeris/build: 215d07f62914: Download complete
2018-12-07T21:06:16Z smile195-voltron akkeris/build: fbaacfb7aeea: Verifying Checksum
2018-12-07T21:06:16Z smile195-voltron akkeris/build: fbaacfb7aeea: Download complete
2018-12-07T21:06:17Z smile195-voltron akkeris/build: 6a5a5368e0c2: Pull complete
2018-12-07T21:06:18Z smile195-voltron akkeris/build: 7b9457ec39de: Pull complete
2018-12-07T21:06:18Z smile195-voltron akkeris/build: 3f856402c0c1: Verifying Checksum
2018-12-07T21:06:18Z smile195-voltron akkeris/build: 3f856402c0c1: Download complete
2018-12-07T21:06:22Z smile195-voltron akkeris/build: ff18e19c2db4: Pull complete
2018-12-07T21:06:24Z smile195-voltron akkeris/build: 00075397a1ec: Pull complete
2018-12-07T21:06:32Z smile195-voltron akkeris/build: 3f856402c0c1: Pull complete
2018-12-07T21:06:32Z smile195-voltron akkeris/build: 499e61be84fe: Pull complete
2018-12-07T21:06:32Z smile195-voltron akkeris/build: a748c7fcbcd2: Pull complete
2018-12-07T21:06:32Z smile195-voltron akkeris/build: d1876e2a785b: Pull complete
2018-12-07T21:06:32Z smile195-voltron akkeris/build: 215d07f62914: Pull complete
2018-12-07T21:06:33Z smile195-voltron akkeris/build: fbaacfb7aeea: Pull complete
2018-12-07T21:06:33Z smile195-voltron akkeris/build: Digest: sha256:939a8d8cc87424c18d0a03ea587b7505929cf27b96ff55bb8b849fde0541f28d
2018-12-07T21:06:33Z smile195-voltron akkeris/build: Status: Downloaded newer image for ushios/go-example:latest
2018-12-07T21:06:33Z smile195-voltron akkeris/build: [smile195-4445a727-a73a-42e3-916d-75a4e947015c] Running shell script
2018-12-07T21:06:34Z smile195-voltron akkeris/build: + docker tag example/smile195-4445a727-a73a-42e3-916d-75a4e947015c:0.1
2018-12-07T21:06:34Z smile195-voltron akkeris/build: [smile195-4445a727-a73a-42e3-916d-75a4e947015c] Running shell script
2018-12-07T21:06:35Z smile195-voltron akkeris/build: + docker tag example/smile195-4445a727-a73a-42e3-916d-75a4e947015c:0.1
2018-12-07T21:06:35Z smile195-voltron akkeris/build: [smile195-4445a727-a73a-42e3-916d-75a4e947015c] Running shell script
2018-12-07T21:06:36Z smile195-voltron akkeris/build: + docker push
2018-12-07T21:06:36Z smile195-voltron akkeris/build: The push refers to a repository []
2018-12-07T21:06:36Z smile195-voltron akkeris/build: 3eb1da7692be: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: 2a2d1da36fac: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: f96e3740a202: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: c312ac6b8ebe: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: c9253187e251: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: b01c73507859: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: b16ea3826a8b: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: a5eb0fc1decb: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: b2ac5371e0f2: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: 142a601d9793: Preparing
2018-12-07T21:06:36Z smile195-voltron akkeris/build: b01c73507859: Waiting
2018-12-07T21:06:36Z smile195-voltron akkeris/build: a5eb0fc1decb: Waiting
2018-12-07T21:06:36Z smile195-voltron akkeris/build: b2ac5371e0f2: Waiting
2018-12-07T21:06:36Z smile195-voltron akkeris/build: b16ea3826a8b: Waiting
2018-12-07T21:06:37Z smile195-voltron akkeris/build: 2a2d1da36fac: Pushed
2018-12-07T21:06:37Z smile195-voltron akkeris/build: c9253187e251: Pushed
2018-12-07T21:06:37Z smile195-voltron akkeris/build: 3eb1da7692be: Pushed
2018-12-07T21:06:37Z smile195-voltron akkeris/build: f96e3740a202: Pushed
2018-12-07T21:06:37Z smile195-voltron akkeris/build: c312ac6b8ebe: Pushed
2018-12-07T21:06:42Z smile195-voltron akkeris/build: b2ac5371e0f2: Pushed
2018-12-07T21:06:48Z smile195-voltron akkeris/build: 142a601d9793: Pushed
2018-12-07T21:06:50Z smile195-voltron akkeris/build: a5eb0fc1decb: Pushed
2018-12-07T21:06:51Z smile195-voltron akkeris/build: b16ea3826a8b: Pushed
2018-12-07T21:06:59Z smile195-voltron akkeris/build: b01c73507859: Pushed
2018-12-07T21:07:01Z smile195-voltron akkeris/build: 0.1: digest: sha256:647defb68c94bafb51bd9a076a00f2f0e1654a1f3ead379722bdd7e83713bd1b size: 14212
2018-12-07T21:07:03Z smile195-voltron akkeris/build: [smile195-4445a727-a73a-42e3-916d-75a4e947015c] Running shell script
2018-12-07T21:07:03Z smile195-voltron akkeris/build: + docker rmi example/smile195-4445a727-a73a-42e3-916d-75a4e947015c:0.1
2018-12-07T21:07:03Z smile195-voltron akkeris/build: Untagged: example/smile195-4445a727-a73a-42e3-916d-75a4e947015c:0.1
2018-12-07T21:07:05Z smile195-voltron app[web.akkeris/event]: Slug compilation finished
2018-12-07T21:07:11Z smile195-voltron app[web.akkeris/event]: Release v1 created (Auto-Deploy c324c46d)

You've successfully deployed your new application! Open your deployed application in the browser by running:

aka apps:open -a smile195-voltron

If it does not appear give it a few seconds to start up.

Attaching your App to Github

Most applications are deployed via a source control repository such as GitHub. This is called an auto build. In this section we'll learn how we can automatically attach our app to Github and deploy code as commits are made.

Create a new github repo

In this example you'll need to create a new repo on GitHub, you can create it under your corporate account or under your personal account. You can do this at

Now open up a terminal and we'll clone out your repo:

git clone[org]/[repo]

Once its cloned, ensure you run cd [repo] as we'll write some files to your new repo. Lets first populate it with a default golang/martini app.

package main

import "os"
import ""

func main() {
    m := martini.Classic()
    m.Get("/", func() string {
        return "Hello world!"
    m.RunOnAddr("" + os.Getenv("PORT"))

To deploy to Akkeris a special file at the root of the repository called a Dockerfile (case sensitive) is needed. It is auto detected by Akkeris and tells it how to start your application, and how to build your application.

Create a a file called Dockerfile with the contents:

FROM golang:1.11
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN go get ""
RUN go build -o /usr/src/app/example .
CMD /usr/src/app/example

Attach Github to your app

Next, set your app to automatically deploy anytime there's a change on the repo:

aka repo:set[org]/[repo] -t [token] \
  -u [github username] -a smile195-voltron

Note, you can use the token you generated when you setup your Github CLI.

Trigger a new deploy

Now any change to your repo will create a new build. You can create a new commit by first adding your new files:

git add main.go Dockerfile

Then commiting them:

git commit -a -m 'Triggering deploy'
[master d3c552b] Trigger deploy

Now push your changes to trigger the deploy:

git push
Counting objects: 22, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (22/22), 3.10 KiB | 0 bytes/s, done.
Total 22 (delta 13), reused 0 (delta 0)
remote: Resolving deltas: 100% (13/13), completed with 12 local objects.

To watch your logs, run:

aka logs -t -a smile195-voltron

Note the -t in the command above means to tail the logs, it keeps showing new logs until you press CTRL+C to stop it. Once the logs show [martini] listening on 9000 (development) its up and running, remember to press CTRL+C to stop watching the logs.

You've successfully attached and deployed your code from Github! To see your application run:

aka apps:open -a smile195-voltron

If it does not appear give it a few seconds to start up.

Scale the app

Right now, your app is running on a single dyno. Think of a dyno as a lightweight container (in fact in the docker world is it a container) that runs the specified command in your Dockerfile.

You can now check how many dynos are running us thepscommand:

aka ps -a smile195-voltron
=== web (scout): (from docker) (1)
web.2885060676-76szt: up 10/27/2017, 2:36:42 PM

By default, your app is deployed on a small dyno (a scout size). And only one dyno type "web". Dyno types specify what special considerations your process may need when it starts, the dyno type "web" indicates it should be given a URL on the web, it also tells alamo to direct its web traffic to the port specified with the $PORT environment variable in your configuration. You should listen to the $PORT environment configuration variable to receive web traffic and respond to it.

You can also create new dyno types or scale existing dyno types using aka ps:update. For example, you can change the amount of servers your application is running on to zero by doing:

aka ps:update -q 0 -a smile195-voltron

If you then open up your app using aka apps:open -a smile195-voltron you will get an error message since the application is no longer running.

You can scale it back up again by running:

aka ps:update -q 1 -a smile195-voltron

If you need to run background processes you can create a new process type using aka ps:create worker -c [command] -a smile195-voltron. This will create a new background process called worker that can be scaled independently of your web dyno. It will receive the same code and deployments and configuration but does not need to listen to web traffic or respond on a port. It can independently run background processes as needed.

Define config vars

Akkeris allows you to store configuration information outside of your code. Storing data such as encryption keys or API URL's as config vars allows you to have one code base and branch run on multiple environments and gives you a space where confidential information can be stored and retrieved.

At runtime, config vars are exposed as environment variables to the application (e.g., os.Getenv("MY_VARIABLE")). For example, modify main.go so that it introduces a new route, /times, that repeats an action depending on the value of the TIMES environment variable:

package main

import "os"
import "strconv"
import ""

func main() {
    m := martini.Classic()
    m.Get("/", func() string {
        return "Hello world!"
    // new stuff
    m.Get("/times", func() string {
        var result string = ""
        var times string = os.Getenv("TIMES")
        if times == "" {
            times = "5"
        timesInt, _ := strconv.Atoi(times)
        for (i=0; i < timesInt; i++)
            result += i + ' ';
        return result
    // end new stuff.
    m.RunOnAddr("" + os.Getenv("PORT"))

Then you'll need to commit and push the changes to your github using git commit -a -m 'Testing config vars' and git push.

To set the config var on Akkeris, execute the following:

aka config:set TIMES=2 -a smile195-voltron

=== smile195-voltron Config Vars
 PORT                                 9000
 TIMES                                2

View the config vars that are set using aka config:

aka config -a smile195-voltron

=== smile195-voltron Config Vars
 PORT                                 9000
 TIMES                                2

Now that the config var is added open your app using aka open -a smile195-voltron and change the path to /times, you should see the value 0 1.

Provision add-ons

Add-ons are third-party services or shared credentials that provide out of the box additional functionality for your application, from databases, persistence, s3 buckets through logging to monitoring and more. You can view a list of all of the services you can attach to your application as an addon using:

aka services

You can then view plans for each service by running aka services:plan. For example, to view all of the plans for a postgresql database you can run:

aka services:plans akkeris-postgresql

You can then provision addons from a service plan by running aka addons:create [service]:[plan], you can provision a small database by running:

aka addons:create akkeris-postgresql:standard-0

Note that the connection information for the service provisioned are added as config vars. You can view the new config vars created by the provisioned database by running aka config -a smile195-voltron.

In this next example we'll show how to provision papertrail as a service. Note that all services for Akkeris are provisioned via addons.

Provisioning Papertrail Services

By default akkeris does not store any of your logs from your application or http requests. However, it makes the full log stream available as a service - this is called a log drain. A log drain is a syslog or http end point where your logs will be forwarded to by alamo.

In this step we'll provision an addon that will add a log drain to your app, Papertrail. Papertrail allows searching, storing and alerting based on logs online a

Provision the papertrail logging add-on:

aka addons:create papertrail:basic -a smile195-voltron

=== Addon papertrail-camera-5168 Provisioned
=== papertrail-camera-5168 (f5a86fae-b54f-481f-a8c8-006942541ee8)


The add-on is now deployed and configured for your application. You can list add-ons that are installed for your app using:

aka addons -a smile195-voltron

If you visit you can see the logs from your application, it may take a second or two for them to appear. The interface also allows you to setup searches and alerts.

Next Steps

You now know how to deploy an app, change its configuration, view logs, scale, and create add-ons from services.

Here’s some recommended reading. The first, an article, will give you a firmer understanding of the basics. The others may interest you in how you can best take advantage of Akkeris.

  • Read How Akkeris Works for more a technical overview you'll encounter while writing, deploying, running and managing applications on Akkeris.
  • Read Best Practices and Guidelines for more information on how you can take full advantage of Akkeris and other developer workflow tips and tricks.
  • Read Extending Akkeris to learn how you can use the Platform Apps API, shared credentials and create custom addons to extend its funtionality and introduce customized workflows or features.

Have Questions?

  • Join our slack channel at #akkeris (

results matching ""

    No results matching ""