|
| 1 | +## Tour Coder and Set up your first deployment. |
| 2 | + |
| 3 | +For day-zero Coder users, we recommend following this guide to set up a local |
| 4 | +Coder deployment, create your first template, and connect to a workspace. This |
| 5 | +is completely free and leverages our |
| 6 | +[open source repository](https://github.com/coder/coder). |
| 7 | + |
| 8 | +We'll use [Docker](https://docs.docker.com/engine) to manage the compute for a |
| 9 | +slim deployment to experiment with [workspaces](../user-guides/index.md) and |
| 10 | +[templates](../admin/templates/index.md). |
| 11 | + |
| 12 | +Docker is not necessary for every Coder deployment and is only used here for |
| 13 | +simplicity. |
| 14 | + |
| 15 | +# Set up your Coder Deployment |
| 16 | + |
| 17 | +## 1. Install Docker |
| 18 | + |
| 19 | +First, install [Docker](https://docs.docker.com/engine/install/) locally. |
| 20 | + |
| 21 | +> If you already have the Coder binary installed, restart it after installing |
| 22 | +> Docker. |
| 23 | +
|
| 24 | +## 2. Install Coder daemon |
| 25 | + |
| 26 | +<div class="tabs"> |
| 27 | + |
| 28 | +## Linux/macOS |
| 29 | + |
| 30 | +Our install script is the fastest way to install Coder on Linux/macOS: |
| 31 | + |
| 32 | +```sh |
| 33 | +curl -L https://coder.com/install.sh | sh |
| 34 | +``` |
| 35 | + |
| 36 | +## Windows |
| 37 | + |
| 38 | +> **Important:** If you plan to use the built-in PostgreSQL database, you will |
| 39 | +> need to ensure that the |
| 40 | +> [Visual C++ Runtime](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist#latest-microsoft-visual-c-redistributable-version) |
| 41 | +> is installed. |
| 42 | +
|
| 43 | +You can use the |
| 44 | +[`winget`](https://learn.microsoft.com/en-us/windows/package-manager/winget/#use-winget) |
| 45 | +package manager to install Coder: |
| 46 | + |
| 47 | +```powershell |
| 48 | +winget install Coder.Coder |
| 49 | +``` |
| 50 | + |
| 51 | +</div> |
| 52 | + |
| 53 | +## 3. Start the server |
| 54 | + |
| 55 | +To start or restart the Coder deployment, use the following command: |
| 56 | + |
| 57 | +```shell |
| 58 | +coder server |
| 59 | +``` |
| 60 | + |
| 61 | +The output will provide you with a URL to access your deployment, where you'll |
| 62 | +create your first administrator account. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +Once you've signed in, you'll be brought to an empty workspaces page, which |
| 67 | +we'll soon populate with your first development environments. |
| 68 | + |
| 69 | +### More information on the Coder Server |
| 70 | + |
| 71 | +# Create your first template |
| 72 | + |
| 73 | +A common way to create a template is to begin with a starter template then |
| 74 | +modify it for your needs. Coder makes this easy with starter templates for |
| 75 | +popular development targets like Docker, Kubernetes, Azure, and so on. Once your |
| 76 | +template is up and running, you can edit it in the Coder dashboard. Coder even |
| 77 | +handles versioning for you so you can publish official updates or revert to |
| 78 | +previous versions. |
| 79 | + |
| 80 | +In this tutorial, you'll create your first template from the Docker starter |
| 81 | +template. |
| 82 | + |
| 83 | +## 1. Choose a starter template |
| 84 | + |
| 85 | +Select **Templates** to see the **Starter Templates**. Use the **Docker |
| 86 | +Containers** template by pressing **Use Template**. |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +> You can also a find a comprehensive list of starter templates in **Templates** |
| 91 | +> -> **Create Template** -> **Starter Templates**. |
| 92 | +
|
| 93 | +## 2. Create your template |
| 94 | + |
| 95 | +In **Create template**, fill in **Name** and **Display name**, then select |
| 96 | +**Create template**. |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +TODO: |
| 101 | + |
| 102 | +- add CLI guide for making a new template |
| 103 | +- refactor text below to be more beginner-friendly |
| 104 | + |
| 105 | +# Create a workspace |
| 106 | + |
| 107 | +## 1. Create a workspace from your template |
| 108 | + |
| 109 | +When the template is ready, select **Create Workspace**. |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +In **New workspace**, fill in **Name** then scroll down to select **Create |
| 114 | +Workspace**. |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | +Coder starts your new workspace from your template. |
| 119 | + |
| 120 | +After a few seconds, your workspace is ready to use. |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +## 4. Try out your new workspace |
| 125 | + |
| 126 | +This starter template lets you connect to your workspace in a few ways: |
| 127 | + |
| 128 | +- VS Code Desktop: Loads your workspace into |
| 129 | + [VS Code Desktop](https://code.visualstudio.com/Download) installed on your |
| 130 | + local computer. |
| 131 | +- code-server: Opens |
| 132 | + [browser-based VS Code](../user-guides/workspace-access/vscode.md) with your |
| 133 | + workspace. |
| 134 | +- Terminal: Opens a browser-based terminal with a shell in the workspace's |
| 135 | + Docker instance. |
| 136 | +- SSH: Use SSH to log in to the workspace from your local machine. If you |
| 137 | + haven't already, you'll have to install Coder on your local machine to |
| 138 | + configure your SSH client. |
| 139 | + |
| 140 | +> **Tip**: You can edit the template to let developers connect to a workspace in |
| 141 | +> [a few more ways](../admin/templates/managing-templates/devcontainers.md). |
| 142 | +
|
| 143 | +When you're done, you can stop the workspace. |
| 144 | + |
| 145 | +## 6. Modify your template |
| 146 | + |
| 147 | +Now you can modify your template to suit your team's needs. |
| 148 | + |
| 149 | +Let's replace the `golang` package in the Docker image with the `python3` |
| 150 | +package. You can do this by editing the template's `Dockerfile` directly in your |
| 151 | +web browser. |
| 152 | + |
| 153 | +In the Coder dashboard, select **Templates** then your first template. |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +In the drop-down menu, select **Edit files**. |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +Expand the **build** directory and select **Dockerfile**. |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | +Edit `build/Dockerfile` to replace `golang` with `python3`. |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | +Select **Build template** and wait for Coder to prepare the template for |
| 170 | +workspaces. |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | +Select **Publish version**. In the **Publish new version** dialog, make sure |
| 175 | +**Promote to default version** is checked then select **Publish**. |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | +Now when developers create a new workspace from this template, they can use |
| 180 | +Python 3 instead of Go. |
| 181 | + |
| 182 | +For developers with workspaces that were created with a previous version of your |
| 183 | +template, Coder will notify them that there's a new version of the template. |
| 184 | + |
| 185 | +You can also handle |
| 186 | +[change management](../admin/templates/managing-templates/change-management.md) |
| 187 | +through your own repo and continuous integration. |
0 commit comments