|
| 1 | +# Install |
| 2 | + |
| 3 | +This article walks you through the various ways of installing and deploying Coder. |
| 4 | + |
| 5 | +## docker-compose |
| 6 | + |
| 7 | +Before proceeding, please ensure that you have both Docker and the [latest version of |
| 8 | +Coder](https://github.com/coder/coder/releases) installed. |
| 9 | + |
| 10 | +1. Clone the `coder` repository: |
| 11 | + |
| 12 | + ```console |
| 13 | + git clone git@github.com:coder/coder.git |
| 14 | + ``` |
| 15 | + |
| 16 | +1. Navigate into the `coder` folder. Coder requires a non-`localhost` access URL |
| 17 | + for non-Docker-based examples; if you have a public IP or a domain/reverse |
| 18 | + proxy, you can provide this value before running `docker-compose up` to |
| 19 | + start the service: |
| 20 | + |
| 21 | + ```console |
| 22 | + cd coder |
| 23 | + CODER_ACCESS_URL=https://coder.mydomain.com |
| 24 | + docker-compose up |
| 25 | + ``` |
| 26 | + |
| 27 | + Otherwise, you can start the service: |
| 28 | + |
| 29 | + ```console |
| 30 | + cd coder |
| 31 | + docker-compose up |
| 32 | + ``` |
| 33 | + |
| 34 | + Alternatively, if you would like to start a **temporary deployment**: |
| 35 | + |
| 36 | + ```console |
| 37 | + docker run --rm -it \ |
| 38 | + -e CODER_DEV_MODE=true \ |
| 39 | + -v /var/run/docker.sock:/var/run/docker.sock \ |
| 40 | + ghcr.io/coder/coder:v0.5.10 |
| 41 | + ``` |
| 42 | + |
| 43 | +1. Open a new terminal window, and run `coder login <yourAccessURL>` to create |
| 44 | + your first user (once you've done so, you can navigate to `yourAccessURL` and |
| 45 | + log in with these credentials). |
| 46 | + |
| 47 | +1. Next, copy a sample template into a new directory so that you can create a custom template in a |
| 48 | + subsequent step (be sure that you're working in the directory where you want |
| 49 | + your templates stored): |
| 50 | + |
| 51 | + ```console |
| 52 | + coder templates init |
| 53 | + ``` |
| 54 | + |
| 55 | +1. Navigate into the new directory and create a new template: |
| 56 | + |
| 57 | + ```console |
| 58 | + cd examples/docker |
| 59 | + coder templates create |
| 60 | + ``` |
| 61 | + |
| 62 | + Follow the prompts displayed to proceed. When done, you'll see the following |
| 63 | + message: |
| 64 | + |
| 65 | + ```console |
| 66 | + The docker template has been created! Developers can |
| 67 | + provision a workspace with this template using: |
| 68 | + |
| 69 | + coder create --template="docker" [workspace name] |
| 70 | + ``` |
| 71 | + |
| 72 | +1. At this point, you're ready to provision your first workspace: |
| 73 | + |
| 74 | + ```console |
| 75 | + coder create --template="docker" [workspace name] |
| 76 | + ``` |
| 77 | + |
| 78 | + Follow the on-screen prompts to set the parameters for your workspace. If |
| 79 | + the process is successful, you'll get information regarding your workspace: |
| 80 | + |
| 81 | + ```console |
| 82 | + ┌─────────────────────────────────────────────────────────────────┐ |
| 83 | + │ RESOURCE STATUS ACCESS │ |
| 84 | + ├─────────────────────────────────────────────────────────────────┤ |
| 85 | + │ docker_container.workspace ephemeral │ |
| 86 | + │ └─ dev (linux, amd64) ⦾ connecting [0s] coder ssh main │ |
| 87 | + ├─────────────────────────────────────────────────────────────────┤ |
| 88 | + │ docker_volume.coder_volume ephemeral │ |
| 89 | + └─────────────────────────────────────────────────────────────────┘ |
| 90 | + The main workspace has been created! |
| 91 | + ``` |
| 92 | + |
| 93 | +You can now access your workspace via your web browser by navigating to your |
| 94 | +access URL, or you can connect to it via SSH by running: |
| 95 | + |
| 96 | +```console |
| 97 | +coder ssh [workspace name] |
| 98 | +``` |
0 commit comments