Skip to content

Commit eb04a7e

Browse files
endingwithaliAli Diamondghuntley
authored
feat: adding gcp quickstart (#4348)
* adding gcp tutorial * refactor(seo): gcp to google cloud platform * docs(quickstart): add next steps and title * adding changes and gcp image * adding ammar changes Co-authored-by: Ali Diamond <user@ali.dev> Co-authored-by: Geoffrey Huntley <ghuntley@ghuntley.com>
1 parent 75b058a commit eb04a7e

File tree

12 files changed

+121
-0
lines changed

12 files changed

+121
-0
lines changed

docs/images/google-cloud.svg

+1
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

docs/manifest.json

+6
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@
7474
"icon_path": "./images/icons/docker.svg",
7575
"path": "./quickstart/docker.md"
7676
},
77+
{
78+
"title": "Google Cloud Platform",
79+
"description": "Setup Coder with Google Cloud Platform",
80+
"icon_path": "./images/google-cloud.svg",
81+
"path": "./quickstart/google-cloud-platform.md"
82+
},
7783
{
7884
"title": "AWS",
7985
"description": "Setup Coder with AWS",
+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Google Cloud Platform
2+
3+
In this quickstart, you will learn how to deploy the Coder control plane instance and your first template.
4+
5+
## Requirements
6+
7+
This quickstart assumes you have `roles/compute.instanceAdmin.v1` access to your Google Cloud Platform project.
8+
9+
## Setting Up your VM
10+
11+
If this is the first time you’re creating a VM on this project, you will need to enable the `Compute Engine API`. On the Compute Engine API page, click `enable` and wait for the service to finish connecting.
12+
13+
<img src="../images/quickstart/google-cloud-platform/gcp0.png">
14+
15+
This will pull up the `Create an Instance` page - name the instance something relevant to this project, following your naming convention of choice. In addition, select a region and zone that is close to your physical location. For this instance, we will use the base suggested image.
16+
17+
<img src="../images/quickstart/google-cloud-platform/gcp1.png">
18+
19+
Under `Identity and API Access`, click `Allow full access to all Cloud APIs`. Scroll down to `Firewall` and click `Allow HTTPS traffic` and `Allow HTTP traffic`.
20+
21+
<img src="../images/quickstart/google-cloud-platform/gcp2.png">
22+
23+
Scroll down to the bottom and click `Create` to create and deploy the VM.
24+
25+
Congrats you’ve created your VM instance!
26+
27+
## SSH-ing into the VM
28+
29+
On the Compute Engine Dashboard, click on the VM for this project. Under `Details`, click `SSH` and select `Open in browser window`.
30+
31+
<img src="../images/quickstart/google-cloud-platform/gcp3.png">
32+
33+
This will give you a terminal into the VM that we will use to install Coder.
34+
35+
## Install Coder
36+
37+
In the terminal, run the following command
38+
39+
```sh
40+
curl -fsSL https://coder.com/install.sh | sh
41+
```
42+
43+
## Run Coder
44+
45+
For this tutorial, we will run Coder as a `systemd` service. You can run Coder in [a multitude of different ways](https://coder.com/docs/coder-oss/latest/install).
46+
47+
First, edit the `coder.env` file to enable `CODER_TUNNEL` by setting the value to true with the following command:
48+
49+
``` sh
50+
sudo vim /etc/coder.d/coder.env
51+
```
52+
53+
<img src="../images/quickstart/google-cloud-platform/gcp4.png">
54+
55+
Exit vim and run the following command to start Coder as a system service:
56+
57+
```sh
58+
sudo systemctl enable --now coder
59+
```
60+
61+
The following command shows the Coder service's logs, including the Access URL. The Access URL will be used to access the Coder control plane.
62+
63+
```sh
64+
journalctl -u coder.service -b
65+
```
66+
67+
<img src="../images/quickstart/google-cloud-platform/gcp5.png">
68+
69+
In this instance, Coder can be accessed at the URL `https://fcca2f3bfc9d2e3bf1b9feb50e723448.pit-1.try.coder.app`.
70+
71+
Copy the URL and run the following command to create the workspace admin:
72+
73+
```sh
74+
coder login <url***.try.coder.app>
75+
```
76+
77+
Fill out the prompts and be sure to save use email and password. This is your admin login. Now, you can now access Coder from your local machine by navigating to the `***.try.coder.app` URL and logging in with that same username and password.
78+
79+
## Creating and Uploading your First Template
80+
81+
First, run `coder template init` to create your first template. You’ll be given a list of prefabricated templates. This tutorial shows you how to create a Linux based template on GCP.
82+
83+
<img src="../images/quickstart/google-cloud-platform/gcp6.png">
84+
85+
Select the `Develop in Linux on Google Cloud`, then `cd ./gcp-linux`.
86+
87+
Run the following command:
88+
89+
```sh
90+
coder templates create
91+
```
92+
93+
It will ask for your `project-id`, which you can find on the home page of your GCP Dashboard.
94+
95+
Given it’s your first time setting up Coder, it may give an error that will look like the following:
96+
97+
<img src="../images/quickstart/google-cloud-platform/gcp7.png">
98+
99+
In the error message will be a link. In this case, the URL is `https://console.developes.google.com/apis/api/iam.googles.com/overview:?project=1073148106645`. Copy the respective URL from your error message, and visit it via your browser. It may ask you to enable `Identity and Access Management (IAM) API`.
100+
101+
Click `enable` and wait as the API initializes for your account.
102+
103+
Once initialized, click create credentials in the upper right-hand corner. Select the `Compute Engine API` from the dropdown, and select `Application Data` under `What data will you be accessing?`. In addition, select `Yes, I’m using one or more` under `Are you planning on using this API with Compute Engine, Kubernetes Engine, App Engine, or Cloud Functions?`.
104+
105+
<img src="../images/quickstart/google-cloud-platform/gcp8.png">
106+
107+
Back in your GCP terminal, run the `coder templates create` one more time.
108+
109+
Congrats! You can now create new Linux-based workspaces that use Google Cloud Platform. Go onto your Coder dashboard, build your workspace, and get started coding!
110+
111+
## Next Steps
112+
113+
- [Learn more about template configuration](../templates.md)
114+
- [Configure more IDEs](../ides/web-ides.md)

0 commit comments

Comments
 (0)