Quickstart Guide

In this quickstart guide we'll install Garden and deploy an example application using the local-kubernetes plugin.

Garden is pluggable by design and most often used with the (remote) Kubernetes plugin and the Terraform and/or Pulumi plugins.

Getting started with those requires a bit more set up and the goal here is to get you quickly started and to demonstrate Garden's main capabilities.

In the guide we'll:

  • Install Garden

  • Install local Kubernetes

  • Deploy an example application

Step 1 β€” Install Garden

You need the following dependencies on your local machine to use Garden:

  • Git (v2.14 or newer)

  • rsync (v3.1.0 or newer)

Run git version and rsync --version to verify that a recent enough version of Git and rsync is installed.

Then install the Garden CLI for your platform:

brew tap garden-io/garden && brew install garden-cli

For a Mac computer with Apple silicon, Garden needs Rosetta.

For more detailed installation instructions, please see our Installation guide.

Step 2 β€” Install Kubernetes locally

If you already have a supported version of Kubernetes installed locally you can skip this section.

In this guide we're using local Kubernetes since that's usually the fastest way to get started.

For real world projects we recommend using a remote Kubernetes cluster since that comes with various benefits such as shared caches and, well, doesn't require you to run K8s on your laptop!.

Below are our recommended local K8s providers by platform. For alternatives, check out our local Kubernetes guide.

First, download and install Docker Desktop for Mac following the instructions on the official Docker site.

Then enable Kubernetes in Docker Desktop:

  1. From the Docker Dashboard, select the Preferences icon.

  2. Select Kubernetes from the left sidebar.

  3. Next to Enable Kubernetes, select the checkbox.

  4. Select Apply & Restart to save the settings and then click Install to confirm. This instantiates the images required to run the Kubernetes server as containers, and installs kubectl on your machine.

See the official Docker docs for more details.

Step 3 β€” Deploy the example application

Now that we have Garden installed and Kubernetes running locally, we can deploy our example application.

First, clone the Garden repo with:

git clone https://github.com/garden-io/quickstart-example.git

And then change into the directory of the quickstart example with:

cd quickstart-example

And finally deploy the project with Garden in dev mode:

garden deploy --dev

You should now be able to visit the example project at http://vote.local.demo.garden.

If the page doesn't load because the DNS address can't be found, you'll need to go to step 4 and update your hostfile. Otherwise, you're done!

The project itself doubles as an interactive guide that walks you through some common Garden commands and workflows. We encourage you to give it a spin!

Step 4 β€” Update hostfile (only if needed)

The *.local.demo.garden domain resolves to 127.0.0.1 via our DNS provider. This means that when you go to http://vote.local.demo.garden, you should be redirected to the app that you have running locally. However, some routers will prevent redirects to 127.0.0.1 and you'll need to update your hostfile instead.

If you get an error saying that DNS address can't be found when attempting to load the page, follow the instructions below to edit the hostfile for your platform.

In your terminal, open your hostfile as an administrator by running:

sudo vim /etc/hosts

We're using vim here but feel free to use your editor of choice.

Then add the following to file and save it:

127.0.0.1 vote.local.demo.garden

Now you should be able to load the quickstart example project in your browser at http://vote.local.demo.garden.

Next Steps

Now that you have Garden installed and seen its basic capabilities it's time to take the next steps.

If you'd like to better understand how a Garden project is configured when using one of the Kubernetes plugins, we recommend going through our first project tutorial which walks you through configuring a Garden project step-by-step.

If you like to dive right in and configure your own project for Garden, we recommend using our example projects on GitHub for reference and reading through the different pages of the Using Garden section of our docs.

And if you have any questions or feedbackβ€”or just want to say hi πŸ™‚β€”we encourage you to join our Discord community!

Last updated