Skip to content

Commit f9efe4f

Browse files
committed
Add coder-on-railway
1 parent 6f60ec0 commit f9efe4f

File tree

8 files changed

+111
-130
lines changed

8 files changed

+111
-130
lines changed

posts/coder-on-railway/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div align="center">
2+
<a href="https://coder.com">
3+
<img src="https://raw.githubusercontent.com/coder/coder/main/docs/images/banner-white.png" style="width: 650px">
4+
</a>
5+
</div>
6+
7+
## Deploy Instructions
8+
9+
Coder provides a
10+
11+
[Quickstart](#quickstart) | [Docs](https://coder.com/docs) | [Why Coder](https://coder.com/why) | [Enterprise](https://coder.com/docs/v2/latest/enterprise)
12+
13+
[![discord](https://img.shields.io/discord/747933592273027093?label=discord)](https://discord.gg/coder)

posts/coder-on-railway/railway.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<div align="center">
2+
<a href="https://coder.com">
3+
<img src="https://raw.githubusercontent.com/coder/coder/main/docs/images/banner-white.png" style="width: 650px">
4+
</a>
5+
</div>
6+
7+
[Coder](https://coder.com) enables organizations to set up development environments in the cloud. Environments are defined with Terraform, connected through a secure high-speed Wireguard® tunnel, and are automatically shut down when not in use to save on costs. Coder gives engineering teams the flexibility to use the cloud for workloads that are most beneficial to them.
8+
9+
- Define development environments in Terraform
10+
- EC2 VMs, Kubernetes Pods, Docker Containers, etc.
11+
- Automatically shutdown idle resources to save on costs
12+
- Onboard developers in seconds instead of days
13+
14+
## Quickstart
15+
16+
### 1. Fill the environment variables
17+
18+
The current version of the template allows you to set an optional environment variable `CODER_WILDCARD_ACCESS_URL` which will allow you to forward ports from your workspace to a custom wildcard subdomain of the URL you provide. This is useful if you want to access a service running in your workspace from a browser. For example, if you set `CODER_WILDCARD_ACCESS_URL` to `*.coder.example.com`, you can access a service running on port 8080 in your workspace by visiting `8080--<username>--<workspace-name>.coder.example.com`.
19+
20+
### 2. Attach a custom domain
21+
22+
Your Coder deployment will always be accessible at `https://<app-name>.up.railway.app`. If you want to use a custom domain, you can do so by going to Dashboard > Coder (Service) > Settings > Domains and adding your domain and optionally a wildcard subdomain if you specified `CODER_WILDCARD_ACCESS_URL` in the previous step.
23+
24+
### 3. Create your first user
25+
26+
Create your first user by going to `https://<app-name>.up.railway.app` or your custom domain.
27+
28+
![Welcome to Coder](./static/coder_setup.png)
29+
30+
### 3. Create your first template
31+
32+
[**Templates**](https://coder.com/docs/v2/latest/templates): Templates are written in Terraform and describe the infrastructure for workspaces. Coder provides a set of starter templates to help you get started.
33+
34+
Choose a template to set up your first workspace. You can also [create your own templates](https://coder.com/docs/v2/latest/templates) to define your custom infrastructure with your preferred cloud provider.
35+
![starter templates](./static/starter_templates_welcome.png)
36+
37+
### 4. Create your first workspace
38+
39+
[**Workspaces**](https://coder.com/docs/v2/latest/workspaces): Workspaces contain the IDEs, dependencies, and configuration information needed for software development. You can create workspaces from templates. Here wea are showing the workspaces created from the Fly.io starter template in action.
40+
![fly.io workspace](./static/fly_workspace.png)
41+
42+
## Documentation
43+
44+
Browse our [**docs**](https://coder.com/docs/v2) or visit a specific section below:
45+
46+
[**Templates**](https://coder.com/docs/v2/latest/templates) | [**Workspaces**](https://coder.com/docs/v2/latest/workspaces) | [**IDEs**](https://coder.com/docs/v2/latest/ides) | [**Administration**](https://coder.com/docs/v2/latest/admin) | [**Enterprise**](https://coder.com/docs/v2/latest/enterprise)
47+
48+
## Community and Support
49+
50+
Feel free to [open an issue](https://github.com/coder/coder/issues/new) if you have questions, run into bugs, or have a feature request.
51+
52+
[Join our Discord](https://discord.gg/coder) to provide feedback on in-progress features, and chat with the community using Coder! [![discord](https://img.shields.io/discord/747933592273027093?label=discord)](https://discord.gg/coder)
53+
54+
## Related
55+
56+
We are always working on new integrations. Feel free to open an issue to request an integration. Contributions are welcome in any official or community repositories.
57+
58+
### Official
59+
60+
- [**VS Code Extension**](https://marketplace.visualstudio.com/items?itemName=coder.coder-remote): Open any Coder workspace in VS Code with a single click
61+
- [**JetBrains Gateway Extension**](https://plugins.jetbrains.com/plugin/19620-coder): Open any Coder workspace in JetBrains Gateway with a single click
62+
63+
### Community
64+
65+
- [**Coder GitHub Action**](https://github.com/marketplace/actions/update-coder-template): A GitHub Action that updates Coder templates
66+
- [**Various Templates**](https://github.com/coder/coder/examples/templates/community-templates.md): Hetzner Cloud, Docker in Docker, and other templates the community has built.
75.7 KB
Loading
Loading
Loading
Loading

posts/deploy-coder-on-fly-io/index.md

Lines changed: 32 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,58 @@
1-
# Deploy Coder on Fly.io
1+
---
2+
---
23

3-
Fly.io is a platform for deploying applications to the edge. It's a great fit for Coder because it's easy to deploy and scale, and it's easy to manage. In this guide, we'll walk through deploying Coder on Fly.io and creating workspaces as Fly.io (firecracker) machines.
4+
# Deploy Coder on Railway.app
45

5-
## Prerequisites
6+
## Quickstart
67

7-
- A Fly.io [account](https://fly.io/signup).
8-
- [Fly CLI](https://fly.io/docs/getting-started/installing-flyctl/) installed on your machine.
8+
### 1. Fill the environment variables
99

10-
## Deploy Coder
10+
The current version of the template allows you to set an optional environment variable `CODER_WILDCARD_ACCESS_URL` which will allow you to forward ports from your workspace to a custom wildcard subdomain of the URL you provide. This is useful if you want to access a service running in your workspace from a browser. For example, if you set `CODER_WILDCARD_ACCESS_URL` to `*.coder.example.com`, you can access a service running on port 8080 in your workspace by visiting `8080--<username>--<workspace-name>.coder.example.com`.
1111

12-
1. Log in to Fly.io with the CLI:
12+
### 2. Attach a custom domain
1313

14-
```bash
15-
flyctl auth login
16-
```
14+
Your Coder deployment will always be accessible at `https://<app-name>.up.railway.app`. If you want to use a custom domain, you can do so by going to Dashboard > Coder (Service) > Settings > Domains and adding your domain and optionally a wildcard subdomain if you specified `CODER_WILDCARD_ACCESS_URL` in the previous step.
1715

18-
2. Create a new fly postgres database:
16+
### 3. Create your first user
1917

20-
```bash
21-
flyctl postgres create --name <postgres-app-name>
22-
```
18+
Create your first user by going to `https://<app-name>.up.railway.app` or your custom domain.
2319

24-
3. Create a new fly app:
20+
![Welcome to Coder](./static/coder_setup.png)
2521

26-
```bash
27-
flyctl apps create --name <coder-app-name>
28-
```
22+
### 3. Create your first template
2923

30-
4. Connect to the database with the coder fly app:
24+
[**Templates**](https://coder.com/docs/v2/latest/templates): Templates are written in Terraform and describe the infrastructure for workspaces. Coder provides a set of starter templates to help you get started.
3125

32-
```bash
33-
flyctl postgres attach --app <coder-app-name> <postgres-app-name>
34-
```
26+
Choose a template to set up your first workspace. You can also [create your own templates](https://coder.com/docs/v2/latest/templates) to define your custom infrastructure with your preferred cloud provider.
27+
![starter templates](./static/starter_templates_welcome.png)
3528

36-
**Important** Copy the connection string that is displayed in the terminal. You'll need it in the next step.
29+
### 4. Create your first workspace
3730

38-
5. Create a new secret with the name `CODER_PG_CONNECTION_URL` and the value as the connection string you copied in the previous step.
31+
[**Workspaces**](https://coder.com/docs/v2/latest/workspaces): Workspaces contain the IDEs, dependencies, and configuration information needed for software development. You can create workspaces from templates. Here wea are showing the workspaces created from the Fly.io starter template in action.
32+
![fly.io workspace](./static/fly_workspace.png)
3933

40-
```
41-
flyctl secrets set CODER_PG_CONNECTION_URL=<connection-string> --app <coder-app-name>
42-
```
34+
## Documentation
4335

44-
6. Edit the `fly.toml` file and update as per the example below:
36+
Browse our [**docs**](https://coder.com/docs/v2) or visit a specific section below:
4537

46-
```toml
47-
app = "<app-name>" # Replace <app-name> with the name of your app
48-
kill_signal = "SIGINT"
49-
kill_timeout = 5
50-
primary_region = "ams" # See a list of regions here: https://fly.io/docs/reference/regions/
38+
[**Templates**](https://coder.com/docs/v2/latest/templates) | [**Workspaces**](https://coder.com/docs/v2/latest/workspaces) | [**IDEs**](https://coder.com/docs/v2/latest/ides) | [**Administration**](https://coder.com/docs/v2/latest/admin) | [**Enterprise**](https://coder.com/docs/v2/latest/enterprise)
5139

52-
[experimental]
53-
auto_rollback = true
54-
private_network = true # Allows Coder to connect to the database
40+
## Community and Support
5541

56-
[build]
57-
image = "ghcr.io/coder/coder:latest"
42+
Feel free to [open an issue](https://github.com/coder/coder/issues/new) if you have questions, run into bugs, or have a feature request.
5843

59-
[env]
60-
CODER_ACCESS_URL = "https://<coder-app-name>.fly.dev" # Replace <app-name> with the name of your app
61-
CODER_HTTP_ADDRESS = "0.0.0.0:3000"
62-
#CODER_VERBOSE = "true" # Uncomment this if you want to see more logs
63-
CODER_TELEMETRY_INSTALL_SOURCE = "fly.io"
44+
[Join our Discord](https://discord.gg/coder) to provide feedback on in-progress features, and chat with the community using Coder! [![discord](https://img.shields.io/discord/747933592273027093?label=discord)](https://discord.gg/coder)
6445

65-
[[services]]
66-
protocol = "tcp"
67-
internal_port = 3000
68-
processes = ["app"]
46+
## Related
6947

70-
[[services.ports]]
71-
port = 80
72-
handlers = ["http"]
73-
force_https = true
48+
We are always working on new integrations. Feel free to open an issue to request an integration. Contributions are welcome in any official or community repositories.
7449

75-
[[services.ports]]
76-
port = 443
77-
handlers = ["tls", "http"]
78-
[services.concurrency]
79-
type = "connections"
80-
hard_limit = 25
50+
### Official
8151

82-
```
52+
- [**VS Code Extension**](https://marketplace.visualstudio.com/items?itemName=coder.coder-remote): Open any Coder workspace in VS Code with a single click
53+
- [**JetBrains Gateway Extension**](https://plugins.jetbrains.com/plugin/19620-coder): Open any Coder workspace in JetBrains Gateway with a single click
8354

84-
7. Deploy the app:
55+
### Community
8556

86-
Run the following command to deploy the app from the directory where the `fly.toml` file is located:
87-
88-
```bash
89-
flyctl deploy --app <coder-app-name>
90-
```
91-
92-
8. Scale the Coder app to 1GB of memory:
93-
94-
```bash
95-
flyctl scale memory 1024 --app <coder-app-name>
96-
```
97-
98-
8. Congratulations! You've deployed Coder on Fly.io!. Go to the URL of your app and create your first user!
99-
100-
> If you want to use a custom domain, you can do so by following the instructions [here](https://fly.io/docs/app-guides/custom-domains-with-fly/).
101-
> ![Welcome to Coder](./static/welcome.png)
102-
103-
## Create your first template
104-
105-
A template is a set of instructions that Coder uses to create a workspace. In this section, we'll create a template that uses a Fly.io machine as the workspace.
106-
107-
1. Install Coder locally by following the instructions [here](https://coder.com/docs/v2/latest/install) or if you are on linux/macOS, you can run the following command:
108-
109-
```bash
110-
curl -fsSL https://coder.com/get-coder.sh | bash
111-
```
112-
113-
2. Login to Coder:
114-
115-
```bash
116-
coder login <coder-url>
117-
```
118-
119-
3. Create a new template by running the following command and following the prompts:
120-
121-
```bash
122-
coder templates init
123-
```
124-
125-
4. Choose the `fly-docker-image` template and cd into the `fly-docker-image` directory.
126-
127-
5. Create the new template by running the following command from the `fly-docker-image` directory:
128-
129-
```bash
130-
coder templates push fly-docker-image --variable fly_api_token=$(flyctl auth token)
131-
```
132-
133-
![template](./static/template-1.png)
134-
135-
> If coder is deployed as a fly.io app, instead of setting variable `fly_api_token` you can also set a fly.io secret with the name `FLY_API_TOKEN`
136-
>
137-
> ```bash
138-
> flyctl secrets set FLY_API_TOKEN=$(flyctl auth token)
139-
> ```
140-
141-
6. Go to the Coder UI and create a new workspace using the `fly-docker-image` template.
142-
143-
![workspace-1](./static/workspace-1.png)
144-
![workspace-2](./static/workspace-2.png)
145-
146-
7. This will deploy code-server on a Fly.io machine using the docker image. You can access the code-server instance by clicking on the `Code Server` button.
147-
148-
![workspace-3](./static/workspace-3.png)
149-
150-
## Update Coder
151-
152-
To update the Coder version, run `flyctl deploy --aap <coder-app-name>` again and it will pull the latest version of Coder.
153-
154-
## Next Steps
155-
156-
> To modify or write your first coder template, check out the [template docs](https://coder.com/docs/v2/latest/templates).
57+
- [**Coder GitHub Action**](https://github.com/marketplace/actions/update-coder-template): A GitHub Action that updates Coder templates
58+
- [**Various Templates**](https://github.com/coder/coder/examples/templates/community-templates.md): Hetzner Cloud, Docker in Docker, and other templates the community has built.

0 commit comments

Comments
 (0)