Check out Coder’s new OSS version
back to the resources
videos
27 Aug 2021

Installing Coder

Overview

This video provides step-by-step instructions for installing Coder.

Docs & links mentioned in the video:

Coder Setup Guides: https://cdr.co/2MjQyMQ GKE and Coder: https://cdr.co/37hJbd9 Google Cloud Console: https://cloud.google.com/ Installing Coder with Helm: https://cdr.co/4MjM5NA TLS Certificates with Coder: https://cdr.co/4HnnU3 Google Cloud DNS with Coder: https://cdr.co/3NjY2MQ

Requirements (if you don't use Google Cloud Shell):

gcloud (if you are using GCP): https://cloud.google.com/sdk/docs/install kubectl: https://kubernetes.io/docs/tasks/tools/#kubectl helm: https://helm.sh/docs/intro/install/

Note: The "watch" command does not work on Windows, but you can still periodically run the kubectl command without "watch" to monitor the status of resources.

Transcript Highlights

In this video we're going to install Coder, setup tls, and attach a domain. If you don't have a Coder license already you can grab one at Coder.com/trial.

Throughout the install I'll be referencing pages from the Coder docs I'd encourage you to open them up and follow along as I'll be copying commands. The docs will also include more detail.

First let's create the Kubernetes cluster. This will host Coder's control plane and workspaces. The Coder docs include examples for different platforms, but you can also visit the requirements page to see if an existing cluster is compatible. In this example, we'll use Google's managed Kubernetes service GKE. Google Cloud also includes a built-in shell with all the tools we need to install. If you'd like to use your own terminal i've included links to install these tools in the description. After enabling the Kubernetes engine API in the Google Cloud console let's open up a shell and create a cluster

This command was referenced from the Coder docs but we made a few changes to include the project's name, cluster name, zone, and auto-scaling settings. You can also change the machine type based on your team's resource usage. With GKE you can always use a different node pool later so we'll go with this.

After the cluster has been created and added to your context it's time to install Coder with Helm.

We'll start by using the default Helm values, which includes the Coder control plane, a workspace provider, and a built-in PostgreSQLs database. We're also not specifying a version here. At the time of recording the latest version is 1.21.0.

We can follow along with the deployment using the watch command. Use Control-C to exit once the pods are ready.

Next we'll use the following two commands from the docs to get the deployment's IP and the default password.

Let's login.

Here we'll upload the license we got from Coder.com/trial.

And we're in. Next we'll add a domain and TLS to Coder.

Let's set up DNS in order to point our domain to Coder. If you would like to use Let's Encrypt certificates with Coder we recommend that you use one of the DNS providers listed in our docs or from cert-manager's docs, which are linked below. If you want to keep your primary DNS provider, many services including Google's Cloud DNS allows you to create a sub zone, in our case just for the Coder subdomain.

In this example I'm using another primary DNS provider and created NS records for cloud DNS on the Coder subdomain. Now we'll follow the docs to deploy a cert-manager on our cluster to issue Let's Encrypt certificates.

We need to create a service account for the DNS zone we created.

Now let's generate the key with this command from the Coder docs.

We're going to use the cloud shell editor to quickly create and edit some files. but any text editor such as vim will do.

First we'll deploy a cluster issuer.

Here we don't need to change much from the docs example, but make sure the key.json is in the same directory as the YAML file when you deploy.

Next we'll deploy a certificate object that references the issuer. Make sure that you replace the example domain with your domain.

The wildcard DNS entry on line 10 is for dev URLs.

We can use a watch command to see the status of these certificates. It can take a while to generate the certificates, but if you run into an issue a troubleshooting guide is linked in the docs.

It looks like the certificates have been created. Exit with Control-C. Let's create DNS records to point to the Coder deployment.

The wildcard DNS entry is for dev URLs in Coder.

Finally we can upgrade our Coder deployment to use these certificates. A values.yaml file will hold our custom Helm values.

And these additional two values can be added to enable dev URLs

Let's Helm upgrade Coder and visit our deployment from the secure URL.

One final step is to update the access URL in the admin panel and then you're good to go.

Thanks for trying Coder, and we're excited to hear what you think.