Deploy your first Stack from scratch

Last updated 6 months ago

Let's start by creating a simple Stack with a function called hello-koyeb running the koyeb/cowsay docker image. This docker image simply prints the Koyeb logo on the standard output.

We will create our first Stack in Simple Koyeb Versioning mode, without git for now.

From the web interface

Create the Stack

Creating a Stack takes three clicks:

  1. Just click the Create button at the top right of the control panel and select Stack.
  2. On the "Choose how to manage your Stack", select Simple Koyeb Versioning.
  3. In the "Choose a name for your Stack", enter hello-koyeb. Then click the Create Stack button.

Deploy your first Stack revision

  1. From your hello-koyeb Stack view, click New revision.
  2. The Compose your Stack section is a complete code editor designed to let you write your Stack configuration in YAML, a minimal human-readable format. Just copy-paste the below YAML configuration:
2  - name: hello-koyeb # The function name
3    image: koyeb/cowsay # The Docker image to use
  1. The message is purely informative to let you easily browse your revisions.
  2. Click on Deploy Revision

The Koyeb platform will now automatically build and deploy your Stack. After a few seconds, your new Stack revision will be deployed and appear Active in your Stack summary view.

Voilà! You have now deployed your first minimalist Stack.

Invoke your function and check logs

Now that you have deployed your Stack, the hello-koyeb function will appear in a table in the Functions section of your Stack view.

To test that your function is working properly:

  1. Click Invoke, which is found on the right end of the row. In the pop-over modal, just press Submit as our function does not handle any data.
  2. Click Show Logs. In a few seconds, your function execution will appear in the Functions execution history section and the Koyeb logo should appear in the logs.

Congratulations, you now know how to deploy and test functions! 🎉

Local testing

If you want to reproduce the Stack we just deployed locally, simply run:

1docker run --rm koyeb/cowsay

Next Steps

Now that you know the basics, you can head to the Stack Quickstart summary to learn more about functions, Git binding, Secrets, events, and more!

Ready to get started?

Get in touch or create an account and deploy your serverless stack in minutes.